diff options
author | Dan McGee <dan@archlinux.org> | 2007-11-12 19:40:08 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-11-14 18:49:50 -0600 |
commit | 7219326dd4d01d7e49b8a40746f5495c1c329c9c (patch) | |
tree | 01cefb7c433105ba88850dc272ea7791d9954c0b /src/pacman | |
parent | f5fcaf0b3c8d05e94d08d6357324cfa69d8ceae7 (diff) |
Remove REQUIREDBY usage from libalpm
Instead of using the often-busted REQUIREDBY entries in the pacman database,
compute them each time they are required. This should help many things:
1. Simplify the codebase
2. Prevent future database corruption
3. Ensure when we do use requiredby, it is always correct
4. Shrink the pmpkg_t memory overhead
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman')
-rw-r--r-- | src/pacman/package.c | 4 | ||||
-rw-r--r-- | src/pacman/query.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/pacman/package.c b/src/pacman/package.c index caaed462..84cdb204 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -82,7 +82,9 @@ void dump_pkg_full(pmpkg_t *pkg, int level) list_display(_("Optional Deps :"), alpm_pkg_get_optdepends(pkg)); /* Only applicable if installed */ if(level > 0) { - list_display(_("Required By :"), alpm_pkg_get_requiredby(pkg)); + alpm_list_t *requiredby = alpm_pkg_compute_requiredby(pkg); + list_display(_("Required By :"), requiredby); + FREELIST(requiredby); } list_display(_("Conflicts With :"), alpm_pkg_get_conflicts(pkg)); list_display(_("Replaces :"), alpm_pkg_get_replaces(pkg)); diff --git a/src/pacman/query.c b/src/pacman/query.c index 9ede00ab..b6814259 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -248,9 +248,11 @@ static int is_foreign(pmpkg_t *pkg) static int is_orphan(pmpkg_t *pkg) { - if(alpm_pkg_get_requiredby(pkg) == NULL) { + alpm_list_t *requiredby = alpm_pkg_compute_requiredby(pkg); + if(requiredby == NULL) { return(1); } + FREELIST(requiredby); return(0); } |