allow to exclude provided packages from list.Search

This commit is contained in:
André Roth
2024-11-04 16:04:00 +01:00
parent 74364544c2
commit eafec74c29
7 changed files with 61 additions and 58 deletions

View File

@@ -653,7 +653,7 @@ func apiSnapshotsPull(c *gin.Context) {
// If we haven't seen such name-architecture pair and were instructed to remove, remove it
if !noRemove && !seen {
// Remove all packages with the same name and architecture
packageSearchResults := toPackageList.Search(deb.Dependency{Architecture: pkg.Architecture, Pkg: pkg.Name}, true)
packageSearchResults := toPackageList.Search(deb.Dependency{Architecture: pkg.Architecture, Pkg: pkg.Name}, true, false)
for _, p := range packageSearchResults {
toPackageList.Remove(p)
removedPackages = append(removedPackages, p.String())