summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/package.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-11-13 02:40:08 +0100
committerDan McGee <dan@archlinux.org>2007-11-15 01:49:50 +0100
commit7219326dd4d01d7e49b8a40746f5495c1c329c9c (patch)
tree01cefb7c433105ba88850dc272ea7791d9954c0b /lib/libalpm/package.c
parentf5fcaf0b3c8d05e94d08d6357324cfa69d8ceae7 (diff)
downloadpacman-7219326dd4d01d7e49b8a40746f5495c1c329c9c.tar.gz
pacman-7219326dd4d01d7e49b8a40746f5495c1c329c9c.tar.xz
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 'lib/libalpm/package.c')
-rw-r--r--lib/libalpm/package.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index 7c2870c2..89785a14 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -405,20 +405,6 @@ alpm_list_t SYMEXPORT *alpm_pkg_get_optdepends(pmpkg_t *pkg)
return pkg->optdepends;
}
-alpm_list_t SYMEXPORT *alpm_pkg_get_requiredby(pmpkg_t *pkg)
-{
- ALPM_LOG_FUNC;
-
- /* Sanity checks */
- ASSERT(handle != NULL, return(NULL));
- ASSERT(pkg != NULL, return(NULL));
-
- if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DEPENDS)) {
- _alpm_db_read(pkg->origin_data.db, pkg, INFRQ_DEPENDS);
- }
- return pkg->requiredby;
-}
-
alpm_list_t SYMEXPORT *alpm_pkg_get_conflicts(pmpkg_t *pkg)
{
ALPM_LOG_FUNC;
@@ -695,7 +681,6 @@ pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg)
memcpy(newpkg, pkg, sizeof(pmpkg_t));
newpkg->licenses = alpm_list_strdup(alpm_pkg_get_licenses(pkg));
- newpkg->requiredby = alpm_list_strdup(alpm_pkg_get_requiredby(pkg));
newpkg->conflicts = alpm_list_strdup(alpm_pkg_get_conflicts(pkg));
newpkg->files = alpm_list_strdup(alpm_pkg_get_files(pkg));
newpkg->backup = alpm_list_strdup(alpm_pkg_get_backup(pkg));
@@ -729,7 +714,6 @@ void _alpm_pkg_free(pmpkg_t *pkg)
FREELIST(pkg->depends);
FREELIST(pkg->optdepends);
FREELIST(pkg->conflicts);
- FREELIST(pkg->requiredby);
FREELIST(pkg->groups);
FREELIST(pkg->provides);
FREELIST(pkg->replaces);
@@ -1098,13 +1082,6 @@ pmpkg_t *_alpm_pkg_find(const char *needle, alpm_list_t *haystack)
return(NULL);
}
-/* fill in requiredby field of package,
- * used when we want to install or add a package */
-void _alpm_pkg_update_requiredby(pmpkg_t *pkg)
-{
- pkg->requiredby = alpm_pkg_compute_requiredby(pkg);
-}
-
/* TODO this should either be public, or done somewhere else */
int _alpm_pkg_istoonew(pmpkg_t *pkg)
{