From 8f12ce618cbaa57945b62ab1d462620c316212dd Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Tue, 7 Mar 2006 18:44:50 +0000 Subject: fixed reason loading if the pkg cache is loaded with DEPENDS only --- lib/libalpm/add.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib') 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); -- cgit v1.2.3-70-g09d2