summaryrefslogtreecommitdiffstats
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
parentfb44773f61795a7f3f9aaefe5e84a5d275aac771 (diff)
downloadpoky-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>
-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 26cce604ae..bd7b249bb4 100644
--- a/meta/classes/packageinfo.bbclass
+++ b/meta/classes/packageinfo.bbclass
@@ -14,32 +14,14 @@ python packageinfo_handler () {
14 for root, dirs, files in os.walk(pkgdata_dir): 14 for root, dirs, files in os.walk(pkgdata_dir):
15 for pkgname in files: 15 for pkgname in files:
16 if pkgname.endswith('.packaged'): 16 if pkgname.endswith('.packaged'):
17 continue 17 pkgname = pkgname[:-9]
18 sdata = oe.packagedata.read_pkgdatafile(root + pkgname) 18 pkgdatafile = root + pkgname
19 sdata['PKG'] = pkgname 19 try:
20 pkgrename = sdata['PKG_%s' % pkgname] 20 sdata = oe.packagedata.read_pkgdatafile(pkgdatafile)
21 pkgv = sdata['PKGV'].replace('-', '+') 21 sdata['PKG'] = pkgname
22 pkgr = sdata['PKGR'] 22 pkginfolist.append(sdata)
23 # We found there are some renaming issue with certain architecture. 23 except Exception as e:
24 # For example, armv7a-vfp-neon, it will use armv7a in the rpm file. This is the workaround for it. 24 bb.warn("Failed to read pkgdata file %s: %s: %s" % (pkgdatafile, e.__class__, str(e)))
25 arch_tmp = arch.split('-')[0]
26 if os.path.exists(deploy_dir + '/' + arch + '/' + \
27 pkgname + '-' + pkgv + '-' + pkgr + '.' + arch + '.' + packaging) or \
28 os.path.exists(deploy_dir + '/' + arch + '/' + \
29 pkgname + '-' + pkgv + '-' + pkgr + '.' + arch_tmp + '.' + packaging) or \
30 os.path.exists(deploy_dir + '/' + arch + '/' + \
31 pkgrename + '-' + pkgv + '-' + pkgr + '.' + arch + '.' + packaging) or \
32 os.path.exists(deploy_dir + '/' + arch + '/' + \
33 pkgrename + '-' + pkgv + '-' + pkgr + '.' + arch_tmp + '.' + packaging) or \
34 os.path.exists(deploy_dir + '/' + arch + '/' + \
35 pkgname + '_' + pkgv + '-' + pkgr + '_' + arch + '.' + packaging) or \
36 os.path.exists(deploy_dir + '/' + arch + '/' + \
37 pkgname + '_' + pkgv + '-' + pkgr + '_' + arch_tmp + '.' + packaging) or \
38 os.path.exists(deploy_dir + '/' + arch + '/' + \
39 pkgrename + '_' + pkgv + '-' + pkgr + '_' + arch + '.' + packaging) or \
40 os.path.exists(deploy_dir + '/' + arch + '/' + \
41 pkgrename + '_' + pkgv + '-' + pkgr + '_' + arch_tmp + '.' + packaging):
42 pkginfolist.append(sdata)
43 bb.event.fire(bb.event.PackageInfo(pkginfolist), e.data) 25 bb.event.fire(bb.event.PackageInfo(pkginfolist), e.data)
44} 26}
45 27