Patchwork [1/1] packageinfo.bbclass: A workaround for RPM architecture renaming

login
register
mail settings
Submitter Dongxiao Xu
Date April 18, 2012, 12:48 p.m.
Message ID <484d14f90205202e85346dfc53fcc4a273b3087c.1334751924.git.dongxiao.xu@intel.com>
Download mbox | patch
Permalink /patch/26129/
State Accepted
Commit 00bd4589b21fe3a716ff2732ea55651c4abd77e4
Headers show

Comments

Dongxiao Xu - April 18, 2012, 12:48 p.m.
For beagleboard platform, the PACKAGE_ARCH for certain recipes is
"armv7a-vfp-neon", however, the architecture label in RPM file name is
"arm" due to a potential bug in RPM backend.

This commit is a workaround to make Hob work in this case.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 meta/classes/packageinfo.bbclass |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
Koen Kooi - April 18, 2012, 1:11 p.m.
Op 18 apr. 2012, om 14:48 heeft Dongxiao Xu het volgende geschreven:

> For beagleboard platform, the PACKAGE_ARCH for certain recipes is
> "armv7a-vfp-neon", however, the architecture label in RPM file name is
> "arm" due to a potential bug in RPM backend.

'arm' or 'armv7a'? Your commit message doesn't match the comment in the code.

regards,

Koen
Richard Purdie - April 18, 2012, 1:26 p.m.
On Wed, 2012-04-18 at 15:11 +0200, Koen Kooi wrote:
> Op 18 apr. 2012, om 14:48 heeft Dongxiao Xu het volgende geschreven:
> 
> > For beagleboard platform, the PACKAGE_ARCH for certain recipes is
> > "armv7a-vfp-neon", however, the architecture label in RPM file name is
> > "arm" due to a potential bug in RPM backend.
> 
> 'arm' or 'armv7a'? Your commit message doesn't match the comment in the code.

Since Dongxiao is probably about to go to sleep, he means "armv7a". I'd
wondered that when I looked at the commit message too.

Cheers,

Richard
Dongxiao Xu - April 18, 2012, 2:53 p.m.
On Wed, 2012-04-18 at 14:26 +0100, Richard Purdie wrote:
> On Wed, 2012-04-18 at 15:11 +0200, Koen Kooi wrote:
> > Op 18 apr. 2012, om 14:48 heeft Dongxiao Xu het volgende geschreven:
> > 
> > > For beagleboard platform, the PACKAGE_ARCH for certain recipes is
> > > "armv7a-vfp-neon", however, the architecture label in RPM file name is
> > > "arm" due to a potential bug in RPM backend.
> > 
> > 'arm' or 'armv7a'? Your commit message doesn't match the comment in the code.
> 
> Since Dongxiao is probably about to go to sleep, he means "armv7a". I'd
> wondered that when I looked at the commit message too.

Sorry for the typo, it is "armv7a". I've fixed it in my branch.

Thanks,
Dongxiao

> 
> Cheers,
> 
> Richard
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/classes/packageinfo.bbclass b/meta/classes/packageinfo.bbclass
index 46b9097..26cce60 100644
--- a/meta/classes/packageinfo.bbclass
+++ b/meta/classes/packageinfo.bbclass
@@ -20,14 +20,25 @@  python packageinfo_handler () {
                         pkgrename = sdata['PKG_%s' % pkgname]
                         pkgv = sdata['PKGV'].replace('-', '+')
                         pkgr = sdata['PKGR']
+                        # We found there are some renaming issue with certain architecture.
+                        # For example, armv7a-vfp-neon, it will use armv7a in the rpm file. This is the workaround for it.
+                        arch_tmp = arch.split('-')[0]
                         if os.path.exists(deploy_dir + '/' + arch + '/' + \
                                           pkgname + '-' + pkgv + '-' + pkgr + '.' + arch + '.' + packaging) or \
                            os.path.exists(deploy_dir + '/' + arch + '/' + \
+                                          pkgname + '-' + pkgv + '-' + pkgr + '.' + arch_tmp + '.' + packaging) or \
+                           os.path.exists(deploy_dir + '/' + arch + '/' + \
                                           pkgrename + '-' + pkgv + '-' + pkgr + '.' + arch + '.' + packaging) or \
                            os.path.exists(deploy_dir + '/' + arch + '/' + \
+                                          pkgrename + '-' + pkgv + '-' + pkgr + '.' + arch_tmp + '.' + packaging) or \
+                           os.path.exists(deploy_dir + '/' + arch + '/' + \
                                           pkgname + '_' + pkgv + '-' + pkgr + '_' + arch + '.' + packaging) or \
                            os.path.exists(deploy_dir + '/' + arch + '/' + \
-                                          pkgrename + '_' + pkgv + '-' + pkgr + '_' + arch + '.' + packaging):
+                                          pkgname + '_' + pkgv + '-' + pkgr + '_' + arch_tmp + '.' + packaging) or \
+                           os.path.exists(deploy_dir + '/' + arch + '/' + \
+                                          pkgrename + '_' + pkgv + '-' + pkgr + '_' + arch + '.' + packaging) or \
+                           os.path.exists(deploy_dir + '/' + arch + '/' + \
+                                          pkgrename + '_' + pkgv + '-' + pkgr + '_' + arch_tmp + '.' + packaging):
                             pkginfolist.append(sdata)
         bb.event.fire(bb.event.PackageInfo(pkginfolist), e.data)
 }