Patchwork gtk-icon-cache: Fix rdepends construction

login
register
mail settings
Submitter Saul Wold
Date Jan. 31, 2013, 7:11 p.m.
Message ID <1359659480-8210-1-git-send-email-sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/43777/
State Accepted
Commit 7a3d352ab801a509cae1d17f05ebe69498d25c65
Headers show

Comments

Saul Wold - Jan. 31, 2013, 7:11 p.m.
The rdepends getVar is returning NoneType and the string constuction fails
this occurs with the hicolor-icon-theme recipe.

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/classes/gtk-icon-cache.bbclass |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Chris Larson - Jan. 31, 2013, 7:50 p.m.
On Thu, Jan 31, 2013 at 12:11 PM, Saul Wold <sgw@linux.intel.com> wrote:

> -        rdepends = d.getVar('RDEPENDS_%s' % pkg, True)
> -        rdepends = rdepends + ' ' + d.getVar('MLPREFIX') +
> "hicolor-icon-theme"
> -        d.setVar('RDEPENDS_%s' % pkg, rdepends)
> +        rdepends = ' ' + d.getVar('MLPREFIX') + "hicolor-icon-theme"
> +        d.appendVar('RDEPENDS_%s' % pkg, rdepends)
>

The new version isn't using a getVar of the old rdepends at all, so it's
just replacing it every time. Is that really what you intended here?
Wouldn't a getVar() or '' be a better approach? Further, the '' +
d.getVar('MLPREFIX') is pointless if you aren't including the original
value, as it adds a separator to the beginning when there's nothing to
separate.
Chris Larson - Jan. 31, 2013, 7:50 p.m.
On Thu, Jan 31, 2013 at 12:50 PM, Chris Larson <clarson@kergoth.com> wrote:

> On Thu, Jan 31, 2013 at 12:11 PM, Saul Wold <sgw@linux.intel.com> wrote:
>
>> -        rdepends = d.getVar('RDEPENDS_%s' % pkg, True)
>> -        rdepends = rdepends + ' ' + d.getVar('MLPREFIX') +
>> "hicolor-icon-theme"
>> -        d.setVar('RDEPENDS_%s' % pkg, rdepends)
>> +        rdepends = ' ' + d.getVar('MLPREFIX') + "hicolor-icon-theme"
>> +        d.appendVar('RDEPENDS_%s' % pkg, rdepends)
>>
>
> The new version isn't using a getVar of the old rdepends at all, so it's
> just replacing it every time. Is that really what you intended here?
> Wouldn't a getVar() or '' be a better approach? Further, the '' +
> d.getVar('MLPREFIX') is pointless if you aren't including the original
> value, as it adds a separator to the beginning when there's nothing to
> separate.


Erm, ignore this, I'm apparently blind as a bat if I can't see 'appendVar'
:)
Saul Wold - Jan. 31, 2013, 8:19 p.m.
On 01/31/2013 11:50 AM, Chris Larson wrote:
>
> On Thu, Jan 31, 2013 at 12:50 PM, Chris Larson <clarson@kergoth.com
> <mailto:clarson@kergoth.com>> wrote:
>
>     On Thu, Jan 31, 2013 at 12:11 PM, Saul Wold <sgw@linux.intel.com
>     <mailto:sgw@linux.intel.com>> wrote:
>
>         -        rdepends = d.getVar('RDEPENDS_%s' % pkg, True)
>         -        rdepends = rdepends + ' ' + d.getVar('MLPREFIX') +
>         "hicolor-icon-theme"
>         -        d.setVar('RDEPENDS_%s' % pkg, rdepends)
>         +        rdepends = ' ' + d.getVar('MLPREFIX') +
>         "hicolor-icon-theme"
>         +        d.appendVar('RDEPENDS_%s' % pkg, rdepends)
>
>
>     The new version isn't using a getVar of the old rdepends at all, so
>     it's just replacing it every time. Is that really what you intended
>     here? Wouldn't a getVar() or '' be a better approach? Further, the
>     '' + d.getVar('MLPREFIX') is pointless if you aren't including the
>     original value, as it adds a separator to the beginning when there's
>     nothing to separate.
>
>
> Erm, ignore this, I'm apparently blind as a bat if I can't see
> 'appendVar' :)

No problem, I have had those days also.

Sau!

> --
> Christopher Larson

Patch

diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass
index d5fdcd5..cf33efd 100644
--- a/meta/classes/gtk-icon-cache.bbclass
+++ b/meta/classes/gtk-icon-cache.bbclass
@@ -67,9 +67,8 @@  python populate_packages_append () {
             continue
 
         bb.note("adding hicolor-icon-theme dependency to %s" % pkg)
-        rdepends = d.getVar('RDEPENDS_%s' % pkg, True)
-        rdepends = rdepends + ' ' + d.getVar('MLPREFIX') + "hicolor-icon-theme"
-        d.setVar('RDEPENDS_%s' % pkg, rdepends)
+        rdepends = ' ' + d.getVar('MLPREFIX') + "hicolor-icon-theme"
+        d.appendVar('RDEPENDS_%s' % pkg, rdepends)
     
         bb.note("adding gtk-icon-cache postinst and postrm scripts to %s" % pkg)