summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-03-07 18:44:50 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-03-07 18:44:50 +0000
commit8f12ce618cbaa57945b62ab1d462620c316212dd (patch)
treeb63313a625a674d9bedbed474dcaa5df7b278d18 /lib
parent27be34c09bfe14ab0b4b2c96092ae0b60ca16555 (diff)
downloadpacman-8f12ce618cbaa57945b62ab1d462620c316212dd.tar.xz
fixed reason loading if the pkg cache is loaded with DEPENDS only
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/add.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 80117731..687774db 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -318,6 +318,13 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
oldpkg->backup = _alpm_list_strdup(local->backup);
}
+ /* copy over the install reason */
+ if(!(local->infolevel & INFRQ_DESC)) {
+ _alpm_log(PM_LOG_DEBUG, "loading DESC info for '%s'", local->name);
+ _alpm_db_read(db, INFRQ_DESC, local);
+ }
+ info->reason = local->reason;
+
/* pre_upgrade scriptlet */
if(info->scriptlet && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
_alpm_runscriptlet(handle->root, info->data, "pre_upgrade", info->version, oldpkg ? oldpkg->version : NULL);
@@ -334,8 +341,6 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
FREETRANS(tr);
RET_ERR(PM_ERR_TRANS_ABORT, -1);
}
- /* copy over the install reason */
- info->reason = local->reason;
if(_alpm_remove_loadtarget(tr, db, info->name) == -1) {
FREETRANS(tr);
RET_ERR(PM_ERR_TRANS_ABORT, -1);