Simplification: we are already able to search for all packages. #70

This commit is contained in:
Andrey Smirnov
2014-07-10 00:10:53 +04:00
parent 566604d4ba
commit 1c30b2b9de
+4 -7
View File
@@ -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
}