]> code.ossystems Code Review - openembedded-core.git/commitdiff
rpm: Enable compatibility with older RPM packages that have invalid platforms
authorMark Hatle <mark.hatle@windriver.com>
Fri, 9 Aug 2013 22:51:30 +0000 (17:51 -0500)
committerPaul Eggleton <paul.eggleton@linux.intel.com>
Wed, 12 Mar 2014 19:00:34 +0000 (19:00 +0000)
Some LSB packages appear to have the platform set to '%{_target_platform}'
which is not a valid platform field.  This causes a failure of the type:

warning: package lsb-test-core-4.1.15-1.x86_64 is intended for a %{_target_platform} platform

When we detect an invalid platform, fall back and try to construct a new
platform name that may be valid based on the arch and os contents of the
package.  (This should only ever be needed by invalid or older RPM packages.)

(From OE-Core master rev: 6513fa327aeb7e9fdd313290c205917952eed226)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch [new file with mode: 0644]
meta/recipes-devtools/rpm/rpm_5.4.9.bb

diff --git a/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch b/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch
new file mode 100644 (file)
index 0000000..7101e5c
--- /dev/null
@@ -0,0 +1,24 @@
+Enable platform tag matching workaround in OE.
+
+When installing some LSB packages the 'platform' field in the package
+appears to be invalid.  Instead of relying solely on the platform comparison
+we also want to generate a perceived platform based on the valid rpm contents
+of arch and os.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.9/lib/depends.c
+===================================================================
+--- rpm-5.4.9.orig/lib/depends.c
++++ rpm-5.4.9/lib/depends.c
+@@ -594,7 +594,7 @@ int rpmtsAddInstallElement(rpmts ts, Hea
+           platform = rpmExpand(arch, "-unknown-", os, NULL);
+       rc = rpmPlatformScore(platform, platpat, nplatpat);
+-#if defined(RPM_VENDOR_MANDRIVA)
++#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_OE)
+       /*
+        * If no match on platform tag, we'll try again with arch tag
+        * in case platform tag is inconsistent with it, which is the case
index 1c6dcf62967aecb9415f1292c3f3d12b39cacc21..3d0a454b0c2873b72d4cbc0952972f38a9133f32 100644 (file)
@@ -86,7 +86,8 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.9-0.20120508.src.rpm;ex
           file://rpm-platform2.patch \
           file://rpm-remove-sykcparse-decl.patch \
           file://debugedit-segv.patch \
-     file://rpm-platform-file-fix.patch \
+          file://rpm-platform-file-fix.patch \
+          file://rpm-lsb-compatibility.patch \
          "
 
 # Uncomment the following line to enable platform score debugging