Take advantage on RPMDBI_INSTFILENAMES in rpmdbProvides()
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 29 Aug 2011 12:49:08 +0000 (15:49 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 29 Aug 2011 12:56:18 +0000 (15:56 +0300)
- No functional changes, we did the same thing "manually" here already.
  Only now the data is more conveniently available through API to
  other callers who might care (yum & friends)

lib/depends.c

index 2b84bd3..d025f4e 100644 (file)
@@ -351,19 +351,10 @@ static int rpmdbProvides(rpmts ts, depCache dcache, rpmds dep)
      * not installed files can not satisfy a dependency.
      */
     if (Name[0] == '/') {
-       mi = rpmtsPrunedIterator(ts, RPMDBI_BASENAMES, Name);
+       mi = rpmtsPrunedIterator(ts, RPMDBI_INSTFILENAMES, Name);
        while ((h = rpmdbNextIterator(mi)) != NULL) {
-           int fs = RPMFILE_STATE_MISSING;
-           struct rpmtd_s states;
-           if (headerGet(h, RPMTAG_FILESTATES, &states, HEADERGET_MINMEM)) {
-               rpmtdSetIndex(&states, rpmdbGetIteratorFileNum(mi));
-               fs = rpmtdGetNumber(&states);
-               rpmtdFreeData(&states);
-           }
-           if (fs == RPMFILE_STATE_NORMAL || fs == RPMFILE_STATE_NETSHARED) {
-               rpmdsNotify(dep, "(db files)", rc);
-               break;
-           }
+           rpmdsNotify(dep, "(db files)", rc);
+           break;
        }
        rpmdbFreeIterator(mi);
     }