Patchwork rootfs.py: Check for LDCONFIGDEPEND being empty string

login
register
mail settings
Submitter Khem Raj
Date Feb. 15, 2014, 7:23 a.m.
Message ID <1392449004-2212-1-git-send-email-raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/66791/
State New
Headers show

Comments

Khem Raj - Feb. 15, 2014, 7:23 a.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(-)
Bernhard Reutner-Fischer - Feb. 16, 2014, 11:48 a.m.
On 15 Feb 2014 08:22, "Khem Raj" <raj.khem@gmail.com> 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 6114f56..285c769 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) != "":

Why not just
if self.d.getVar('LDCONFIGDEPEND', True):

That ought to DTRT for all content evaluating to false.
Thanks,

Patch

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 6114f56..285c769 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'])