From e702f56ea671c6cd1154a0ddb41fa63e97587c85 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 25 Jul 2010 22:15:25 -0500 Subject: Add two pactests for group and --needed interaction The first step for resolving FS#20221. sync023 is the case from the bug report; sync022 is already working fine but we have no tests at all that test the --needed option in any form. Signed-off-by: Dan McGee --- test/pacman/tests/sync022.py | 25 +++++++++++++++++++++++++ test/pacman/tests/sync023.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 test/pacman/tests/sync022.py create mode 100644 test/pacman/tests/sync023.py (limited to 'test') diff --git a/test/pacman/tests/sync022.py b/test/pacman/tests/sync022.py new file mode 100644 index 00000000..eebbe07d --- /dev/null +++ b/test/pacman/tests/sync022.py @@ -0,0 +1,25 @@ +self.description = "Install a group from a sync db using --needed" + +lp1 = pmpkg("pkg1") +lp2 = pmpkg("pkg2") +lp3 = pmpkg("pkg3") + +sp1 = pmpkg("pkg1", "1.1-1") +sp2 = pmpkg("pkg2") +sp3 = pmpkg("pkg3") + +for p in lp1, lp2, lp3, sp1, sp2, sp3: + setattr(p, "groups", ["grp"]) + +for p in lp1, lp2, lp3: + self.addpkg2db("local", p) + +for p in sp1, sp2, sp3: + self.addpkg2db("sync", p); + +self.args = "-S --needed grp" + +self.addrule("PACMAN_RETCODE=0") +for p in sp1, sp2, sp3: + self.addrule("PKG_EXIST=%s" % p.name) +self.addrule("PKG_VERSION=pkg1|1.1-1") diff --git a/test/pacman/tests/sync023.py b/test/pacman/tests/sync023.py new file mode 100644 index 00000000..9253497c --- /dev/null +++ b/test/pacman/tests/sync023.py @@ -0,0 +1,31 @@ +self.description = "Install a group from a sync db using --needed (testing repo)" + +lp1 = pmpkg("pkg1", "1.1-1") +lp2 = pmpkg("pkg2") +lp3 = pmpkg("pkg3") + +sp1 = pmpkg("pkg1") +sp2 = pmpkg("pkg2") +sp3 = pmpkg("pkg3") +newp1 = pmpkg("pkg1", "1.1-1") + +for p in lp1, lp2, lp3, sp1, sp2, sp3, newp1: + setattr(p, "groups", ["grp"]) + +for p in lp1, lp2, lp3: + self.addpkg2db("local", p) + +self.addpkg2db("testing", newp1); + +for p in sp1, sp2, sp3: + self.addpkg2db("sync", p); + +self.args = "-S --needed grp" + +self.addrule("PACMAN_RETCODE=0") +for p in sp1, sp2, sp3: + self.addrule("PKG_EXIST=%s" % p.name) +# The newer version should still be installed +self.addrule("PKG_VERSION=pkg1|1.1-1") + +self.expectfailure = True -- cgit v1.2.3-24-g4f1b From f8d7cd6b2623a864aa85fbdcdd629f3ff92a631c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 25 Jul 2010 22:31:55 -0500 Subject: Maintain a list of seen packages when installing a group As reported in FS#20221, we don't always do the right thing when installing a group and using the --needed option. This was due to the code pulling packages based on what was already in the transaction's add list, but completely ignoring the fact that we may have already seen and skipped this same package in an earlier repository. Add a list to the private _alpm_sync_pkg() function that allows us to have this extra information so we don't mistakenly downgrade a package when using --needed. Signed-off-by: Dan McGee --- test/pacman/tests/sync023.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'test') diff --git a/test/pacman/tests/sync023.py b/test/pacman/tests/sync023.py index 9253497c..8233ab73 100644 --- a/test/pacman/tests/sync023.py +++ b/test/pacman/tests/sync023.py @@ -27,5 +27,3 @@ for p in sp1, sp2, sp3: self.addrule("PKG_EXIST=%s" % p.name) # The newer version should still be installed self.addrule("PKG_VERSION=pkg1|1.1-1") - -self.expectfailure = True -- cgit v1.2.3-24-g4f1b