From 72bc947cbb8ba752f021f28ec9e9a85c354918e3 Mon Sep 17 00:00:00 2001 From: Nagy Gabor Date: Sat, 12 Sep 2009 20:50:03 +0200 Subject: Fix "-Sd conflict_pkg" bug If the -d switch was invoked with -S (or -U), the removes list was simply lost, because trans->remove was computed in an "if(!(trans->flags & PM_TRANS_FLAG_NODEPS))" block. I've added a new pactest file, sync045.py (derived from sync043.py) to test this. Additionally, I did some other minor cleanups in sync_prepare: * preferred list is not needed anymore * I removed a needless alpm_list_remove_dupes line (the target list should not contain dupes at all) * I moved alpm_list_free(remove); to cleanup part to eliminate a possible memleak Signed-off-by: Nagy Gabor Signed-off-by: Dan McGee --- pactest/tests/sync045.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 pactest/tests/sync045.py (limited to 'pactest/tests') diff --git a/pactest/tests/sync045.py b/pactest/tests/sync045.py new file mode 100644 index 00000000..574c0a52 --- /dev/null +++ b/pactest/tests/sync045.py @@ -0,0 +1,18 @@ +self.description = "Install a sync package conflicting with two local ones (-d)" + +sp = pmpkg("pkg1") +sp.conflicts = ["pkg2", "pkg3"] +self.addpkg2db("sync", sp); + +lp1 = pmpkg("pkg2") +self.addpkg2db("local", lp1); + +lp2 = pmpkg("pkg3") +self.addpkg2db("local", lp2); + +self.args = "-Sd %s --ask=4" % sp.name + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_EXIST=pkg1") +self.addrule("!PKG_EXIST=pkg2") +self.addrule("!PKG_EXIST=pkg3") -- cgit v1.2.3-24-g4f1b