From 017184fab55b22c1efd8a7d6d6d832ca302d8e15 Mon Sep 17 00:00:00 2001 From: Olivier Brunel Date: Mon, 4 Mar 2013 09:48:10 +0100 Subject: libalpm: Search for replacers before literals Since 882bff36 literals would be searched before replacers, resulting in a package being replaced by another not actually being replaced under certain conditions (e.g. they're both in the same repo). This change effectively reversed the expectations in test sync132. This patch switches the order back to replacers first, thus making sure if a package is replacing another one, the change will always happen, even if both are in the same repo. Note that a package replacing another one in a repo with higher priority will not be done, see FS#11737 and test sync1105 Signed-off-by: Olivier Brunel Signed-off-by: Allan McRae --- test/pacman/tests/replace102.py | 2 -- test/pacman/tests/sync1105.py | 17 +++++++++++++++++ test/pacman/tests/sync132.py | 4 ++-- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 test/pacman/tests/sync1105.py (limited to 'test') diff --git a/test/pacman/tests/replace102.py b/test/pacman/tests/replace102.py index ca05d4e6..fe0bdad5 100644 --- a/test/pacman/tests/replace102.py +++ b/test/pacman/tests/replace102.py @@ -21,5 +21,3 @@ self.addrule("PACMAN_RETCODE=0") self.addrule("!PKG_EXIST=python-yaml") self.addrule("PKG_VERSION=python2-yaml|5-1") self.addrule("FILE_EXIST=lib/python2/file") - -self.expectfailure = True diff --git a/test/pacman/tests/sync1105.py b/test/pacman/tests/sync1105.py new file mode 100644 index 00000000..cc43c8ca --- /dev/null +++ b/test/pacman/tests/sync1105.py @@ -0,0 +1,17 @@ +self.description = "Upgrade with a replacement in a repo with lower prioriy" + +sp1 = pmpkg("pkg2") +self.addpkg2db("sync1", sp1) + +sp2 = pmpkg("pkg1") +sp2.replaces = ["pkg2"] +self.addpkg2db("sync2", sp2) + +lp = pmpkg("pkg2") +self.addpkg2db("local", lp) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("!PKG_EXIST=pkg1") +self.addrule("PKG_EXIST=pkg2") diff --git a/test/pacman/tests/sync132.py b/test/pacman/tests/sync132.py index 2d671c73..5e85727d 100644 --- a/test/pacman/tests/sync132.py +++ b/test/pacman/tests/sync132.py @@ -14,5 +14,5 @@ self.addpkg2db("local", lp) self.args = "-Su" self.addrule("PACMAN_RETCODE=0") -self.addrule("!PKG_EXIST=pkg1") -self.addrule("PKG_EXIST=pkg2") +self.addrule("PKG_EXIST=pkg1") +self.addrule("!PKG_EXIST=pkg2") -- cgit v1.2.3-70-g09d2