[pacman-dev] [PATCH] set package origin when adding to db cache
Andrew Gregory
andrew.gregory.8 at gmail.com
Sun Feb 8 08:46:02 UTC 2015
Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
---
lib/libalpm/db.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index cef6c11..d679d8b 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -579,6 +579,10 @@ int _alpm_db_add_pkgincache(alpm_db_t *db, alpm_pkg_t *pkg)
_alpm_log(db->handle, ALPM_LOG_DEBUG, "adding entry '%s' in '%s' cache\n",
newpkg->name, db->treename);
+ newpkg->origin = (db->status & DB_STATUS_LOCAL)
+ ? ALPM_PKG_FROM_LOCALDB
+ : ALPM_PKG_FROM_SYNCDB;
+ newpkg->origin_data.db = db;
db->pkgcache = _alpm_pkghash_add_sorted(db->pkgcache, newpkg);
free_groupcache(db);
--
2.3.0
More information about the pacman-dev
mailing list