Patchwork [bitbake-devel,24/32] Hob(crumbs/hoblistmodel.py): Add mapping for rprovides and pkg

login
register
mail settings
Submitter Shane Wang
Date Feb. 29, 2012, 2:15 p.m.
Message ID <5a158f5e8818f75e2938dd6dc3038414ca918212.1330523904.git.shane.wang@intel.com>
Download mbox | patch
Permalink /patch/22469/
State New
Headers show

Comments

Shane Wang - Feb. 29, 2012, 2:15 p.m.
From: Dongxiao Xu <dongxiao.xu@intel.com>

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.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 bitbake/lib/bb/ui/crumbs/hoblistmodel.py |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)
Joshua Lock - Feb. 29, 2012, 9:30 p.m.
On 29/02/12 06:15, Shane Wang wrote:
> From: Dongxiao Xu<dongxiao.xu@intel.com>
>
> 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.
>
> Signed-off-by: Dongxiao Xu<dongxiao.xu@intel.com>
> ---
>   bitbake/lib/bb/ui/crumbs/hoblistmodel.py |   18 +++++++++++++++---
>   1 files changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
> index e440979..e910944 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,18 @@ 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 == "virtual-locale-en-gb":
> +            print("xdx: item name in pkg_path.keys: %s" % (item_name in self.pkg_path.keys()))
> +            print("xdx: item name in rprov_pkg.keys: %s" % (item_name in self.rprov_pkg.keys()))

Was this left in on purpose?

>           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 +146,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 +170,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]
Dongxiao Xu - March 1, 2012, 4:20 a.m.
On Wed, 2012-02-29 at 13:30 -0800, Joshua Lock wrote:
> 
> On 29/02/12 06:15, Shane Wang wrote:
> > From: Dongxiao Xu<dongxiao.xu@intel.com>
> >
> > 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.
> >
> > Signed-off-by: Dongxiao Xu<dongxiao.xu@intel.com>
> > ---
> >   bitbake/lib/bb/ui/crumbs/hoblistmodel.py |   18 +++++++++++++++---
> >   1 files changed, 15 insertions(+), 3 deletions(-)
> >
> > diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
> > index e440979..e910944 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,18 @@ 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 == "virtual-locale-en-gb":
> > +            print("xdx: item name in pkg_path.keys: %s" % (item_name in self.pkg_path.keys()))
> > +            print("xdx: item name in rprov_pkg.keys: %s" % (item_name in self.rprov_pkg.keys()))
> 
> Was this left in on purpose?

Oops... I should check it carefully.

Thanks,
Dongxiao

> 
> >           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 +146,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 +170,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]
>
Shane Wang - March 2, 2012, 1:31 p.m.
Joshua Lock wrote onĀ 2012-03-01:

> 
> 
> On 29/02/12 06:15, Shane Wang wrote:
>> From: Dongxiao Xu<dongxiao.xu@intel.com>
>> 
>> 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.
>> 
>> Signed-off-by: Dongxiao Xu<dongxiao.xu@intel.com>
>> ---
>>   bitbake/lib/bb/ui/crumbs/hoblistmodel.py |   18 +++++++++++++++---
>>   1 files changed, 15 insertions(+), 3 deletions(-)
>> diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
>> b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py index e440979..e910944
>> 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,18 @@ 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 ==
>> "virtual-locale-en-gb": +            print("xdx: item name in
>> pkg_path.keys: %s" % (item_name in self.pkg_path.keys())) +           
>> print("xdx: item name in rprov_pkg.keys: %s" %
> (item_name in self.rprov_pkg.keys()))
> 
> Was this left in on purpose?
> 

Dongxiao, I guess you forgot to remove debug information;-)

--
Shane

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
index e440979..e910944 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,18 @@  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 == "virtual-locale-en-gb":
+            print("xdx: item name in pkg_path.keys: %s" % (item_name in self.pkg_path.keys()))
+            print("xdx: item name in rprov_pkg.keys: %s" % (item_name in self.rprov_pkg.keys()))
         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 +146,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 +170,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]