Use RPMDBI_INSTFILENAMES on file queries as well
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 29 Aug 2011 13:19:32 +0000 (16:19 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 29 Aug 2011 13:19:32 +0000 (16:19 +0300)
- This changes query behavior quite a bit as files with non-installed
  status are no longer returned as matches. The rationale is that
  it makes figuring out dependency issues with the "new" behavior
  more obvious (but perhaps we should have a switch to enable
  former behavior). Besides not satisfying dependencies, files with
  non-installed status are not really owned by the package, as they
  would not be removed on package removal.

lib/query.c

index 73d64e3..1e42954 100644 (file)
@@ -409,7 +409,8 @@ static rpmdbMatchIterator initQueryIterator(QVA_t qva, rpmts ts, const char * ar
            fn = xstrdup(arg);
        (void) rpmCleanPath(fn);
 
-       mi = rpmtsInitIterator(ts, RPMDBI_BASENAMES, fn, 0);
+       /* XXX Add a switch to enable former BASENAMES behavior? */
+       mi = rpmtsInitIterator(ts, RPMDBI_INSTFILENAMES, fn, 0);
        if (mi == NULL)
            mi = rpmtsInitIterator(ts, RPMDBI_PROVIDENAME, fn, 0);