[oe-commits] Josua Mayer : package.bbclass: do_split_packages should always return something.

git at git.openembedded.org git at git.openembedded.org
Mon Feb 17 15:23:23 UTC 2014


Module: openembedded-core.git
Branch: master
Commit: 39737e00e85bd4a6053f63f0c959fd424aa009be
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=39737e00e85bd4a6053f63f0c959fd424aa009be

Author: Josua Mayer <josua.mayer97 at gmail.com>
Date:   Fri Feb 14 16:02:24 2014 +0100

package.bbclass: do_split_packages should always return something.

So far, when do_split_packages is passed a non-existing folder, it will return nothing.
While building Mesa with PACKAGECONFIG="egl gles" for qemux86, do_package threw a nice exception on a line reading "pkgs += do_split_packages":
"Exception: TypeError: 'NoneType' object is not iterable"
I think a function should always return something, and in this specific case, returning an empty list should be right.
This patch simply fixes the return statement to do just that.

Signed-off-by: Josua Mayer <josua.mayer97 at gmail.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>

---

 meta/classes/package.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 042d74c..297d962 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -126,7 +126,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst
     # If the root directory doesn't exist, don't error out later but silently do
     # no splitting.
     if not os.path.exists(dvar + root):
-        return
+        return []
 
     ml = d.getVar("MLPREFIX", True)
     if ml:



More information about the Openembedded-commits mailing list