check capabilities flag
authorewt <devnull@localhost>
Wed, 7 Apr 1999 00:05:08 +0000 (00:05 +0000)
committerewt <devnull@localhost>
Wed, 7 Apr 1999 00:05:08 +0000 (00:05 +0000)
CVS patchset: 2957
CVS date: 1999/04/07 00:05:08

lib/depends.c

index 97c4816..397bb6a 100644 (file)
@@ -251,11 +251,19 @@ int rpmtransAddPackage(rpmTransactionSet rpmdep, Header h, FD_t fd,
     int count, i, j;
     char ** obsoletes;
     int alNum;
+    int * caps;
 
     /* XXX binary rpms always have RPMTAG_SOURCERPM, source rpms do not */
     if (headerIsEntry(h, RPMTAG_SOURCEPACKAGE))
        return 1;
 
+    /* Make sure we've implemented all of the capabilities we need */
+    if (headerGetEntry(h, RPMTAG_CAPABILITY, NULL, &caps, &count)) {
+       if (count != 1 || *caps) {
+           return 2;
+       }
+    }
+
     /* FIXME: handling upgrades like this is *almost* okay. It doesn't
        check to make sure we're upgrading to a newer version, and it
        makes it difficult to generate a return code based on the number of