mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-04 05:10:40 +00:00
Simplification: we are already able to search for all packages. #70
This commit is contained in:
@@ -107,12 +107,10 @@ func aptlySnapshotPull(cmd *commander.Command, args []string) error {
|
||||
if !noRemove {
|
||||
// Remove all packages with the same name and architecture
|
||||
for _, pkg := range searchResults {
|
||||
for pS := packageList.Search(deb.Dependency{Architecture: pkg.Architecture, Pkg: pkg.Name}, allMatches); pS != nil; {
|
||||
for _, p := range pS {
|
||||
packageList.Remove(p)
|
||||
context.Progress().ColoredPrintf("@r[-]@| %s removed", p)
|
||||
}
|
||||
pS = packageList.Search(deb.Dependency{Architecture: pkg.Architecture, Pkg: pkg.Name}, allMatches)
|
||||
pS := packageList.Search(deb.Dependency{Architecture: pkg.Architecture, Pkg: pkg.Name}, true)
|
||||
for _, p := range pS {
|
||||
packageList.Remove(p)
|
||||
context.Progress().ColoredPrintf("@r[-]@| %s removed", p)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,6 +195,5 @@ Example:
|
||||
cmd.Flag.Bool("no-remove", false, "don't remove other package versions when pulling package")
|
||||
cmd.Flag.Bool("all-matches", false, "pull all the packages that satisfy the dependency version requirements")
|
||||
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user