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/be_files.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/be_files.c') diff --git a/lib/libalpm/be_files.c b/lib/libalpm/be_files.c index 0f055e03..c0298049 100644 --- a/lib/libalpm/be_files.c +++ b/lib/libalpm/be_files.c @@ -415,7 +415,11 @@ int _alpm_db_populate(pmdb_t *db) _alpm_pkg_free(pkg); continue; } - pkg->origin = PKG_FROM_CACHE; + if(db == handle->db_local) { + pkg->origin = PKG_FROM_LOCALDB; + } else { + pkg->origin = PKG_FROM_SYNCDB; + } pkg->origin_data.db = db; /* add to the collection */ _alpm_log(PM_LOG_FUNCTION, "adding '%s' to package cache for db '%s'\n", -- cgit v1.2.3-54-g00ecf