mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
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:
parent
90e3e026d1
commit
b7db46d610
@ -9,6 +9,6 @@ self.addpkg2db("local", lp);
|
||||
|
||||
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")
|
||||
|
@ -7,10 +7,10 @@ self.addpkg2db("sync", sp);
|
||||
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")
|
||||
|
@ -11,7 +11,7 @@ sp3 = pmpkg("pkg3")
|
||||
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")
|
||||
|
@ -11,7 +11,7 @@ self.addpkg2db("sync", sp2)
|
||||
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")
|
||||
|
@ -12,7 +12,7 @@ lp2.conflicts = ["pkg3"]
|
||||
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")
|
||||
|
@ -16,7 +16,7 @@ lp2.conflicts = ["pkg3"]
|
||||
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")
|
||||
|
@ -13,7 +13,7 @@ self.addpkg2db("local", lp1)
|
||||
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")
|
||||
|
@ -12,7 +12,7 @@ lp2 = pmpkg("pkg2")
|
||||
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")
|
||||
|
@ -13,7 +13,7 @@ lp2 = pmpkg("pkg2")
|
||||
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")
|
||||
|
@ -16,7 +16,7 @@ self.addpkg2db("local", lp2)
|
||||
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")
|
||||
|
@ -11,7 +11,7 @@ self.addpkg2db("local", lp1)
|
||||
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")
|
||||
|
@ -16,7 +16,7 @@ lp2 = pmpkg("pkg2")
|
||||
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")
|
||||
|
@ -16,7 +16,7 @@ lp2 = pmpkg("pkg2")
|
||||
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")
|
||||
|
@ -15,7 +15,7 @@ for p in sp1, sp2, sp3:
|
||||
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")
|
||||
|
@ -14,7 +14,7 @@ self.addpkg2db("local", lp1)
|
||||
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")
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user