Do not remove conflict by default

When a conflict is detected, pacman asks if the user wants to remove
the conflicting package.  In many cases this is a bad idea.  e.g.

udev conflicts with initscripts (initscripts<2009.07).
Remove initscripts [Y/n]

This changes the query to [y/N].

The --noconfirm behavior has been also changed, because it chooses the
default answer. Since the yes answer is more interesting in our pactests
dealing with conflicts, I inserted '--ask=4' to all of them with one
exception: sync042.py tests the no answer.

(I also fixed a typo in sync043.py)

Original-work-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
This commit is contained in:
Nagy Gabor 2009-08-31 23:54:51 +02:00 committed by Dan McGee
parent 90e3e026d1
commit b7db46d610
16 changed files with 21 additions and 21 deletions

View File

@ -9,6 +9,6 @@
self.args = "-S %s" % sp.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=pkg1")
self.addrule("!PKG_EXIST=pkg2")
self.addrule("PACMAN_RETCODE=1")
self.addrule("!PKG_EXIST=pkg1")
self.addrule("PKG_EXIST=pkg2")

View File

@ -7,10 +7,10 @@
lp1 = pmpkg("pkg2")
self.addpkg2db("local", lp1);
lp1 = pmpkg("pkg3")
self.addpkg2db("local", lp1);
lp2 = pmpkg("pkg3")
self.addpkg2db("local", lp2);
self.args = "-S %s" % sp.name
self.args = "-S %s --ask=4" % sp.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=pkg1")

View File

@ -11,7 +11,7 @@
sp3.conflicts = ["pkg1"]
self.addpkg2db("sync", sp3);
self.args = "-S pkg2"
self.args = "-S pkg2 --ask=4"
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PKG_EXIST=pkg1")

View File

@ -11,7 +11,7 @@
lp = pmpkg("depend")
self.addpkg2db("local", lp)
self.args = "-S pkg1 pkg2"
self.args = "-S pkg1 pkg2 --ask=4"
self.addrule("PACMAN_RETCODE=1")
self.addrule("PKG_EXIST=depend")

View File

@ -12,7 +12,7 @@
for p in lp1, lp2:
self.addpkg2db("local", p)
self.args = "-S %s" % sp.name
self.args = "-S %s --ask=4" % sp.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=pkg1")

View File

@ -16,7 +16,7 @@
for p in lp1, lp2:
self.addpkg2db("local", p)
self.args = "-S %s" % " ".join([p.name for p in sp1, sp2])
self.args = "-S %s --ask=4" % " ".join([p.name for p in sp1, sp2])
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PKG_EXIST=pkg1")

View File

@ -13,7 +13,7 @@
lp2 = pmpkg("pkg2")
self.addpkg2db("local", lp2)
self.args = "-S %s" % " ".join([p.name for p in sp1, sp2])
self.args = "-S %s --ask=4" % " ".join([p.name for p in sp1, sp2])
self.addrule("PACMAN_RETCODE=1")
self.addrule("PKG_EXIST=pkg1")

View File

@ -12,7 +12,7 @@
lp2.depends = ["foo"]
self.addpkg2db("local", lp2)
self.args = "-S %s" % sp.name
self.args = "-S %s --ask=4" % sp.name
self.addrule("PACMAN_RETCODE=1")
self.addrule("PKG_EXIST=pkg1")

View File

@ -13,7 +13,7 @@
lp2.depends = ["foo"]
self.addpkg2db("local", lp2)
self.args = "-S %s" % sp.name
self.args = "-S %s --ask=4" % sp.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PKG_EXIST=pkg1")

View File

@ -16,7 +16,7 @@
lp3 = pmpkg("pkg3")
self.addpkg2db("local", lp3)
self.args = "-Su"
self.args = "-Su --ask=4"
self.addrule("PACMAN_RETCODE=1")
self.addrule("PKG_EXIST=pkg1")

View File

@ -11,7 +11,7 @@
lp2 = pmpkg("pkg2")
self.addpkg2db("local", lp2)
self.args = "-Su"
self.args = "-Su --ask=4"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=pkg1")

View File

@ -16,7 +16,7 @@
lp2.depends = ["foo"]
self.addpkg2db("local", lp2)
self.args = "-S %s" % sp.name
self.args = "-S %s --ask=4" % sp.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PKG_EXIST=foo")

View File

@ -16,7 +16,7 @@
lp2.depends = ["foo"]
self.addpkg2db("local", lp2)
self.args = "-S %s" % sp.name
self.args = "-S %s --ask=4" % sp.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=foo")

View File

@ -15,7 +15,7 @@
lp1 = pmpkg("pkg2", "0.1-1")
self.addpkg2db("local", lp1)
self.args = "-S %s" % " ".join([p.name for p in sp1, sp2])
self.args = "-S %s --ask=4" % " ".join([p.name for p in sp1, sp2])
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=pkg1")

View File

@ -14,7 +14,7 @@
lp2 = pmpkg("pkg2")
self.addpkg2db("local", lp2)
self.args = "-Su"
self.args = "-Su --ask=4"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=pkg1")

View File

@ -262,12 +262,12 @@ void cb_trans_conv(pmtransconv_t event, void *data1, void *data2,
/* data parameters: target package, local package, conflict (strings) */
/* print conflict only if it contains new information */
if(!strcmp(data1, data3) || !strcmp(data2, data3)) {
*response = yesno(_(":: %s and %s are in conflict. Remove %s?"),
*response = noyes(_(":: %s and %s are in conflict. Remove %s?"),
(char *)data1,
(char *)data2,
(char *)data2);
} else {
*response = yesno(_(":: %s and %s are in conflict (%s). Remove %s?"),
*response = noyes(_(":: %s and %s are in conflict (%s). Remove %s?"),
(char *)data1,
(char *)data2,
(char *)data3,