diff options
author | Andrew Gregory <andrew.gregory.8@gmail.com> | 2018-11-16 19:47:30 -0800 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2018-12-10 11:12:06 +1000 |
commit | f28ddd9d93ba5e16848cc2ed85a38cec4d2f2b65 (patch) | |
tree | bd45b81e79647c5a9510571e27b1b5d915ef43ae /test/pacman/tests/replace-and-upgrade-package.py | |
parent | 9f1b735d76d04665d6324e723e163a52ca27567c (diff) | |
download | pacman-f28ddd9d93ba5e16848cc2ed85a38cec4d2f2b65.tar.xz |
check localdb before upgrading package
Commit 2ee7a8d89ad693617307260604e1d58757fd2978 replaced a manual check
for a local package with a check for the "oldpkg" member, which gets set
at the beginning of the transaction. If the package was also in the
remove list, such as when a package gets replaced, it would no longer be
in the local db and pacman would try to remove it twice, resulting in
superfluous error messages.
Fixes: FS#50875, FS#55534
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test/pacman/tests/replace-and-upgrade-package.py')
-rw-r--r-- | test/pacman/tests/replace-and-upgrade-package.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/pacman/tests/replace-and-upgrade-package.py b/test/pacman/tests/replace-and-upgrade-package.py new file mode 100644 index 00000000..ef2152a7 --- /dev/null +++ b/test/pacman/tests/replace-and-upgrade-package.py @@ -0,0 +1,27 @@ +self.description = 'Simultaneously replace and upgrade a package' + +# replacement package +sp1 = pmpkg('foo1', '1-2') +sp1.replaces = ['foo=1-1'] +sp1.conflicts = ['foo=1-1'] +self.addpkg2db('sync', sp1) + +# upgrade package +sp2 = pmpkg('foo', '2-1') +self.addpkg2db('sync', sp2) + +# depend on upgraded package to pull it into transaction +sp3 = pmpkg('bar', '1-1') +sp3.depends = [ 'foo=2-1' ] +self.addpkg2db('sync', sp3) + +lp = pmpkg('foo', '1-1') +self.addpkg2db('local', lp) + +self.args = "-Su bar" + +self.addrule('PACMAN_RETCODE=0') +self.addrule('PKG_VERSION=foo1|1-2') +self.addrule('PKG_VERSION=foo|2-1') +self.addrule('PKG_VERSION=bar|1-1') +self.addrule('!PACMAN_OUTPUT=error') |