summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/db.h
diff options
context:
space:
mode:
authorNagy Gabor <ngaba@bibl.u-szeged.hu>2009-01-10 16:25:03 +0100
committerDan McGee <dan@archlinux.org>2009-01-13 06:59:37 +0100
commitcb7337eb640b70b295edb7b05b016b53352d8713 (patch)
tree29c28513a9ed07668902a06988cd9a1d74f96efc /lib/libalpm/db.h
parent4da70d800a25881f525498a451ae21b398a1d5b1 (diff)
downloadpacman-cb7337eb640b70b295edb7b05b016b53352d8713.tar.gz
pacman-cb7337eb640b70b295edb7b05b016b53352d8713.tar.xz
db->pkgcache_loaded and db->grpcache_loaded
Clearly the old code was more elegant (NULL cache indicated "not loaded"), but it had some drawbacks, so from now on we indicate the state of caches explicitly. Old drawbacks: When we had an empty database (unstable), libalpm called db_populate after every pkgcache access, because NULL pkgcache indicated "not loaded" state. This is not a common case, but the same situation can happen with grpcache, which is more problematic: If the user had a custom repo with no groups, grpcache was always NULL. (grpcache is also loaded per database.) Thus every get_grpcache call induced a load_grpcache operation, so the benefits of grpcache was completely lost. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/db.h')
-rw-r--r--lib/libalpm/db.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h
index 25b90b5f..edc4c93e 100644
--- a/lib/libalpm/db.h
+++ b/lib/libalpm/db.h
@@ -42,7 +42,9 @@ struct __pmdb_t {
char *path;
char *treename;
void *handle;
+ unsigned short pkgcache_loaded;
alpm_list_t *pkgcache;
+ unsigned short grpcache_loaded;
alpm_list_t *grpcache;
alpm_list_t *servers;
};