mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-26 13:47:40 +00:00
snapshot: add cli flag for taking newest during merge
This commit is contained in:
@@ -28,10 +28,16 @@ func aptlySnapshotMerge(cmd *commander.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newest := context.flags.Lookup("newest").Value.Get().(bool)
|
||||||
|
|
||||||
result := sources[0].RefList()
|
result := sources[0].RefList()
|
||||||
|
|
||||||
for i := 1; i < len(sources); i++ {
|
for i := 1; i < len(sources); i++ {
|
||||||
result = result.Merge(sources[i].RefList(), true, true)
|
if newest {
|
||||||
|
result = result.Merge(sources[i].RefList(), false, true)
|
||||||
|
} else {
|
||||||
|
result = result.Merge(sources[i].RefList(), true, false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceDescription := make([]string, len(sources))
|
sourceDescription := make([]string, len(sources))
|
||||||
@@ -71,5 +77,7 @@ Example:
|
|||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmd.Flag.Bool("newest", false, "Take newest package of set during merge")
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user