Fix duplicate packages when printing dependencies

e01c4b3969 made some bad assumptions.
Removing the aliases caused packages to not installed when required only
through provides and not their package name. This fixes that by
re enabling the aliases and simply removing duplicates at the end.
This commit is contained in:
morganamilo committed 2018-03-01 21:57:52 +00:00
1 parent 4934d24643
commit 2fbfbc4de1
1 file changed
+14
+14
View File
@@ -99,6 +99,20 @@ func getDepCatagories(pkgs []string, dt *depTree) (*depCatagories, error) {
})
}
dupes := make(map[*alpm.Package]struct{})
filteredRepo := make([]*alpm.Package, 0)
for _, pkg := range dc.Repo {
_, ok := dupes[pkg]
if ok {
continue
}
dupes[pkg] = struct{}{}
filteredRepo = append(filteredRepo, pkg)
}
dc.Repo = filteredRepo
return dc, nil
}