From f8fdce6cb0da4d832ffa730e0dacb5544c1f8154 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 25 Jan 2011 11:49:34 +1000 Subject: 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 --- src/pacman/query.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pacman/query.c') diff --git a/src/pacman/query.c b/src/pacman/query.c index c79133d1..734875be 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -170,7 +170,7 @@ static int query_fileowner(alpm_list_t *targets) } free(dname); - for(i = alpm_db_get_pkgcache(db_local); i && !found; i = alpm_list_next(i)) { + for(i = alpm_db_get_pkgcache_list(db_local); i && !found; i = alpm_list_next(i)) { alpm_list_t *j; pmpkg_t *info = alpm_list_getdata(i); @@ -228,7 +228,7 @@ static int query_search(alpm_list_t *targets) searchlist = alpm_db_search(db_local, targets); freelist = 1; } else { - searchlist = alpm_db_get_pkgcache(db_local); + searchlist = alpm_db_get_pkgcache_list(db_local); freelist = 0; } if(searchlist == NULL) { @@ -511,7 +511,7 @@ int pacman_query(alpm_list_t *targets) return(1); } - for(i = alpm_db_get_pkgcache(db_local); i; i = alpm_list_next(i)) { + for(i = alpm_db_get_pkgcache_list(db_local); i; i = alpm_list_next(i)) { pkg = alpm_list_getdata(i); if(filter(pkg)) { int value = display(pkg); -- cgit v1.2.3-24-g4f1b