Allow changing "download sources" option for the mirror. #109

This commit is contained in:
Andrey Smirnov
2014-09-22 19:36:48 +04:00
parent 5e1bd0ff0e
commit fa786332de
5 changed files with 11 additions and 5 deletions

View File

@@ -25,6 +25,8 @@ func aptlyMirrorEdit(cmd *commander.Command, args []string) error {
repo.Filter = flag.Value.String()
case "filter-with-deps":
repo.FilterWithDeps = flag.Value.Get().(bool)
case "with-sources":
repo.DownloadSources = flag.Value.Get().(bool)
}
})
@@ -71,6 +73,7 @@ Example:
cmd.Flag.String("filter", "", "filter packages in mirror")
cmd.Flag.Bool("filter-with-deps", false, "when filtering, include dependencies of matching packages as well")
cmd.Flag.Bool("with-sources", false, "download source packages in addition to binary packages")
return cmd
}

View File

@@ -434,6 +434,10 @@ filter packages in mirror
\-\fBfilter\-with\-deps\fR=false
when filtering, include dependencies of matching packages as well
.
.TP
\-\fBwith\-sources\fR=false
download source packages in addition to binary packages
.
.SH "SEARCH MIRROR FOR PACKAGES MATCHING QUERY"
\fBaptly\fR \fBmirror\fR \fBsearch\fR \fIname\fR \fIpackage\-query\fR
.

View File

@@ -1 +1 @@
Mirror [wheezy-main]: http://mirror.yandex.ru/debian/ wheezy successfully updated.
Mirror [wheezy-main]: http://mirror.yandex.ru/debian/ wheezy [src] successfully updated.

View File

@@ -3,10 +3,9 @@ Archive Root URL: http://mirror.yandex.ru/debian/
Distribution: wheezy
Components: main
Architectures: i386, amd64
Download Sources: no
Download Sources: yes
Filter: nginx
Filter With Deps: yes
Last update: 2014-06-28 01:23:25 MSK
Number of packages: 56121
Information from release file:

View File

@@ -4,10 +4,10 @@ from lib import BaseTest
class EditMirror1Test(BaseTest):
"""
edit mirror: enable filter
edit mirror: enable filter & download sources
"""
fixtureDB = True
runCmd = "aptly mirror edit -filter=nginx -filter-with-deps wheezy-main"
runCmd = "aptly mirror edit -filter=nginx -filter-with-deps -with-sources wheezy-main"
def check(self):
self.check_output()