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
+1 -4
View File
@@ -107,13 +107,11 @@ func aptlySnapshotPull(cmd *commander.Command, args []string) error {
if !noRemove { if !noRemove {
// Remove all packages with the same name and architecture // Remove all packages with the same name and architecture
for _, pkg := range searchResults { for _, pkg := range searchResults {
for pS := packageList.Search(deb.Dependency{Architecture: pkg.Architecture, Pkg: pkg.Name}, allMatches); pS != nil; { pS := packageList.Search(deb.Dependency{Architecture: pkg.Architecture, Pkg: pkg.Name}, true)
for _, p := range pS { for _, p := range pS {
packageList.Remove(p) packageList.Remove(p)
context.Progress().ColoredPrintf("@r[-]@| %s removed", p) context.Progress().ColoredPrintf("@r[-]@| %s removed", p)
} }
pS = packageList.Search(deb.Dependency{Architecture: pkg.Architecture, Pkg: pkg.Name}, allMatches)
}
} }
} }
@@ -197,6 +195,5 @@ Example:
cmd.Flag.Bool("no-remove", false, "don't remove other package versions when pulling package") 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") cmd.Flag.Bool("all-matches", false, "pull all the packages that satisfy the dependency version requirements")
return cmd return cmd
} }