]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: build: Allow dirs/cleandirs to work for empty functions
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 14 Sep 2016 21:29:43 +0000 (22:29 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 15 Sep 2016 11:15:07 +0000 (12:15 +0100)
Users are surprised when dirs/cleandirs aren't acted upon for
empty functions. This reorders the code slightly so that those
flags are acted upon for empty functions as there are cases where
this is expected.

[YOCTO #10256]

(Bitbake rev: 5bf874673d75b5f4ff2b34f0ab8502558ee84d00)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/build.py

index 310b5c05114f150198cb53402bca98e42fbee1a1..fcf0149178542081922beeab0751aa5db302413a 100644 (file)
@@ -193,12 +193,6 @@ def exec_func(func, d, dirs = None, pythonexception=False):
     except:
         oldcwd = None
 
-    body = d.getVar(func, False)
-    if not body:
-        if body is None:
-            logger.warning("Function %s doesn't exist", func)
-        return
-
     flags = d.getVarFlags(func)
     cleandirs = flags.get('cleandirs')
     if cleandirs:
@@ -217,6 +211,13 @@ def exec_func(func, d, dirs = None, pythonexception=False):
         adir = dirs[-1]
     else:
         adir = None
+
+    body = d.getVar(func, False)
+    if not body:
+        if body is None:
+            logger.warning("Function %s doesn't exist", func)
+        return
+
     ispython = flags.get('python')
 
     lockflag = flags.get('lockfiles')