diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-09-10 15:36:29 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-10 21:54:44 +0100 |
commit | 4ec3d7207261d12ff4859982989be7e142e7611d (patch) | |
tree | 9b47e0c021545345f3bcac6b912c5ae2a54ade39 /bitbake/lib | |
parent | a4e36563d9441eb878a64d4728d30f7fce740384 (diff) | |
download | poky-4ec3d7207261d12ff4859982989be7e142e7611d.tar.gz |
bitbake: hob: use correct semantics for dealing with pkgdata
Some of these values may or may not be overridden on a per-package
basis, so handle them accordingly.
(Bitbake rev: 56cee6a958843b03c5389d4a45245a04d1e03327)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hoblistmodel.py | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py index 10b7c55251..66b0efa6b3 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): | |||
145 | self.pkg_path = {} | 145 | self.pkg_path = {} |
146 | self.rprov_pkg = {} | 146 | self.rprov_pkg = {} |
147 | 147 | ||
148 | def getpkgvalue(pkgdict, key, pkgname, defaultval = None): | ||
149 | value = pkgdict.get('%s_%s' % (key, pkgname), None) | ||
150 | if not value: | ||
151 | value = pkgdict.get(key, defaultval) | ||
152 | return value | ||
153 | |||
148 | for pkginfo in pkginfolist: | 154 | for pkginfo in pkginfolist: |
149 | pn = pkginfo['PN'] | 155 | pn = pkginfo['PN'] |
150 | pv = pkginfo['PV'] | 156 | pv = pkginfo['PV'] |
@@ -157,25 +163,24 @@ class PackageListModel(gtk.TreeStore): | |||
157 | self.COL_INC, False) | 163 | self.COL_INC, False) |
158 | self.pn_path[pn] = self.get_path(pniter) | 164 | self.pn_path[pn] = self.get_path(pniter) |
159 | 165 | ||
166 | # PKG is always present | ||
160 | pkg = pkginfo['PKG'] | 167 | pkg = pkginfo['PKG'] |
161 | pkgv = pkginfo['PKGV'] | 168 | pkgv = getpkgvalue(pkginfo, 'PKGV', pkg) |
162 | pkgr = pkginfo['PKGR'] | 169 | pkgr = getpkgvalue(pkginfo, 'PKGR', pkg) |
163 | pkgsize = pkginfo['PKGSIZE_%s' % pkg] if 'PKGSIZE_%s' % pkg in pkginfo.keys() else "0" | 170 | # PKGSIZE is artificial, will always be overridden with the package name if present |
164 | pkg_rename = pkginfo['PKG_%s' % pkg] if 'PKG_%s' % pkg in pkginfo.keys() else "" | 171 | pkgsize = pkginfo.get('PKGSIZE_%s' % pkg, "0") |
165 | section = pkginfo['SECTION_%s' % pkg] if 'SECTION_%s' % pkg in pkginfo.keys() else "" | 172 | # PKG_%s is the renamed version |
166 | summary = pkginfo['SUMMARY_%s' % pkg] if 'SUMMARY_%s' % pkg in pkginfo.keys() else "" | 173 | pkg_rename = pkginfo.get('PKG_%s' % pkg, "") |
167 | rdep = pkginfo['RDEPENDS_%s' % pkg] if 'RDEPENDS_%s' % pkg in pkginfo.keys() else "" | 174 | # The rest may be overridden or not |
168 | rrec = pkginfo['RRECOMMENDS_%s' % pkg] if 'RRECOMMENDS_%s' % pkg in pkginfo.keys() else "" | 175 | section = getpkgvalue(pkginfo, 'SECTION', pkg, "") |
169 | rprov = pkginfo['RPROVIDES_%s' % pkg] if 'RPROVIDES_%s' % pkg in pkginfo.keys() else "" | 176 | summary = getpkgvalue(pkginfo, 'SUMMARY', pkg, "") |
177 | rdep = getpkgvalue(pkginfo, 'RDEPENDS', pkg, "") | ||
178 | rrec = getpkgvalue(pkginfo, 'RRECOMMENDS', pkg, "") | ||
179 | rprov = getpkgvalue(pkginfo, 'RPROVIDES', pkg, "") | ||
170 | for i in rprov.split(): | 180 | for i in rprov.split(): |
171 | self.rprov_pkg[i] = pkg | 181 | self.rprov_pkg[i] = pkg |
172 | 182 | ||
173 | if 'ALLOW_EMPTY_%s' % pkg in pkginfo.keys(): | 183 | allow_empty = getpkgvalue(pkginfo, 'ALLOW_EMPTY', pkg, "") |
174 | allow_empty = pkginfo['ALLOW_EMPTY_%s' % pkg] | ||
175 | elif 'ALLOW_EMPTY' in pkginfo.keys(): | ||
176 | allow_empty = pkginfo['ALLOW_EMPTY'] | ||
177 | else: | ||
178 | allow_empty = "" | ||
179 | 184 | ||
180 | if pkgsize == "0" and not allow_empty: | 185 | if pkgsize == "0" and not allow_empty: |
181 | continue | 186 | continue |