index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-03-27 20:41:23 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-03-27 20:41:23 -0500 |
commit | 3f269503d53811cf45037022a263f2447e427a0b (patch) | |
tree | 437753d28e59d3add63e48b4cfd4d77cd95e1cfc /lib/libalpm/package.c | |
parent | 630b7b94c39ddc60d4e2b3c80d5d9f3101049b93 (diff) | |
parent | ea216d3f5a84814c512ab51ac37a4055b82032c3 (diff) |
-rw-r--r-- | lib/libalpm/package.c | 16 |
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 257b2aeb..69c2b852 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -376,14 +376,14 @@ static void find_requiredby(pmpkg_t *pkg, pmdb_t *db, alpm_list_t **reqs) { const alpm_list_t *i; for(i = _alpm_db_get_pkgcache(db); i; i = i->next) { - if(!i->data) { - continue; - } pmpkg_t *cachepkg = i->data; - if(_alpm_dep_edge(cachepkg, pkg)) { - const char *cachepkgname = cachepkg->name; - if(alpm_list_find_str(*reqs, cachepkgname) == NULL) { - *reqs = alpm_list_add(*reqs, strdup(cachepkgname)); + alpm_list_t *i; + for(i = alpm_pkg_get_depends(cachepkg); i; i = i->next) { + if(_alpm_depcmp(pkg, i->data)) { + const char *cachepkgname = cachepkg->name; + if(alpm_list_find_str(*reqs, cachepkgname) == NULL) { + *reqs = alpm_list_add(*reqs, strdup(cachepkgname)); + } } } } @@ -414,8 +414,8 @@ 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); } + reqs = alpm_list_msort(reqs, alpm_list_count(reqs), _alpm_str_cmp); } } return reqs; |