do not list optional deps in orphans

This commit is contained in:
guinux 2015-10-09 10:17:34 +02:00
parent 00fd98ae27
commit 31c0625b7a

View File

@ -382,11 +382,15 @@ namespace Pamac {
Pamac.Package[] pkgs = {}; Pamac.Package[] pkgs = {};
foreach (var alpm_pkg in alpm_config.handle.localdb.pkgcache) { foreach (var alpm_pkg in alpm_config.handle.localdb.pkgcache) {
if (alpm_pkg.reason == Alpm.Package.Reason.DEPEND) { if (alpm_pkg.reason == Alpm.Package.Reason.DEPEND) {
Alpm.List<string?> *list = alpm_pkg.compute_requiredby (); Alpm.List<string?> *requiredby = alpm_pkg.compute_requiredby ();
if (list->length == 0) { if (requiredby->length == 0) {
pkgs += Pamac.Package (alpm_pkg, null); Alpm.List<string?> *optionalfor = alpm_pkg.compute_optionalfor ();
if (optionalfor->length == 0) {
pkgs += Pamac.Package (alpm_pkg, null);
}
Alpm.List.free_all (optionalfor);
} }
Alpm.List.free_all (list); Alpm.List.free_all (requiredby);
} }
} }
return pkgs; return pkgs;