summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2011-01-25 11:49:34 +1000
committerAllan McRae <allan@archlinux.org>2011-02-04 09:55:45 +1000
commitf8fdce6cb0da4d832ffa730e0dacb5544c1f8154 (patch)
treeeeba547be38459b041b9fa8089f8171ba006ee19 /src/util
parent5dae577a87795e7666f05613cf9aa7207fd17346 (diff)
downloadpacman-f8fdce6cb0da4d832ffa730e0dacb5544c1f8154.tar.xz
Read pkgcache into hash
Read the package information for sync/local databases into a pmpkghash_t structure. Provide a alpm_db_get_pkgcache_list() method that returns the list from the hash object. Most usages of alpm_db_get_pkgcache are converted to this at this stage for ease of implementation. Review whether these are better accessing the hash table directly at a later stage. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/cleanupdelta.c2
-rw-r--r--src/util/pactree.c4
-rw-r--r--src/util/testdb.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/util/cleanupdelta.c b/src/util/cleanupdelta.c
index 4403e9fa..36a4e072 100644
--- a/src/util/cleanupdelta.c
+++ b/src/util/cleanupdelta.c
@@ -79,7 +79,7 @@ static void checkdbs(char *dbpath, alpm_list_t *dbnames) {
alpm_strerrorlast());
return;
}
- checkpkgs(alpm_db_get_pkgcache(db));
+ checkpkgs(alpm_db_get_pkgcache_list(db));
}
}
diff --git a/src/util/pactree.c b/src/util/pactree.c
index 6a10006f..947ed61c 100644
--- a/src/util/pactree.c
+++ b/src/util/pactree.c
@@ -303,7 +303,7 @@ static void walk_deps(pmpkg_t *pkg, int depth)
for(i = alpm_pkg_get_depends(pkg); i; i = alpm_list_next(i)) {
pmdepend_t *depend = alpm_list_getdata(i);
- pmpkg_t *provider = alpm_find_satisfier(alpm_db_get_pkgcache(db_local),
+ pmpkg_t *provider = alpm_find_satisfier(alpm_db_get_pkgcache_list(db_local),
alpm_dep_get_name(depend));
if(provider) {
@@ -347,7 +347,7 @@ int main(int argc, char *argv[])
/* we only care about the first non option arg for walking */
target_name = argv[optind];
- pkg = alpm_find_satisfier(alpm_db_get_pkgcache(db_local), target_name);
+ pkg = alpm_find_satisfier(alpm_db_get_pkgcache_list(db_local), target_name);
if(!pkg) {
fprintf(stderr, "error: package '%s' not found\n", target_name);
ret = 1;
diff --git a/src/util/testdb.c b/src/util/testdb.c
index 461cf23a..124a66dd 100644
--- a/src/util/testdb.c
+++ b/src/util/testdb.c
@@ -142,7 +142,7 @@ static int check_localdb(void) {
alpm_strerrorlast());
cleanup(EXIT_FAILURE);
}
- pkglist = alpm_db_get_pkgcache(db);
+ pkglist = alpm_db_get_pkgcache_list(db);
ret += checkdeps(pkglist);
ret += checkconflicts(pkglist);
return(ret);
@@ -162,7 +162,7 @@ static int check_syncdbs(alpm_list_t *dbnames) {
ret = 1;
goto cleanup;
}
- pkglist = alpm_db_get_pkgcache(db);
+ pkglist = alpm_db_get_pkgcache_list(db);
syncpkglist = alpm_list_join(syncpkglist, alpm_list_copy(pkglist));
}
ret += checkdeps(syncpkglist);