summaryrefslogtreecommitdiffstats
path: root/src/pacman/sync.c
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2011-01-25 02:49:34 +0100
committerAllan McRae <allan@archlinux.org>2011-02-04 00:55:45 +0100
commitf8fdce6cb0da4d832ffa730e0dacb5544c1f8154 (patch)
treeeeba547be38459b041b9fa8089f8171ba006ee19 /src/pacman/sync.c
parent5dae577a87795e7666f05613cf9aa7207fd17346 (diff)
downloadpacman-f8fdce6cb0da4d832ffa730e0dacb5544c1f8154.tar.gz
pacman-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/pacman/sync.c')
-rw-r--r--src/pacman/sync.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 26f6f824..7af1667a 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -328,7 +328,7 @@ static int sync_search(alpm_list_t *syncs, alpm_list_t *targets)
ret = alpm_db_search(db, targets);
freelist = 1;
} else {
- ret = alpm_db_get_pkgcache(db);
+ ret = alpm_db_get_pkgcache_list(db);
freelist = 0;
}
if(ret == NULL) {
@@ -469,7 +469,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets)
return(1);
}
- for(k = alpm_db_get_pkgcache(db); k; k = alpm_list_next(k)) {
+ for(k = alpm_db_get_pkgcache_list(db); k; k = alpm_list_next(k)) {
pmpkg_t *pkg = alpm_list_getdata(k);
if(strcmp(alpm_pkg_get_name(pkg), pkgstr) == 0) {
@@ -490,7 +490,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets)
for(j = syncs; j; j = alpm_list_next(j)) {
pmdb_t *db = alpm_list_getdata(j);
- for(k = alpm_db_get_pkgcache(db); k; k = alpm_list_next(k)) {
+ for(k = alpm_db_get_pkgcache_list(db); k; k = alpm_list_next(k)) {
pmpkg_t *pkg = alpm_list_getdata(k);
if(strcmp(alpm_pkg_get_name(pkg), pkgstr) == 0) {
@@ -511,7 +511,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets)
for(i = syncs; i; i = alpm_list_next(i)) {
pmdb_t *db = alpm_list_getdata(i);
- for(j = alpm_db_get_pkgcache(db); j; j = alpm_list_next(j)) {
+ for(j = alpm_db_get_pkgcache_list(db); j; j = alpm_list_next(j)) {
dump_pkg_sync(alpm_list_getdata(j), alpm_db_get_name(db), config->op_s_info);
}
}
@@ -555,7 +555,7 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets)
for(i = ls; i; i = alpm_list_next(i)) {
pmdb_t *db = alpm_list_getdata(i);
- for(j = alpm_db_get_pkgcache(db); j; j = alpm_list_next(j)) {
+ for(j = alpm_db_get_pkgcache_list(db); j; j = alpm_list_next(j)) {
pmpkg_t *pkg = alpm_list_getdata(j);
if (!config->quiet) {