summaryrefslogtreecommitdiffstats
path: root/lib/libalpm
diff options
context:
space:
mode:
authorChantry Xavier <shiningxc@gmail.com>2007-12-22 20:54:01 +0100
committerDan McGee <dan@archlinux.org>2007-12-29 02:57:11 +0100
commitc913c53322a7bd4a006a905df4087092a0630ab4 (patch)
tree287395eda82b3f679494364236d02b7d469b3e21 /lib/libalpm
parent73aa6b610e22377a40c567156b610319ffb9e024 (diff)
downloadpacman-c913c53322a7bd4a006a905df4087092a0630ab4.tar.gz
pacman-c913c53322a7bd4a006a905df4087092a0630ab4.tar.xz
libalpm/add.c: disable buggy backup handling code that didn't do anything.
As I mentioned earlier on the ML : http://www.archlinux.org/pipermail/pacman-dev/2007-December/010416.html the first part of commit 843d368ef6 had no effect because of a bug. So I fixed the bug, but since this would change backup handling behavior, and possibly require other bigger changes to work right, I decided to just disable that part temporarily, and left a TODO in the code. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/add.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 11c5eb8c..292a0111 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -234,26 +234,37 @@ static int upgrade_remove(pmpkg_t *oldpkg, pmpkg_t *newpkg, pmtrans_t *trans, pm
tr->skip_remove = alpm_list_strdup(trans->skip_remove);
const alpm_list_t *b;
- /* Add files in the OLD and NEW backup array to the NoUpgrade array
+ /* Add files in the NEW backup array to the NoUpgrade array
* so this removal operation doesn't kill them */
alpm_list_t *old_noupgrade = alpm_list_strdup(handle->noupgrade);
/* old package backup list */
- for(b = alpm_pkg_get_backup(oldpkg); b; b = b->next) {
- const char *backup = b->data;
+ for(b = alpm_pkg_get_backup(newpkg); b; b = b->next) {
+ char *backup = _alpm_backup_file(b->data);
_alpm_log(PM_LOG_DEBUG, "adding %s to the NoUpgrade array temporarily\n",
backup);
- handle->noupgrade = alpm_list_add(handle->noupgrade, strdup(backup));
+ handle->noupgrade = alpm_list_add(handle->noupgrade,
+ backup);
}
+
+ /* TODO: we could also add files in the OLD backup array, but this would
+ * change the backup handling behavior, and break several pactests, and we
+ * can't do this just before 3.1 release.
+ * The unlink_file function in remove.c would also need to be reviewed. */
+#if 0
/* new package backup list */
- for(b = alpm_pkg_get_backup(newpkg); b; b = b->next) {
- const char *backup = b->data;
+ for(b = alpm_pkg_get_backup(oldpkg); b; b = b->next) {
+ char *backup = _alpm_backup_file(b->data);
/* make sure we don't add duplicate entries */
if(!alpm_list_find_ptr(handle->noupgrade, backup)) {
_alpm_log(PM_LOG_DEBUG, "adding %s to the NoUpgrade array temporarily\n",
backup);
- handle->noupgrade = alpm_list_add(handle->noupgrade, strdup(backup));
+ handle->noupgrade = alpm_list_add(handle->noupgrade,
+ _alpm_backup_file(backup));
+ handle->noupgrade = alpm_list_add(handle->noupgrade,
+ backup);
}
}
+#endif
int ret = _alpm_remove_commit(tr, db);