diff options
Diffstat (limited to 'lib/libalpm/add.c')
-rw-r--r-- | lib/libalpm/add.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index eef7aab1..50405895 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -114,7 +114,7 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) /* look for unsatisfied dependencies */ _alpm_log(PM_LOG_DEBUG, "looking for unsatisfied dependencies\n"); - lp = alpm_checkdeps(db, 1, NULL, trans->packages); + lp = alpm_checkdeps(_alpm_db_get_pkgcache(db), 1, NULL, trans->packages); if(lp != NULL) { if(data) { *data = lp; @@ -650,17 +650,18 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count, if(local) { is_upgrade = 1; - EVENT(trans, PM_TRANS_EVT_UPGRADE_START, newpkg, NULL); - _alpm_log(PM_LOG_DEBUG, "upgrading package %s-%s\n", - newpkg->name, newpkg->version); - /* we'll need to save some record for backup checks later */ oldpkg = _alpm_pkg_dup(local); /* make sure all infos are loaded because the database entry * will be removed soon */ _alpm_db_read(oldpkg->origin_data.db, oldpkg, INFRQ_ALL); + + EVENT(trans, PM_TRANS_EVT_UPGRADE_START, newpkg, oldpkg); + _alpm_log(PM_LOG_DEBUG, "upgrading package %s-%s\n", + newpkg->name, newpkg->version); + /* copy over the install reason */ - newpkg->reason = alpm_pkg_get_reason(local); + newpkg->reason = alpm_pkg_get_reason(oldpkg); /* pre_upgrade scriptlet */ if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) { |