Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNagy Gabor <ngaba@bibl.u-szeged.hu>2008-07-30 23:36:46 +0200
committerDan McGee <dan@archlinux.org>2008-08-23 09:20:32 -0500
commit3ff7701e89f3193f8ea57a5910ae508a2aed65a3 (patch)
tree64ea4f2de3f580da98ae26c7a53bb457d54f2f23
parentb3033a59e922684a41b00bd94f8976995dd015da (diff)
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>
-rw-r--r--lib/libalpm/add.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index eef7aab1..3c832b3e 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -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)) {