Honor RPMSENSE_MISSINGOK flag in dependency checking
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 3 Aug 2012 08:59:12 +0000 (11:59 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 3 Aug 2012 09:43:59 +0000 (12:43 +0300)
- For now there's no way to set this flag from packages so it doesn't
  actually do anything, but it doesn't hurt anything either, allows
  Suse & friends to drop one patch (greetings Michael :) and there
  are might be some things we could use this for internally.

lib/depends.c
lib/rpmds.h

index 7e3c437..ed8a2c5 100644 (file)
@@ -534,8 +534,14 @@ retry:
     }
 
 unsatisfied:
-    rc = 1;    /* dependency is unsatisfied */
-    rpmdsNotify(dep, NULL, rc);
+    if (dsflags & RPMSENSE_MISSINGOK) {
+       /* note the result, but missingok deps are never unsatisfied */
+       rpmdsNotify(dep, "(missingok)", 1);
+    } else {
+       /* dependency is unsatisfied */
+       rc = 1;
+       rpmdsNotify(dep, NULL, rc);
+    }
 
 exit:
     return rc;
index 84f4fbb..d096b67 100644 (file)
@@ -72,7 +72,8 @@ typedef rpmFlags rpmsenseFlags;
     RPMSENSE_KEYRING | \
     RPMSENSE_PRETRANS | \
     RPMSENSE_POSTTRANS | \
-    RPMSENSE_PREREQ)
+    RPMSENSE_PREREQ | \
+    RPMSENSE_MISSINGOK)
 
 #define        _notpre(_x)             ((_x) & ~RPMSENSE_PREREQ)
 #define        _INSTALL_ONLY_MASK \