blob: 526106d1e3c18b62e45158e3bea095a20c0f7ace [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001lib/rpmts.c: Ensure that we check both providename and filepaths
2
3When looking up a missing dependencies, such as /bin/sh, we need to lookup
4in both the providename and filepaths DB, not just the filepaths DB.
5
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05006Upstream-Status: Submitted [RPM5 maintainer]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05007
8Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
9
10Index: rpm-5.4.14/lib/rpmts.c
11===================================================================
12--- rpm-5.4.14.orig/lib/rpmts.c
13+++ rpm-5.4.14/lib/rpmts.c
14@@ -410,8 +410,8 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __
15 if (sdb == NULL)
16 continue;
17
18- /* Look for a matching Provides: in suggested universe. */
19- rpmtag = (*keyp == '/' ? RPMTAG_FILEPATHS : RPMTAG_PROVIDENAME);
20+ rpmtag = RPMTAG_PROVIDENAME;
21+ do {
22 mi = rpmmiInit(sdb, rpmtag, keyp, keylen);
23 while ((h = rpmmiNext(mi)) != NULL) {
24 size_t hnamelen;
25@@ -446,6 +446,15 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __
26 bhnamelen = hnamelen;
27 }
28 mi = rpmmiFree(mi);
29+
30+ if (bh == NULL && *keyp == '/' && rpmtag == RPMTAG_PROVIDENAME) {
31+ rpmtag = RPMTAG_FILEPATHS;
32+ continue;
33+ }
34+
35+ break;
36+ } while (1);
37+
38 }
39
40 /* Is there a suggested resolution? */