[oe-commits] Ross Burton : package.bbclass: make do_split_packages handle non-existent root directories

git at git.openembedded.org git at git.openembedded.org
Tue Dec 11 16:01:19 UTC 2012


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

Author: Ross Burton <ross.burton at intel.com>
Date:   Thu Dec  6 12:53:14 2012 +0000

package.bbclass: make do_split_packages handle non-existent root directories

This function has different behaviour if the split directory doesn't exist
depending on the recursive argument: non-recursive uses os.listdirs which throws
an exception, recursive uses os.walk which doesn't.

do_split_packages should silently handle non-existent directories because it's
mainly used for plugin directories, which may end up being empty though changing
the distro configuration (for example, connman without wifi distro feature).

So, add an early exit if the split root doesn't exist.

Signed-off-by: Ross Burton <ross.burton at intel.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>

---

 meta/classes/package.bbclass |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 993ce98..8a94e30 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -116,6 +116,13 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst
 
     """
 
+    dvar = d.getVar('PKGD', True)
+
+    # 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
+
     ml = d.getVar("MLPREFIX", True)
     if ml:
         if not output_pattern.startswith(ml):
@@ -130,7 +137,6 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst
         if newdeps:
             extra_depends = " ".join(newdeps)
 
-    dvar = d.getVar('PKGD', True)
 
     packages = d.getVar('PACKAGES', True).split()
 





More information about the Openembedded-commits mailing list