2008/1/14, Nagy Gabor <ngaba@bibl.u-szeged.hu>:
From 49a346d598433b46e19f841432938f84df480c28 Mon Sep 17 00:00:00 2001 From: Nagy Gabor <ngaba@bibl.u-szeged.hu> Date: Fri, 11 Jan 2008 21:02:50 +0100 Subject: [PATCH] New sync1007.py pactest
This pactest checks what happens when more than one package can replace the same package.
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> --- pactest/tests/sync1007.py | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) create mode 100644 pactest/tests/sync1007.py
diff --git a/pactest/tests/sync1007.py b/pactest/tests/sync1007.py new file mode 100644 index 0000000..6f5d9f6 --- /dev/null +++ b/pactest/tests/sync1007.py @@ -0,0 +1,19 @@ +self.description = "Multiple packages replace the same package" + +sp1 = pmpkg("alternative1") +sp1.replaces = [ "pkg" ] +self.addpkg2db("sync", sp1) + +sp2 = pmpkg("alternative2") +sp2.replaces = [ "pkg" ] +self.addpkg2db("sync", sp2) + +lp = pmpkg("pkg", "1.0-1") +self.addpkg2db("local", lp) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("!PKG_EXIST=pkg1") +self.addrule("PKG_EXIST=alternative1") +self.addrule("!PKG_EXIST=alternative2")
Wow, I made a patch for this, and during testing I realized that sync134.py and sync135.py expect the opposite behavior.
So, what to do if more packages can replace one? 1. Assume that we have a SET of replacers (sync134.py) 2. Assume that we one replacer is enough (sync1007.py)
Imho 2. is more intuitive, when package foo replaces bar, I think that foo is "enough" as a replacer. But 1. is also reasonable...
I don't think there should be situations when more than one packages with replaces=('foobar') Replaces are used when a package changed its name (fglrx->catalyst) or when developers decided to go with a better alternative (cdrtools->cdrkit). If there are more than one replacing package then its a packaging error, and pacman shouldn't handle this, so #2 is ok. -- Roman Kyrylych (Роман Кирилич)