Sort and avoid duplicates in -Sii output
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
526806e7ac
commit
98ee520907
1 changed files with 4 additions and 1 deletions
|
@ -565,10 +565,12 @@ static void find_requiredby(pmpkg_t *pkg, pmdb_t *db, alpm_list_t **reqs)
|
|||
pmpkg_t *cachepkg = i->data;
|
||||
if(_alpm_dep_edge(cachepkg, pkg)) {
|
||||
const char *cachepkgname = cachepkg->name;
|
||||
if(alpm_list_find_str(*reqs, cachepkgname) == 0) {
|
||||
*reqs = alpm_list_add(*reqs, strdup(cachepkgname));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Compute the packages requiring a given package.
|
||||
|
@ -595,6 +597,7 @@ alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(pmpkg_t *pkg)
|
|||
for(i = handle->dbs_sync; i; i = i->next) {
|
||||
db = i->data;
|
||||
find_requiredby(pkg, db, &reqs);
|
||||
reqs = alpm_list_msort(reqs, alpm_list_count(reqs), _alpm_str_cmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue