Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2013-12-11 11:58:28 -0500
committerAllan McRae <allan@archlinux.org>2013-12-19 15:19:52 +1000
commit2f8be5f8db1e157d3bcdac763b79c7989567ca6d (patch)
tree434e2718fe11193383c5cf737b033c718cf7f277 /test
parent714609639f9a316e037252d31437505520a7966f (diff)
trans_prepare: always sort trans->remove by deps
Packages can be removed during a sync transaction either directly or due to conflicts and need to be sorted. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test')
-rw-r--r--test/pacman/tests/TESTS1
-rw-r--r--test/pacman/tests/sync046.py29
2 files changed, 30 insertions, 0 deletions
diff --git a/test/pacman/tests/TESTS b/test/pacman/tests/TESTS
index fc6a7e8b..f52a1f74 100644
--- a/test/pacman/tests/TESTS
+++ b/test/pacman/tests/TESTS
@@ -158,6 +158,7 @@ TESTS += test/pacman/tests/sync042.py
TESTS += test/pacman/tests/sync043.py
TESTS += test/pacman/tests/sync044.py
TESTS += test/pacman/tests/sync045.py
+TESTS += test/pacman/tests/sync046.py
TESTS += test/pacman/tests/sync050.py
TESTS += test/pacman/tests/sync051.py
TESTS += test/pacman/tests/sync052.py
diff --git a/test/pacman/tests/sync046.py b/test/pacman/tests/sync046.py
new file mode 100644
index 00000000..63e8cc36
--- /dev/null
+++ b/test/pacman/tests/sync046.py
@@ -0,0 +1,29 @@
+self.description = "Install a sync package with interdependent conflicts"
+
+sp = pmpkg("pkg1")
+sp.conflicts = ["pkg2", "pkg3", "pkg4"]
+self.addpkg2db("sync", sp);
+
+lp1 = pmpkg("pkg2")
+lp1.depends = ["pkg3"]
+lp1.install['pre_remove'] = "[ -f pkg3file ] && echo '' > pkg2ok"
+self.addpkg2db("local", lp1);
+
+lp2 = pmpkg("pkg3")
+lp2.files = ["pkg3file"]
+self.addpkg2db("local", lp2);
+
+lp3 = pmpkg("pkg4")
+lp3.depends = ["pkg3"]
+lp3.install['pre_remove'] = "[ -f pkg3file ] && echo '' > pkg4ok"
+self.addpkg2db("local", lp3);
+
+self.args = "-S %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")
+self.addrule("!PKG_EXIST=pkg4")
+self.addrule("FILE_EXIST=pkg2ok")
+self.addrule("FILE_EXIST=pkg4ok")