From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] hob: use correct semantics for dealing with pkgdata
Date: Mon, 10 Sep 2012 15:35:05 +0100 [thread overview]
Message-ID: <1347287705-25453-1-git-send-email-paul.eggleton@linux.intel.com> (raw)
Some of these values may or may not be overridden on a per-package
basis, so handle them accordingly.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
bitbake/lib/bb/ui/crumbs/hoblistmodel.py | 35 +++++++++++++++++-------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
index 10b7c55..66b0efa 100644
--- a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
+++ b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
@@ -145,6 +145,12 @@ class PackageListModel(gtk.TreeStore):
self.pkg_path = {}
self.rprov_pkg = {}
+ def getpkgvalue(pkgdict, key, pkgname, defaultval = None):
+ value = pkgdict.get('%s_%s' % (key, pkgname), None)
+ if not value:
+ value = pkgdict.get(key, defaultval)
+ return value
+
for pkginfo in pkginfolist:
pn = pkginfo['PN']
pv = pkginfo['PV']
@@ -157,25 +163,24 @@ class PackageListModel(gtk.TreeStore):
self.COL_INC, False)
self.pn_path[pn] = self.get_path(pniter)
+ # PKG is always present
pkg = pkginfo['PKG']
- pkgv = pkginfo['PKGV']
- pkgr = pkginfo['PKGR']
- pkgsize = pkginfo['PKGSIZE_%s' % pkg] if 'PKGSIZE_%s' % pkg in pkginfo.keys() else "0"
- pkg_rename = pkginfo['PKG_%s' % pkg] if 'PKG_%s' % pkg in pkginfo.keys() else ""
- section = pkginfo['SECTION_%s' % pkg] if 'SECTION_%s' % pkg in pkginfo.keys() else ""
- summary = pkginfo['SUMMARY_%s' % pkg] if 'SUMMARY_%s' % pkg in pkginfo.keys() else ""
- rdep = pkginfo['RDEPENDS_%s' % pkg] if 'RDEPENDS_%s' % pkg in pkginfo.keys() else ""
- rrec = pkginfo['RRECOMMENDS_%s' % pkg] if 'RRECOMMENDS_%s' % pkg in pkginfo.keys() else ""
- rprov = pkginfo['RPROVIDES_%s' % pkg] if 'RPROVIDES_%s' % pkg in pkginfo.keys() else ""
+ pkgv = getpkgvalue(pkginfo, 'PKGV', pkg)
+ pkgr = getpkgvalue(pkginfo, 'PKGR', pkg)
+ # PKGSIZE is artificial, will always be overridden with the package name if present
+ pkgsize = pkginfo.get('PKGSIZE_%s' % pkg, "0")
+ # PKG_%s is the renamed version
+ pkg_rename = pkginfo.get('PKG_%s' % pkg, "")
+ # The rest may be overridden or not
+ section = getpkgvalue(pkginfo, 'SECTION', pkg, "")
+ summary = getpkgvalue(pkginfo, 'SUMMARY', pkg, "")
+ rdep = getpkgvalue(pkginfo, 'RDEPENDS', pkg, "")
+ rrec = getpkgvalue(pkginfo, 'RRECOMMENDS', pkg, "")
+ rprov = getpkgvalue(pkginfo, 'RPROVIDES', pkg, "")
for i in rprov.split():
self.rprov_pkg[i] = pkg
- if 'ALLOW_EMPTY_%s' % pkg in pkginfo.keys():
- allow_empty = pkginfo['ALLOW_EMPTY_%s' % pkg]
- elif 'ALLOW_EMPTY' in pkginfo.keys():
- allow_empty = pkginfo['ALLOW_EMPTY']
- else:
- allow_empty = ""
+ allow_empty = getpkgvalue(pkginfo, 'ALLOW_EMPTY', pkg, "")
if pkgsize == "0" and not allow_empty:
continue
--
1.7.9.5
next reply other threads:[~2012-09-10 14:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-10 14:35 Paul Eggleton [this message]
2012-09-10 14:36 ` [PATCH] hob: use correct semantics for dealing with pkgdata Paul Eggleton
-- strict thread matches above, loose matches on Subject: below --
2012-09-10 14:36 Paul Eggleton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1347287705-25453-1-git-send-email-paul.eggleton@linux.intel.com \
--to=paul.eggleton@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.