>From 66cb7b5d48ae173944531318022d351f4e503172 Mon Sep 17 00:00:00 2001
From: Nagy Gabor
Date: Mon, 31 Aug 2009 23:54:51 +0200
Subject: [PATCH] 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.
Original-work-by: Allan McRae
Signed-off-by: Nagy Gabor
---
pactest/tests/sync042.py |6 +++---
pactest/tests/sync043.py |2 +-
pactest/tests/sync044.py |2 +-
pactest/tests/sync1004.py |2 +-
pactest/tests/sync890.py |2 +-
pactest/tests/sync892.py |2 +-
pactest/tests/sync893.py |2 +-
pactest/tests/sync895.py |2 +-
pactest/tests/sync896.py |2 +-
pactest/tests/sync897.py |2 +-
pactest/tests/sync899.py |2 +-
pactest/tests/sync900.py |2 +-
pactest/tests/sync901.py |2 +-
pactest/tests/sync992.py |2 +-
pactest/tests/sync999.py |2 +-
src/pacman/callback.c |4 ++--
16 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/pactest/tests/sync042.py b/pactest/tests/sync042.py
index 0aa7e37..7c3498d 100644
--- a/pactest/tests/sync042.py
+++ b/pactest/tests/sync042.py
@@ -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")
diff --git a/pactest/tests/sync043.py b/pactest/tests/sync043.py
index 1302bf0..eb2f570 100644
--- a/pactest/tests/sync043.py
+++ b/pactest/tests/sync043.py
@@ -10,7 +10,7 @@ self.addpkg2db("local", lp1);
lp1 = pmpkg("pkg3")
self.addpkg2db("local", lp1);
-self.args = "-S %s" % sp.name
+self.args = "-S %s --ask=4" % sp.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=pkg1")
diff --git a/pactest/tests/sync044.py b/pactest/tests/sync044.py
index c4ff154..0c8fd2e 100644
--- a/pactest/tests/sync044.py
+++ b/pactest/tests/sync044.py
@@ -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")
diff --git a/pactest/tests/sync1004.py b/pactest/tests/sync1004.py
index f87bbe9..a9cee49 100644
--- a/pactest/tests/sync1004.py
+++ b/pactest/tests/sync1004.py
@@ -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")
diff --git a/pactest/tests/sync890.py b/pactest/tests/sync890.py
index 75947e9..e8380b7 100644
--- a/pactest/tests/sync890.py
+++ b/pactest/tests/sync890.py
@@ -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")
diff --git a/pactest/tests/sync892.py b/pactest/tests/sync892.py
index 04cc79c..dfd889e 100644
--- a/pactest/tests/sync892.py
+++ b/pactest/tests/sync892.py
@@ -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")
diff --git a/pactest/tests/sync893.py b/pactest/tests/sync893.py
index 1c8494a..e96bb7b 100644
--- a/pactest/tests/sync893.py
+++ b/pactest/tests/sync893.py
@@ -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")
diff --git a/pactest/tests/sync895.py b/pactest/tests/sync895.py
index 1b348c1..fd98786 100644
--- a/pactest/tests/sync895.py
+++ b/pactest/tests/sync895.py
@@ -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")
diff --git a/pactest/tests/sync896.py b/pactest/tests/sync896.py
index a89b5c7..492bd7b 100644
--- a/pactest/tests/sync896.py
+++ b/pactest/tests/sync896.py
@@ -13,7 +13,7 @@ lp2 = pmpkg("pkg2")
lp2.depends = ["foo"]
self.addpkg2db("local", lp2)
-self.args = "-S %s" % sp.name
+self.args = "-S %s --as