From d1126db1281596ba8ea960bfa963e86731d28b5e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 11 May 2008 12:00:18 -0500 Subject: Allow local and sync db to be treated separately Implement this seemingly simple change in package.h: typedef enum _pmpkgfrom_t { - PKG_FROM_CACHE = 1, - PKG_FROM_FILE + PKG_FROM_FILE = 1, + PKG_FROM_LOCALDB, + PKG_FROM_SYNCDB } pmpkgfrom_t; which requires flushing out several assumptions from around the codebase with regards to usage of the PKG_FROM_CACHE value. Make some changes where required to allow the switch, and now the correct value should be set (via a crude hack) depending on whether a package was loaded as an entry in a local db or a sync db. This patch underwent some big rebasing from Allan and Dan. Signed-off-by: Dan McGee Signed-off-by: Allan McRae --- lib/libalpm/package.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/package.h') diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index 14f81f92..daff9717 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -31,8 +31,9 @@ #include "db.h" typedef enum _pmpkgfrom_t { - PKG_FROM_CACHE = 1, - PKG_FROM_FILE + PKG_FROM_FILE = 1, + PKG_FROM_LOCALDB, + PKG_FROM_SYNCDB } pmpkgfrom_t; struct __pmpkg_t { @@ -67,8 +68,8 @@ struct __pmpkg_t { /* internal */ pmpkgfrom_t origin; /* Replaced 'void *data' with this union as follows: - origin == PKG_FROM_CACHE, use pkg->origin_data.db origin == PKG_FROM_FILE, use pkg->origin_data.file + origin == PKG_FROM_*DB, use pkg->origin_data.db */ union { pmdb_t *db; -- cgit v1.2.3