Patchwork [3/6] rootfs.py: Check for LDCONFIGDEPEND being empty string

login
register
mail settings
Submitter Khem Raj
Date Feb. 17, 2014, 7:34 p.m.
Message ID <af841644dfc682e9774287331ef39c3cd1ede978.1392665521.git.raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/66867/
State New
Headers show

Comments

Khem Raj - Feb. 17, 2014, 7:34 p.m.
We override LDCONFIGDEPEND to be empty string for uclibc
however the current check is for it being None as a result
the function is still executed but ldconfig-native is not
built as dependency for rootfs when building with uclibc

Fixes errors like below

File:
'/home/kraj/work/angstrom-repo/sources/openembedded-core/meta/lib/oe/rootfs.py',
lineno: 191, function: _run_ldconfig
     0187:    def _run_ldconfig(self):
     0188:        if self.d.getVar('LDCONFIGDEPEND', True) is not None:
     0189:            bb.note("Executing: ldconfig -r" +
self.image_rootfs + "-c new -v")
     0190:            self._exec_shell_cmd(['ldconfig', '-r',
self.image_rootfs, '-c',
 *** 0191:                                  'new', '-v'])

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/lib/oe/rootfs.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Laurentiu Palcu - Feb. 18, 2014, 8:37 a.m.
Hi Khem,

On Mon, Feb 17, 2014 at 11:34:15AM -0800, Khem Raj wrote:
> We override LDCONFIGDEPEND to be empty string for uclibc
> however the current check is for it being None as a result
> the function is still executed but ldconfig-native is not
> built as dependency for rootfs when building with uclibc
> 
> Fixes errors like below
> 
> File:
> '/home/kraj/work/angstrom-repo/sources/openembedded-core/meta/lib/oe/rootfs.py',
> lineno: 191, function: _run_ldconfig
>      0187:    def _run_ldconfig(self):
>      0188:        if self.d.getVar('LDCONFIGDEPEND', True) is not None:
>      0189:            bb.note("Executing: ldconfig -r" +
> self.image_rootfs + "-c new -v")
>      0190:            self._exec_shell_cmd(['ldconfig', '-r',
> self.image_rootfs, '-c',
>  *** 0191:                                  'new', '-v'])
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/lib/oe/rootfs.py |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
> index d149ca3..3bcb812 100644
> --- a/meta/lib/oe/rootfs.py
> +++ b/meta/lib/oe/rootfs.py
> @@ -185,7 +185,7 @@ class Rootfs(object):
>                          self._handle_intercept_failure(registered_pkgs)
>  
>      def _run_ldconfig(self):
> -        if self.d.getVar('LDCONFIGDEPEND', True) is not None:
> +        if self.d.getVar('LDCONFIGDEPEND', True) != "":
May I suggest:
           if (self.d.getVar('LDCONFIGDEPEND', True) or "") != "":
here? Otherwise, the condition will be true even if LDCONFIGDEPEND is
None.

laurentiu
>              bb.note("Executing: ldconfig -r" + self.image_rootfs + "-c new -v")
>              self._exec_shell_cmd(['ldconfig', '-r', self.image_rootfs, '-c',
>                                    'new', '-v'])
> -- 
> 1.7.10.4
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Richard Purdie - Feb. 18, 2014, 8:48 a.m.
On Tue, 2014-02-18 at 10:37 +0200, Laurentiu Palcu wrote:
> Hi Khem,
> 
> On Mon, Feb 17, 2014 at 11:34:15AM -0800, Khem Raj wrote:
> > We override LDCONFIGDEPEND to be empty string for uclibc
> > however the current check is for it being None as a result
> > the function is still executed but ldconfig-native is not
> > built as dependency for rootfs when building with uclibc
> > 
> > Fixes errors like below
> > 
> > File:
> > '/home/kraj/work/angstrom-repo/sources/openembedded-core/meta/lib/oe/rootfs.py',
> > lineno: 191, function: _run_ldconfig
> >      0187:    def _run_ldconfig(self):
> >      0188:        if self.d.getVar('LDCONFIGDEPEND', True) is not None:
> >      0189:            bb.note("Executing: ldconfig -r" +
> > self.image_rootfs + "-c new -v")
> >      0190:            self._exec_shell_cmd(['ldconfig', '-r',
> > self.image_rootfs, '-c',
> >  *** 0191:                                  'new', '-v'])
> > 
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> >  meta/lib/oe/rootfs.py |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
> > index d149ca3..3bcb812 100644
> > --- a/meta/lib/oe/rootfs.py
> > +++ b/meta/lib/oe/rootfs.py
> > @@ -185,7 +185,7 @@ class Rootfs(object):
> >                          self._handle_intercept_failure(registered_pkgs)
> >  
> >      def _run_ldconfig(self):
> > -        if self.d.getVar('LDCONFIGDEPEND', True) is not None:
> > +        if self.d.getVar('LDCONFIGDEPEND', True) != "":
> May I suggest:
>            if (self.d.getVar('LDCONFIGDEPEND', True) or "") != "":
> here? Otherwise, the condition will be true even if LDCONFIGDEPEND is
> None.

I think Bernhard's suggestion was the best one here so I've done that.
To be honest I thought Khem had updated the patch.

Cheers,

Richard
Khem Raj - Feb. 18, 2014, 2:23 p.m.
On Tue, Feb 18, 2014 at 12:48 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Tue, 2014-02-18 at 10:37 +0200, Laurentiu Palcu wrote:
>> Hi Khem,
>>
>> On Mon, Feb 17, 2014 at 11:34:15AM -0800, Khem Raj wrote:
>> > We override LDCONFIGDEPEND to be empty string for uclibc
>> > however the current check is for it being None as a result
>> > the function is still executed but ldconfig-native is not
>> > built as dependency for rootfs when building with uclibc
>> >
>> > Fixes errors like below
>> >
>> > File:
>> > '/home/kraj/work/angstrom-repo/sources/openembedded-core/meta/lib/oe/rootfs.py',
>> > lineno: 191, function: _run_ldconfig
>> >      0187:    def _run_ldconfig(self):
>> >      0188:        if self.d.getVar('LDCONFIGDEPEND', True) is not None:
>> >      0189:            bb.note("Executing: ldconfig -r" +
>> > self.image_rootfs + "-c new -v")
>> >      0190:            self._exec_shell_cmd(['ldconfig', '-r',
>> > self.image_rootfs, '-c',
>> >  *** 0191:                                  'new', '-v'])
>> >
>> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> > ---
>> >  meta/lib/oe/rootfs.py |    2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
>> > index d149ca3..3bcb812 100644
>> > --- a/meta/lib/oe/rootfs.py
>> > +++ b/meta/lib/oe/rootfs.py
>> > @@ -185,7 +185,7 @@ class Rootfs(object):
>> >                          self._handle_intercept_failure(registered_pkgs)
>> >
>> >      def _run_ldconfig(self):
>> > -        if self.d.getVar('LDCONFIGDEPEND', True) is not None:
>> > +        if self.d.getVar('LDCONFIGDEPEND', True) != "":
>> May I suggest:
>>            if (self.d.getVar('LDCONFIGDEPEND', True) or "") != "":
>> here? Otherwise, the condition will be true even if LDCONFIGDEPEND is
>> None.
>
> I think Bernhard's suggestion was the best one here so I've done that.
> To be honest I thought Khem had updated the patch.

I missed this one. needed to test the suggestion but thanks for taking
care of it

>
> Cheers,
>
> Richard
>

Patch

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index d149ca3..3bcb812 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -185,7 +185,7 @@  class Rootfs(object):
                         self._handle_intercept_failure(registered_pkgs)
 
     def _run_ldconfig(self):
-        if self.d.getVar('LDCONFIGDEPEND', True) is not None:
+        if self.d.getVar('LDCONFIGDEPEND', True) != "":
             bb.note("Executing: ldconfig -r" + self.image_rootfs + "-c new -v")
             self._exec_shell_cmd(['ldconfig', '-r', self.image_rootfs, '-c',
                                   'new', '-v'])