[pacman-dev] [PATCH 3/3] add -dd option

Xavier Chantry chantry.xavier at gmail.com
Thu Oct 14 08:22:19 EDT 2010


From: Florian Pritz <bluewind at xssn.at>

-dd ignores only the version of a dependency being checked, but not the
package itself.

Signed-off-by: Florian Pritz <bluewind at xssn.at>
Signed-off-by: Xavier Chantry <chantry.xavier at gmail.com>
---
 doc/pacman.8.txt               |    1 +
 src/pacman/pacman.c            |   11 ++++++++++-
 test/pacman/tests/sync-sdd1.py |    2 --
 test/pacman/tests/sync-sdd4.py |    2 --
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/doc/pacman.8.txt b/doc/pacman.8.txt
index 2b47a88..735bff9 100644
--- a/doc/pacman.8.txt
+++ b/doc/pacman.8.txt
@@ -155,6 +155,7 @@ Transaction Options (apply to '-S', '-R' and '-U')
 	Skips all dependency checks. Normally, pacman will always check a
 	package's dependency fields to ensure that all dependencies are
 	installed and there are no package conflicts in the system.
+	Specify this option twice to skip the version checking only.
 
 *-k, \--dbonly*::
 	Adds/Removes the database entry only, leaves all files in place.
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 7d51124..d83ec07 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -512,8 +512,17 @@ static int parsearg_query(int opt)
 /* options common to -S -R -U */
 static int parsearg_trans(int opt)
 {
+	static int nodeps = 0;
 	switch(opt) {
-		case 'd': config->flags |= PM_TRANS_FLAG_NODEPS; break;
+		case 'd':
+			nodeps++;
+			if(nodeps == 1) {
+				config->flags |= PM_TRANS_FLAG_NODEPS;
+			} else if(nodeps == 2) {
+				config->flags ^= PM_TRANS_FLAG_NODEPS;
+				config->flags |= PM_TRANS_FLAG_NODEPVERSION;
+			}
+			break;
 		case 'k': config->flags |= PM_TRANS_FLAG_DBONLY; break;
 		case OP_NOPROGRESSBAR: config->noprogressbar = 1; break;
 		case OP_NOSCRIPTLET: config->flags |= PM_TRANS_FLAG_NOSCRIPTLET; break;
diff --git a/test/pacman/tests/sync-sdd1.py b/test/pacman/tests/sync-sdd1.py
index 4438ef0..c73d203 100644
--- a/test/pacman/tests/sync-sdd1.py
+++ b/test/pacman/tests/sync-sdd1.py
@@ -14,5 +14,3 @@
 self.addrule("PKG_EXIST=pkg1")
 self.addrule("PKG_EXIST=pkg2")
 self.addrule("PKG_DEPENDS=pkg1|provision>1.0-1")
-
-self.expectfailure = True
diff --git a/test/pacman/tests/sync-sdd4.py b/test/pacman/tests/sync-sdd4.py
index 4cd4b54..c96c6df 100644
--- a/test/pacman/tests/sync-sdd4.py
+++ b/test/pacman/tests/sync-sdd4.py
@@ -13,5 +13,3 @@
 self.addrule("PACMAN_RETCODE=1")
 self.addrule("!PKG_EXIST=pkg1")
 self.addrule("!PKG_EXIST=pkg2")
-
-self.expectfailure = True
-- 
1.7.3.1



More information about the pacman-dev mailing list