Remove -dry-run flag for aptly snapshot filter, as it is useless. #82

This commit is contained in:
Andrey Smirnov
2014-09-22 01:54:35 +04:00
parent 144ccbf809
commit 9c92b81706
5 changed files with 9 additions and 40 deletions
+1 -5
View File
@@ -70,9 +70,6 @@ func aptlySnapshotFilter(cmd *commander.Command, args []string) error {
return fmt.Errorf("unable to filter: %s", err) return fmt.Errorf("unable to filter: %s", err)
} }
if context.flags.Lookup("dry-run").Value.Get().(bool) {
context.Progress().Printf("\nNot creating snapshot, as dry run was requested.\n")
} else {
// Create <destination> snapshot // Create <destination> snapshot
destination := deb.NewSnapshotFromPackageList(args[1], []*deb.Snapshot{source}, result, destination := deb.NewSnapshotFromPackageList(args[1], []*deb.Snapshot{source}, result,
fmt.Sprintf("Filtered '%s', query was: '%s'", source.Name, strings.Join(args[2:], " "))) fmt.Sprintf("Filtered '%s', query was: '%s'", source.Name, strings.Join(args[2:], " ")))
@@ -83,7 +80,7 @@ func aptlySnapshotFilter(cmd *commander.Command, args []string) error {
} }
context.Progress().Printf("\nSnapshot %s successfully filtered.\nYou can run 'aptly publish snapshot %s' to publish snapshot as Debian repository.\n", destination.Name, destination.Name) context.Progress().Printf("\nSnapshot %s successfully filtered.\nYou can run 'aptly publish snapshot %s' to publish snapshot as Debian repository.\n", destination.Name, destination.Name)
}
return err return err
} }
@@ -104,7 +101,6 @@ Example:
Flag: *flag.NewFlagSet("aptly-snapshot-filter", flag.ExitOnError), Flag: *flag.NewFlagSet("aptly-snapshot-filter", flag.ExitOnError),
} }
cmd.Flag.Bool("dry-run", false, "don't create destination snapshot, just show what would be pulled")
cmd.Flag.Bool("with-deps", false, "include dependent packages as well") cmd.Flag.Bool("with-deps", false, "include dependent packages as well")
return cmd return cmd
-4
View File
@@ -984,10 +984,6 @@ $ aptly snapshot filter wheezy\-main wheezy\-required \(cqPriorioty (required)\(
Options: Options:
. .
.TP .TP
\-\fBdry\-run\fR=false
don\(cqt create destination snapshot, just show what would be pulled
.
.TP
\-\fBwith\-deps\fR=false \-\fBwith\-deps\fR=false
include dependent packages as well include dependent packages as well
. .
@@ -1,4 +0,0 @@
Loading packages (4742)...
Building indexes...
Not creating snapshot, as dry run was requested.
@@ -1,4 +0,0 @@
List of snapshots:
* [snap1]: Snapshot from mirror [wheezy-backports]: http://mirror.yandex.ru/debian/ wheezy-backports
To get more information about snapshot, run `aptly snapshot show <name>`.
-15
View File
@@ -56,21 +56,6 @@ class FilterSnapshot3Test(BaseTest):
self.check_cmd_output("aptly snapshot show -with-packages snap2", "snapshot_show", match_prepare=remove_created_at) self.check_cmd_output("aptly snapshot show -with-packages snap2", "snapshot_show", match_prepare=remove_created_at)
class FilterSnapshot4Test(BaseTest):
"""
filter snapshot: dry-run
"""
fixtureDB = True
fixtureCmds = [
"aptly snapshot create snap1 from mirror wheezy-backports",
]
runCmd = "aptly snapshot filter -dry-run snap1 snap2 'rsyslog (>= 7.4.4)'"
def check(self):
self.check_output()
self.check_cmd_output("aptly snapshot list", "snapshot_list")
class FilterSnapshot5Test(BaseTest): class FilterSnapshot5Test(BaseTest):
""" """
filter snapshot: no such snapshot filter snapshot: no such snapshot