1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00
pacman/test/pacman/tests/replace100.py
Andrew Gregory ec831e05f5 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>
2013-06-26 15:32:15 +10:00

44 lines
1.3 KiB
Python

self.description = "Sysupgrade with a replace and dependency chain"
sp1 = pmpkg("util-linux", "2.19-1")
sp1.replaces = ["util-linux-ng"]
sp1.conflicts = ["util-linux-ng"]
sp1.provides = ["util-linux-ng=2.19"]
sp1.files = ["sbin/blkid"]
self.addpkg2db("sync", sp1)
sp2 = pmpkg("mkinitcpio", "0.6.8-1")
sp2.depends = ["util-linux-ng>=2.17"]
self.addpkg2db("sync", sp2)
sp3 = pmpkg("kernel26", "2.6.37.1-1")
sp3.depends = ["mkinitcpio>=0.6.8"]
# /sbin/blkid is in both util-linux and util-linux-ng; however, if we cannot
# find it, that means we ended up in limbo between removing the old named
# package and installing the new named package.
sp3.install['post_upgrade'] = "if [ -f sbin/blkid ]; then echo '' > foundit; fi"
self.addpkg2db("sync", sp3)
lp1 = pmpkg("util-linux-ng", "2.18-1")
lp1.files = ["sbin/blkid"]
self.addpkg2db("local", lp1)
lp2 = pmpkg("mkinitcpio", "0.6.8-1")
lp2.depends = ["util-linux-ng>=2.17"]
self.addpkg2db("local", lp2)
lp3 = pmpkg("kernel26", "2.6.37-1")
lp3.depends = ["mkinitcpio>=0.6.8"]
self.addpkg2db("local", lp3)
self.args = "-Su"
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PKG_EXIST=util-linux-ng")
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")