Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/db.c
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2015-02-12 13:33:20 +1000
committerAllan McRae <allan@archlinux.org>2015-02-12 13:33:20 +1000
commit27e3125c8d65b169ac2e76c7f029ee3a4a170745 (patch)
tree8841572774efd92ae73133ffc178038879858438 /lib/libalpm/db.c
parent295a3491adc4af5c8634ac82777212ed9c664457 (diff)
parentba869597fb64f1101012df4b0d834ed5eced0b7c (diff)
Merge branch 'maint'
Diffstat (limited to 'lib/libalpm/db.c')
-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 cef6c119..fe208be0 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -579,6 +579,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);