Ensure pre_upgrade scriptlet gets old package version

This was accidentally broken in the refactor done in commit 73139ccb.

Fixes FS#29371.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2012-05-04 11:41:40 -05:00
parent 5f71570ec4
commit 1bf05e706b
1 changed files with 3 additions and 2 deletions

View File

@ -488,8 +488,9 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
if(alpm_pkg_has_scriptlet(newpkg) &&
!(trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
const char *scriptlet_name = is_upgrade ? "pre_upgrade" : "pre_install";
_alpm_runscriptlet(handle, pkgfile,
scriptlet_name, newpkg->version, NULL, 1);
_alpm_runscriptlet(handle, pkgfile, scriptlet_name,
newpkg->version, oldpkg ? oldpkg->version : NULL, 1);
}
/* we override any pre-set reason if we have alldeps or allexplicit set */