mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-12 03:21:33 +00:00
Remove -dry-run flag for aptly snapshot filter, as it is useless. #82
This commit is contained in:
@@ -70,20 +70,17 @@ func aptlySnapshotFilter(cmd *commander.Command, args []string) error {
|
||||
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
|
||||
destination := deb.NewSnapshotFromPackageList(args[1], []*deb.Snapshot{source}, result,
|
||||
fmt.Sprintf("Filtered '%s', query was: '%s'", source.Name, strings.Join(args[2:], " ")))
|
||||
// Create <destination> snapshot
|
||||
destination := deb.NewSnapshotFromPackageList(args[1], []*deb.Snapshot{source}, result,
|
||||
fmt.Sprintf("Filtered '%s', query was: '%s'", source.Name, strings.Join(args[2:], " ")))
|
||||
|
||||
err = context.CollectionFactory().SnapshotCollection().Add(destination)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to create snapshot: %s", err)
|
||||
}
|
||||
|
||||
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)
|
||||
err = context.CollectionFactory().SnapshotCollection().Add(destination)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to create snapshot: %s", err)
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
@@ -104,7 +101,6 @@ Example:
|
||||
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")
|
||||
|
||||
return cmd
|
||||
|
||||
@@ -984,10 +984,6 @@ $ aptly snapshot filter wheezy\-main wheezy\-required \(cqPriorioty (required)\(
|
||||
Options:
|
||||
.
|
||||
.TP
|
||||
\-\fBdry\-run\fR=false
|
||||
don\(cqt create destination snapshot, just show what would be pulled
|
||||
.
|
||||
.TP
|
||||
\-\fBwith\-deps\fR=false
|
||||
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>`.
|
||||
@@ -56,21 +56,6 @@ class FilterSnapshot3Test(BaseTest):
|
||||
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):
|
||||
"""
|
||||
filter snapshot: no such snapshot
|
||||
|
||||
Reference in New Issue
Block a user