package_rpm.bbclass: Don't pass a 4th parameter to rpm target 32/41232/1
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 9 Apr 2015 16:10:07 +0000 (13:10 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 11 Jun 2015 21:22:46 +0000 (21:22 +0000)
rpm --target expects 3 parameters, split by a dash:
arch-vendor-os

However, glibc may add another parameter, corresponding to
the extension used. This is actually common on ARM archs.
However, rpm 4.1.4 is not prepared to handle it. When 4
parameters are found, it will use the last one as the OS,
causing the image build to fail.

Fix this by always discarding the 4th parameter, if present.

This patch is a co-work with Thiago Santos <thiagoss@osg.samsung.com>,
with actually come with the final solution.

Change-Id: I8ab3473ef4e6ff1501a1f82db0ab2bb8d7d9df50
Signed-off-by: Thiago Santos <thiagoss@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
meta/classes/package_rpm.bbclass

index 6483e96..e1e2c1c 100644 (file)
@@ -690,6 +690,9 @@ python do_package_rpm () {
         d.setVar('PACKAGE_ARCH_EXTEND', package_arch)
     pkgwritedir = d.expand('${PKGWRITEDIRRPM}/${PACKAGE_ARCH_EXTEND}')
     pkgarch = d.expand('${PACKAGE_ARCH_EXTEND}${HOST_VENDOR}-${HOST_OS}')
+    tokens = pkgarch.split('-')
+    if len(tokens) > 3:
+        pkgarch = '-'.join(tokens[:3])
     magicfile = d.expand('${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc')
     bb.utils.mkdirhier(pkgwritedir)
     os.chmod(pkgwritedir, 0755)