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

Signed-off-by: Florian Pritz <[email protected]>
---
 doc/pacman.8.txt    |    1 +
 lib/libalpm/alpm.h  |    2 +-
 lib/libalpm/deps.c  |    2 +-
 src/pacman/pacman.c |    9 +++++++--
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/doc/pacman.8.txt b/doc/pacman.8.txt
index de1f51f..80bdd0f 100644
--- a/doc/pacman.8.txt
+++ b/doc/pacman.8.txt
@@ -126,6 +126,7 @@ Options
        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 two times to skip only the version checking.
 
 *-f, \--force*::
        Bypass file conflict checks and overwrite conflicting files. If the
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 0c01f21..a87e1f8 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -272,7 +272,7 @@ typedef enum _pmtransflag_t {
        PM_TRANS_FLAG_NODEPS = 1,
        PM_TRANS_FLAG_FORCE = (1 << 1),
        PM_TRANS_FLAG_NOSAVE = (1 << 2),
-       /* (1 << 3) flag can go here */
+       PM_TRANS_FLAG_NODEPVERSION = (1 << 3),
        PM_TRANS_FLAG_CASCADE = (1 << 4),
        PM_TRANS_FLAG_RECURSE = (1 << 5),
        PM_TRANS_FLAG_DBONLY = (1 << 6),
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index fd893a6..2124956 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -315,7 +315,7 @@ static int dep_vercmp(const char *version1, pmdepmod_t mod,
 {
        int equal = 0;
 
-       if(mod == PM_DEP_MOD_ANY) {
+       if(mod == PM_DEP_MOD_ANY || handle->trans->flags & 
PM_TRANS_FLAG_NODEPVERSION) {
                equal = 1;
        } else {
                int cmp = alpm_pkg_vercmp(version1, version2);
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 049bc40..612c4b3 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -524,8 +524,13 @@ static int parseargs(int argc, char *argv[])
                                config->op_q_changelog = 1;
                                break;
                        case 'd':
-                               config->op_q_deps = 1;
-                               config->flags |= PM_TRANS_FLAG_NODEPS;
+                               (config->op_q_deps)++;
+                               if(config->op_q_deps == 1) {
+                                       config->flags |= PM_TRANS_FLAG_NODEPS;
+                               } else {
+                                       config->flags ^= PM_TRANS_FLAG_NODEPS;
+                                       config->flags |= 
PM_TRANS_FLAG_NODEPVERSION;
+                               }
                                break;
                        case 'e':
                                config->op_q_explicit = 1;
-- 
1.7.3.1

Reply via email to