mirror of
https://github.com/moparisthebest/pacman
synced 2025-02-28 09:21:53 -05:00
add.c : fix upgrade026 pactest.
This was the case of the bash packaging error where a file was removed from the package but not the backup array. I just added a sanity check so that only the files from the backup array that are also in the filelist are used. I had to edit upgrade026 pactest slightly : it required the file to be copied to .pacsave instead of moved. But just moving it should be enough, as we agreed on the ML : http://www.archlinux.org/pipermail/pacman-dev/2007-December/010440.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
04472f925a
commit
601a85082d
@ -238,8 +238,13 @@ static int upgrade_remove(pmpkg_t *oldpkg, pmpkg_t *newpkg, pmtrans_t *trans, pm
|
|||||||
* so this removal operation doesn't kill them */
|
* so this removal operation doesn't kill them */
|
||||||
alpm_list_t *old_noupgrade = alpm_list_strdup(handle->noupgrade);
|
alpm_list_t *old_noupgrade = alpm_list_strdup(handle->noupgrade);
|
||||||
/* old package backup list */
|
/* old package backup list */
|
||||||
|
alpm_list_t *filelist = alpm_pkg_get_files(newpkg);
|
||||||
for(b = alpm_pkg_get_backup(newpkg); b; b = b->next) {
|
for(b = alpm_pkg_get_backup(newpkg); b; b = b->next) {
|
||||||
char *backup = _alpm_backup_file(b->data);
|
char *backup = _alpm_backup_file(b->data);
|
||||||
|
/* safety check (fix the upgrade026 pactest) */
|
||||||
|
if(!alpm_list_find_str(filelist, backup)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
_alpm_log(PM_LOG_DEBUG, "adding %s to the NoUpgrade array temporarily\n",
|
_alpm_log(PM_LOG_DEBUG, "adding %s to the NoUpgrade array temporarily\n",
|
||||||
backup);
|
backup);
|
||||||
handle->noupgrade = alpm_list_add(handle->noupgrade,
|
handle->noupgrade = alpm_list_add(handle->noupgrade,
|
||||||
|
@ -14,4 +14,4 @@ self.args = "-U %s" % p.filename()
|
|||||||
self.addrule("PKG_VERSION=dummy|1.0-2")
|
self.addrule("PKG_VERSION=dummy|1.0-2")
|
||||||
self.addrule("FILE_PACSAVE=etc/dummy.conf")
|
self.addrule("FILE_PACSAVE=etc/dummy.conf")
|
||||||
self.addrule("!FILE_PACNEW=etc/dummy.conf")
|
self.addrule("!FILE_PACNEW=etc/dummy.conf")
|
||||||
self.addrule("FILE_EXIST=etc/dummy.conf")
|
self.addrule("!FILE_EXIST=etc/dummy.conf")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user