On 03/17/14 at 05:53pm, Max Mertens wrote:
This allows alpm frontends to change the install reason of just installed packages, because alpm_pkg_set_reason checks pkg->origin and pkg->origin_data.db.
Signed-off-by: Max Mertens <max.mail@dameweb.de> --- lib/libalpm/db.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index b9cbed7..91cfd52 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -571,6 +571,11 @@ int _alpm_db_add_pkgincache(alpm_db_t *db, alpm_pkg_t *pkg) return -1; }
+ if(db == newpkg->handle->db_local) { + newpkg->origin = ALPM_PKG_FROM_LOCALDB; + newpkg->origin_data.db = newpkg->handle->db_local; + } +
This shouldn't be limited to the local db. If this function is used to add a package to a sync db the origin and origin_data still need to be set. apg
_alpm_log(db->handle, ALPM_LOG_DEBUG, "adding entry '%s' in '%s' cache\n", newpkg->name, db->treename); db->pkgcache = _alpm_pkghash_add_sorted(db->pkgcache, newpkg); -- 1.9.0