Patchwork [2/2] rpm: Ensure that we check both providename and filepaths

login
register
mail settings
Submitter Mark Hatle
Date April 12, 2012, 9:21 p.m.
Message ID <d03c20067d20533415b1af87a73e3ea2315aa21b.1334265557.git.mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/25705/
State Accepted
Commit 08fb526c42e85c89135960344745e878c5fb633a
Headers show

Comments

Steve Sakoman - April 12, 2012, 9:19 p.m.
On Thu, Apr 12, 2012 at 2:21 PM, Mark Hatle <mark.hatle@windriver.com> wrote:
> In lib/rpmts.c we need to make sure to look for missing dependencies,
> such as /bin/sh, in both the providename and filepaths DB.  Previously
> the system would key off an initial '/' and only look in the filepaths DB.
>
> This causes problems when a package such as "bash", has a Provides: /bin/sh.
>
> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>

Tested-by: Steve Sakoman <steve@sakoman.com>
Mark Hatle - April 12, 2012, 9:21 p.m.
In lib/rpmts.c we need to make sure to look for missing dependencies,
such as /bin/sh, in both the providename and filepaths DB.  Previously
the system would key off an initial '/' and only look in the filepaths DB.

This causes problems when a package such as "bash", has a Provides: /bin/sh.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch |   36 ++++++++++++++++++++
 meta/recipes-devtools/rpm/rpm_5.4.0.bb             |    3 +-
 2 files changed, 38 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch

Patch

diff --git a/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch b/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch
new file mode 100644
index 0000000..8c01a30
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch
@@ -0,0 +1,36 @@ 
+lib/rpmts.c: Ensure that we check both providename and filepaths
+
+When looking up a missing dependencies, such as /bin/sh, we need to lookup
+in both the providename and filepaths DB, not just the filepaths DB.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- rpm-5.4.0.orig/lib/rpmts.c	2010-12-27 16:08:25.000000000 -0600
++++ rpm-5.4.0/lib/rpmts.c	2012-04-12 15:01:12.990184067 -0500
+@@ -403,8 +403,8 @@
+ 	if (sdb == NULL)
+ 	    continue;
+ 
+-	/* Look for a matching Provides: in suggested universe. */
+-	rpmtag = (*keyp == '/' ? RPMTAG_FILEPATHS : RPMTAG_PROVIDENAME);
++	rpmtag = RPMTAG_PROVIDENAME;
++       do {
+ 	mi = rpmmiInit(sdb, rpmtag, keyp, keylen);
+ 	while ((h = rpmmiNext(mi)) != NULL) {
+ 	    size_t hnamelen;
+@@ -439,6 +439,15 @@
+ 	    bhnamelen = hnamelen;
+ 	}
+ 	mi = rpmmiFree(mi);
++
++	if (bh == NULL && *keyp == '/' && rpmtag == RPMTAG_PROVIDENAME) {
++	   rpmtag = RPMTAG_FILEPATHS;
++	   continue;
++        }
++
++        break;
++      } while (1);
++
+     }
+ 
+     /* Is there a suggested resolution? */
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.0.bb b/meta/recipes-devtools/rpm/rpm_5.4.0.bb
index 4576f67..a9c9628 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.0.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.0.bb
@@ -45,7 +45,7 @@  LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
 DEPENDS = "bzip2 zlib db openssl elfutils expat libpcre attr acl popt ${extrarpmdeps}"
 extrarpmdeps = "python perl file"
 extrarpmdeps_virtclass-native = "file-native"
-PR = "r35"
+PR = "r36"
 
 # rpm2cpio is a shell script, which is part of the rpm src.rpm.  It is needed
 # in order to extract the distribution SRPM into a format we can extract...
@@ -69,6 +69,7 @@  SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.0-0.20101229.src.rpm;ex
 	   file://fix_for_automake_1.11.2.patch \
 	   file://pythondeps.sh \
 	   file://rpmdeps-oecore.patch \
+	   file://rpm-resolvedep.patch \
 	  "
 
 #	   file://rpm-autoconf.patch \