From 24883b4fc72432f9d12df7682dfd4207a719060b Mon Sep 17 00:00:00 2001 From: Dongxiao Xu Date: Wed, 29 Feb 2012 22:15:21 +0800 Subject: Hob(crumbs/hoblistmodel.py): Add mapping for rprovides and pkg When checking the package's RDEPENDS information, we will see some case like A RDEPENDS virtual-b, and B RPROVIDES virtual-b, we need to reflect this relationship in packaging selection. (Bitbake rev: 44562593556e67d7976a124d5a420938aff95e0c) Signed-off-by: Dongxiao Xu Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/hoblistmodel.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'bitbake/lib/bb/ui/crumbs/hoblistmodel.py') diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py index e440979434..0b7c0cbf4a 100644 --- a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py +++ b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py @@ -51,6 +51,7 @@ class PackageListModel(gtk.TreeStore): self.pkgs_size = 0 self.pn_path = {} self.pkg_path = {} + self.rprov_pkg = {} gtk.TreeStore.__init__ (self, gobject.TYPE_STRING, @@ -71,10 +72,15 @@ class PackageListModel(gtk.TreeStore): Returns the path in the model or None """ def find_path_for_item(self, item_name): + pkg = item_name if item_name not in self.pkg_path.keys(): - return None - else: - return self.pkg_path[item_name] + if item_name not in self.rprov_pkg.keys(): + return None + pkg = self.rprov_pkg[item_name] + if pkg not in self.pkg_path.keys(): + return None + + return self.pkg_path[pkg] def find_item_for_path(self, item_path): return self[item_path][self.COL_NAME] @@ -137,6 +143,7 @@ class PackageListModel(gtk.TreeStore): self.pkgs_size = 0 self.pn_path = {} self.pkg_path = {} + self.rprov_pkg = {} for pkginfo in pkginfolist: pn = pkginfo['PN'] @@ -160,6 +167,8 @@ class PackageListModel(gtk.TreeStore): 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 "" + 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] -- cgit v1.2.3-54-g00ecf