* [PATCH] classes/packageinfo: use better method to check if package exists
@ 2012-09-10 12:58 Paul Eggleton
2012-09-12 17:46 ` Saul Wold
0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2012-09-10 12:58 UTC (permalink / raw)
To: openembedded-core
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].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/classes/packageinfo.bbclass | 34 ++++++++--------------------------
1 file 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)
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] classes/packageinfo: use better method to check if package exists
2012-09-10 12:58 [PATCH] classes/packageinfo: use better method to check if package exists Paul Eggleton
@ 2012-09-12 17:46 ` Saul Wold
0 siblings, 0 replies; 2+ messages in thread
From: Saul Wold @ 2012-09-12 17:46 UTC (permalink / raw)
To: Paul Eggleton; +Cc: openembedded-core
On 09/10/2012 05:58 AM, Paul Eggleton wrote:
> 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].
>
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> ---
> meta/classes/packageinfo.bbclass | 34 ++++++++--------------------------
> 1 file changed, 8 insertions(+), 26 deletions(-)
>
Merged into OE-Core
Thanks
Sau!
> 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)
> }
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-12 17:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-10 12:58 [PATCH] classes/packageinfo: use better method to check if package exists Paul Eggleton
2012-09-12 17:46 ` Saul Wold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox