Don't add config() provides if config install is disabled
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 1 Sep 2011 10:50:55 +0000 (13:50 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 1 Sep 2011 10:50:55 +0000 (13:50 +0300)
- Similarly to commit 40ee8e7427ace319687dd36bd5f745d1ef2f2236,
  take --noconfigs into account for the virtual config() provides too

lib/rpmal.c

index f209f01..bbf0abb 100644 (file)
@@ -196,6 +196,7 @@ static void rpmalAddProvides(rpmal al, rpmalNum pkgNum, rpmds provides)
 {
     struct availableIndexEntry_s indexEntry;
     rpm_color_t dscolor;
+    int skipconf = (al->tsflags & RPMTRANS_FLAG_NOCONFIGS);
 
     indexEntry.pkgNum = pkgNum;
 
@@ -206,6 +207,10 @@ static void rpmalAddProvides(rpmal al, rpmalNum pkgNum, rpmds provides)
         if (al->tscolor && dscolor && !(al->tscolor & dscolor))
             continue;
 
+       /* Ignore config() provides if the files wont be installed */
+       if (skipconf & (rpmdsFlags(provides) & RPMSENSE_CONFIG))
+           continue;
+
        indexEntry.entryIx = rpmdsIx(provides);
        rpmalProvidesHashAddEntry(al->providesHash, rpmdsN(provides), indexEntry);
     }