summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2015-02-08 02:27:42 -0500
committerAllan McRae <allan@archlinux.org>2015-02-12 13:22:40 +1000
commit0c9f4329f8dd2a6eb6d7717998e71c3a17fd2583 (patch)
tree7c8c8bd531c4d48c897a0d6279c80615754300fc
parent43413894d4284c1afdaac48f7f250885e0ff6acf (diff)
downloadpacman-0c9f4329f8dd2a6eb6d7717998e71c3a17fd2583.tar.xz
set package origin when adding to db cache
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--lib/libalpm/db.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 466c96f1..26e351fd 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -574,6 +574,13 @@ 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);
+ if(newpkg->origin == ALPM_PKG_FROM_FILE) {
+ free(newpkg->origin_data.file);
+ }
+ 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);