summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-10-01 16:42:09 +0200
committerDan McGee <dan@archlinux.org>2011-01-31 17:49:53 +0100
commit111e07d0be44b76b910c6a004421ede4f6f6fb49 (patch)
tree65096efc6a527c7a8d84d3a1f3afdb8263cb7258
parentb6ec9019d77c41edd86094a867fbb3970c6b4ebe (diff)
downloadpacman-111e07d0be44b76b910c6a004421ede4f6f6fb49.tar.gz
pacman-111e07d0be44b76b910c6a004421ede4f6f6fb49.tar.xz
make -d less strict; add -dd option
-d skips checking the version of a dependency. -dd skips the whole dependency check. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Florian Pritz <bluewind@server-speed.net> Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--doc/pacman.8.txt7
-rw-r--r--src/pacman/pacman.c8
-rw-r--r--test/pacman/tests/sync-nodepversion01.py6
-rw-r--r--test/pacman/tests/sync-nodepversion03.py4
-rw-r--r--test/pacman/tests/sync-nodepversion04.py4
-rw-r--r--test/pacman/tests/sync-nodepversion05.py4
-rw-r--r--test/pacman/tests/sync045.py4
-rw-r--r--test/pacman/tests/upgrade072.py2
8 files changed, 21 insertions, 18 deletions
diff --git a/doc/pacman.8.txt b/doc/pacman.8.txt
index 8f91e408..8a94ebc6 100644
--- a/doc/pacman.8.txt
+++ b/doc/pacman.8.txt
@@ -154,9 +154,10 @@ Options
Transaction Options (apply to '-S', '-R' and '-U')
--------------------------------------------------
*-d, \--nodeps*::
- 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.
+ Skips dependency version checks. Package names are still checked. 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 all dependency checks.
*-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 21d02107..984bd1b7 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -552,7 +552,13 @@ static int parsearg_query(int opt)
static int parsearg_trans(int opt)
{
switch(opt) {
- case 'd': config->flags |= PM_TRANS_FLAG_NODEPS; break;
+ case 'd':
+ if(config->flags & PM_TRANS_FLAG_NODEPVERSION) {
+ config->flags |= PM_TRANS_FLAG_NODEPS;
+ } else {
+ 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-nodepversion01.py b/test/pacman/tests/sync-nodepversion01.py
index 3db445fa..5829b9ee 100644
--- a/test/pacman/tests/sync-nodepversion01.py
+++ b/test/pacman/tests/sync-nodepversion01.py
@@ -1,4 +1,4 @@
-self.description = "nodepversion: -Sdd works"
+self.description = "nodepversion: -Sd works"
p1 = pmpkg("pkg1", "1.0-2")
p1.depends = ["provision>1.0-1"]
@@ -8,11 +8,9 @@ p2 = pmpkg("pkg2", "1.0-2")
p2.provides = ["provision=1.0-1"]
self.addpkg2db("sync", p2)
-self.args = "-Sdd %s" % p1.name
+self.args = "-Sd %s" % p1.name
self.addrule("PACMAN_RETCODE=0")
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-nodepversion03.py b/test/pacman/tests/sync-nodepversion03.py
index 8ebb1c89..378ff76a 100644
--- a/test/pacman/tests/sync-nodepversion03.py
+++ b/test/pacman/tests/sync-nodepversion03.py
@@ -1,4 +1,4 @@
-self.description = "nodepversion: -Sd works but no deps"
+self.description = "nodepversion: -Sdd works but no deps"
p1 = pmpkg("pkg1", "1.0-2")
p1.depends = ["provision>=1.0-2"]
@@ -8,7 +8,7 @@ p2 = pmpkg("pkg2", "1.0-2")
p2.provides = ["provision=1.0-1"]
self.addpkg2db("sync", p2)
-self.args = "-Sd %s" % p1.name
+self.args = "-Sdd %s" % p1.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=pkg1")
diff --git a/test/pacman/tests/sync-nodepversion04.py b/test/pacman/tests/sync-nodepversion04.py
index f5a091e4..2bf83bb2 100644
--- a/test/pacman/tests/sync-nodepversion04.py
+++ b/test/pacman/tests/sync-nodepversion04.py
@@ -8,10 +8,8 @@ p2 = pmpkg("pkg2", "1.0-2")
p2.provides = ["provision=1.0-1"]
self.addpkg2db("sync", p2)
-self.args = "-Sdd %s" % p1.name
+self.args = "-Sd %s" % p1.name
self.addrule("PACMAN_RETCODE=1")
self.addrule("!PKG_EXIST=pkg1")
self.addrule("!PKG_EXIST=pkg2")
-
-self.expectfailure = True
diff --git a/test/pacman/tests/sync-nodepversion05.py b/test/pacman/tests/sync-nodepversion05.py
index f2a45f0b..bc048db6 100644
--- a/test/pacman/tests/sync-nodepversion05.py
+++ b/test/pacman/tests/sync-nodepversion05.py
@@ -1,4 +1,4 @@
-self.description = "nodepversion: -Sudd works"
+self.description = "nodepversion: -Sud works"
p1 = pmpkg("pkg1", "1.0-1")
p1.depends = ["provision=1.0"]
@@ -12,7 +12,7 @@ sp2 = pmpkg("pkg2", "1.1-1")
sp2.provides = ["provision=1.1"]
self.addpkg2db("sync", sp2)
-self.args = "-Sudd"
+self.args = "-Sud"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=pkg1|1.0-1")
diff --git a/test/pacman/tests/sync045.py b/test/pacman/tests/sync045.py
index 574c0a52..6c31983c 100644
--- a/test/pacman/tests/sync045.py
+++ b/test/pacman/tests/sync045.py
@@ -1,4 +1,4 @@
-self.description = "Install a sync package conflicting with two local ones (-d)"
+self.description = "Install a sync package conflicting with two local ones (-dd)"
sp = pmpkg("pkg1")
sp.conflicts = ["pkg2", "pkg3"]
@@ -10,7 +10,7 @@ self.addpkg2db("local", lp1);
lp2 = pmpkg("pkg3")
self.addpkg2db("local", lp2);
-self.args = "-Sd %s --ask=4" % sp.name
+self.args = "-Sdd %s --ask=4" % sp.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=pkg1")
diff --git a/test/pacman/tests/upgrade072.py b/test/pacman/tests/upgrade072.py
index f88e150c..116103b6 100644
--- a/test/pacman/tests/upgrade072.py
+++ b/test/pacman/tests/upgrade072.py
@@ -6,7 +6,7 @@ p.files = ["bin/dummy",
p.depends = ["dep1"]
self.addpkg(p)
-self.args = "-Ud %s" % p.filename()
+self.args = "-Udd %s" % p.filename()
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=dummy")