summaryrefslogtreecommitdiffstats
path: root/meta/classes/packageinfo.bbclass
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-09-10 13:58:10 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-10 21:52:43 +0100
commita4e36563d9441eb878a64d4728d30f7fce740384 (patch)
tree37e84160e87058272c1eea4e0a9c0bff16351c62 /meta/classes/packageinfo.bbclass
parentfb44773f61795a7f3f9aaefe5e84a5d275aac771 (diff)
downloadast2050-yocto-poky-a4e36563d9441eb878a64d4728d30f7fce740384.zip
ast2050-yocto-poky-a4e36563d9441eb878a64d4728d30f7fce740384.tar.gz
classes/packageinfo: use better method to check if package exists
Instead of using a rather error-prone method of looking for output package files in order to determine if a package got created, use the .packaged file within pkgdata. This fixes two separate issues: * Some packages apparently not being found by this code e.g. all apm/apmd packages when using ipk packaging. * Buggy implementation of this checking code which triggered an exception during the event handler if PKGV was overridden on a per-package basis (as it is with external-sourcery-toolchain), which blocked Hob from completing parsing at 99% - fixes [YOCTO #2651]. (From OE-Core rev: 48169c6bc44c546cecaa06207b6c36da558b81f7) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/packageinfo.bbclass')
-rw-r--r--meta/classes/packageinfo.bbclass34
1 files changed, 8 insertions, 26 deletions
diff --git a/meta/classes/packageinfo.bbclass b/meta/classes/packageinfo.bbclass
index 26cce60..bd7b249 100644
--- a/meta/classes/packageinfo.bbclass
+++ b/meta/classes/packageinfo.bbclass
@@ -14,32 +14,14 @@ python packageinfo_handler () {
for root, dirs, files in os.walk(pkgdata_dir):
for pkgname in files:
if pkgname.endswith('.packaged'):
- continue
- sdata = oe.packagedata.read_pkgdatafile(root + pkgname)
- sdata['PKG'] = pkgname
- 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 + '/' + \
- 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)
+ pkgname = pkgname[:-9]
+ pkgdatafile = root + pkgname
+ try:
+ sdata = oe.packagedata.read_pkgdatafile(pkgdatafile)
+ sdata['PKG'] = pkgname
+ pkginfolist.append(sdata)
+ except Exception as e:
+ bb.warn("Failed to read pkgdata file %s: %s: %s" % (pkgdatafile, e.__class__, str(e)))
bb.event.fire(bb.event.PackageInfo(pkginfolist), e.data)
}
OpenPOWER on IntegriCloud