1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-23 00:08:50 -05:00

Pass the old package with PM_TRANS_EVT_UPGRADE_START

This is more rational and coherent with PM_TRANS_EVT_UPGRADE_DONE.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Nagy Gabor 2008-07-30 23:36:46 +02:00 committed by Dan McGee
parent b3033a59e9
commit 3ff7701e89

View File

@ -650,17 +650,18 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
if(local) { if(local) {
is_upgrade = 1; 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 */ /* we'll need to save some record for backup checks later */
oldpkg = _alpm_pkg_dup(local); oldpkg = _alpm_pkg_dup(local);
/* make sure all infos are loaded because the database entry /* make sure all infos are loaded because the database entry
* will be removed soon */ * will be removed soon */
_alpm_db_read(oldpkg->origin_data.db, oldpkg, INFRQ_ALL); _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 */ /* copy over the install reason */
newpkg->reason = alpm_pkg_get_reason(local); newpkg->reason = alpm_pkg_get_reason(oldpkg);
/* pre_upgrade scriptlet */ /* pre_upgrade scriptlet */
if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) { if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {