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-05-18 15:53:32 -0400
committerAllan McRae <allan@archlinux.org>2013-06-26 15:32:15 +1000
commitec831e05f58e3db1c06aadb23a87b5b82ab3ebf3 (patch)
tree038c95cdd849f1b434c1a75e79ca879754ad634d /test
parent00513823dc9e15c4de12c02f8faa4dd72ca4ee4e (diff)
deps.c: check for indirect deps when ordering
On upgrades, indirect dependencies were not being detected if there was a dependency in between them that was not part of the transaction. For example, with the dependency chain: pkg1 -> pkg2 -> pkg3, if pkg1 and pkg3 are being upgraded but not pkg2 pacman would not order pkg1 and pkg3 properly. This was particularly problematic when replacements were involved because the replaced package(s) would be removed at the start of the transaction. If an install script required the replacer and lacked a direct dependency, it could fail. Fixes FS#32764. Partially fixes FS#23011. 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/replace100.py2
-rw-r--r--test/pacman/tests/upgrade100.py44
2 files changed, 44 insertions, 2 deletions
diff --git a/test/pacman/tests/replace100.py b/test/pacman/tests/replace100.py
index f94ca0f7..dcb71119 100644
--- a/test/pacman/tests/replace100.py
+++ b/test/pacman/tests/replace100.py
@@ -41,5 +41,3 @@ self.addrule("PKG_VERSION=util-linux|2.19-1")
self.addrule("PKG_VERSION=kernel26|2.6.37.1-1")
self.addrule("FILE_EXIST=sbin/blkid")
self.addrule("FILE_EXIST=foundit")
-
-self.expectfailure = True
diff --git a/test/pacman/tests/upgrade100.py b/test/pacman/tests/upgrade100.py
new file mode 100644
index 00000000..3f7a0212
--- /dev/null
+++ b/test/pacman/tests/upgrade100.py
@@ -0,0 +1,44 @@
+self.description = "Indirect dependency ordering (FS#32764)"
+
+lp1 = pmpkg("fcitx-gtk2", "1.0-1");
+lp1.depends = ["gtk2"]
+self.addpkg2db("local", lp1)
+
+lp2 = pmpkg("gtk2", "1.0-1");
+lp2.depends = ["pango"]
+self.addpkg2db("local", lp2)
+
+lp3 = pmpkg("pango", "1.0-1");
+lp3.depends = ["harfbuzz"]
+self.addpkg2db("local", lp3)
+
+lp4 = pmpkg("harfbuzz", "1.0-1");
+lp4.depends = ["icu"]
+self.addpkg2db("local", lp4)
+
+lp5 = pmpkg("icu", "1.0-1");
+self.addpkg2db("local", lp5)
+
+sp1 = pmpkg("fcitx-gtk2", "1.0-2");
+sp1.depends = ["gtk2"]
+sp1.install['post_upgrade'] = "[ -f bin/harfbuzz ] && echo > found_harfbuzz"
+self.addpkg2db("sync", sp1)
+
+sp4 = pmpkg("harfbuzz", "1.0-2");
+sp4.depends = ["icu"]
+sp4.files = ["bin/harfbuzz"]
+sp4.install['post_upgrade'] = "[ -f bin/icu ] && echo > found_icu"
+self.addpkg2db("sync", sp4)
+
+sp5 = pmpkg("icu", "1.0-2");
+sp5.files = ["bin/icu"]
+self.addpkg2db("sync", sp5)
+
+self.args = "-Su"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=fcitx-gtk2|1.0-2")
+self.addrule("PKG_VERSION=harfbuzz|1.0-2")
+self.addrule("PKG_VERSION=icu|1.0-2")
+self.addrule("FILE_EXIST=found_harfbuzz")
+self.addrule("FILE_EXIST=found_icu")