index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-08-19 11:06:55 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-19 11:09:57 -0500 |
commit | 6d544984f2418ea34caab4c433580487b760362a (patch) | |
tree | cf0510b97a6495587c87598a70bf8761189f5c32 /lib/libalpm/add.c | |
parent | 9934b3bd345011eef6a96249d8d90de594c04cd0 (diff) |
-rw-r--r-- | lib/libalpm/add.c | 11 |
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 8bbf1574..cb8551e8 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -468,19 +468,22 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg, is_upgrade = 1; /* we'll need to save some record for backup checks later */ - oldpkg = _alpm_pkg_dup(local); + if(_alpm_pkg_dup(local, &oldpkg) == -1) { + ret = -1; + goto cleanup; + } - EVENT(trans, ALPM_TRANS_EVT_UPGRADE_START, newpkg, oldpkg); + EVENT(trans, ALPM_TRANS_EVT_UPGRADE_START, newpkg, local); _alpm_log(handle, ALPM_LOG_DEBUG, "upgrading package %s-%s\n", newpkg->name, newpkg->version); /* copy over the install reason */ - newpkg->reason = alpm_pkg_get_reason(oldpkg); + newpkg->reason = alpm_pkg_get_reason(local); /* pre_upgrade scriptlet */ if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) { _alpm_runscriptlet(handle, newpkg->origin_data.file, - "pre_upgrade", newpkg->version, oldpkg->version); + "pre_upgrade", newpkg->version, local->version); } } else { is_upgrade = 0; |