Patchwork package_manager: Fix NoneType Object on do_populate_sdk

login
register
mail settings
Submitter Ricardo Ribalda Delgado
Date May 7, 2014, 11:23 a.m.
Message ID <1399461815-6753-1-git-send-email-ricardo.ribalda@gmail.com>
Download mbox | patch
Permalink /patch/71679/
State Accepted
Commit bc1f98def1d4f86127763bb4fcfe59199acaf5ce
Headers show

Comments

Ricardo Ribalda Delgado - May 7, 2014, 11:23 a.m.
PACKAGE_EXCLUDE can be not defined or empty, leading to a build error.

File: '/var/lib/jenkins/jobs/qt5022-cesium/workspace/repo/yocto/meta/lib/oe/package_manager.py', lineno: 1649, function: _create_configs
     1645:                    "Pin-Priority: %d\n\n" % (arch, priority))
     1646:
     1647:                priority += 5
     1648:
 *** 1649:            for pkg in self.d.getVar('PACKAGE_EXCLUDE', True).split():
     1650:                prefs_file.write(
     1651:                    "Package: %s\n"
     1652:                    "Pin: release *\n"
     1653:                    "Pin-Priority: -1\n\n" % pkg)
Exception: AttributeError: 'NoneType' object has no attribute 'split'

ERROR: Function failed: do_populate_sdk
ERROR: Logfile of failure stored in: /var/lib/jenkins/jobs/qt5022-cesium/workspace/build/tmp/work/bobcat_64-poky-linux/meta-toolchain/1.0-r7/temp/log.do_populate_sdk.21363
NOTE: recipe meta-toolchain-1.0-r7: task do_populate_sdk: Failed
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
 meta/lib/oe/package_manager.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index a8360fe..b33ee60 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -1637,7 +1637,8 @@  class DpkgPM(PackageManager):
 
                 priority += 5
 
-            for pkg in self.d.getVar('PACKAGE_EXCLUDE', True).split():
+            pkg_exclude = self.d.getVar('PACKAGE_EXCLUDE', True) or ""
+            for pkg in pkg_exclude:
                 prefs_file.write(
                     "Package: %s\n"
                     "Pin: release *\n"