Skip to contentSkip to conversation

build: Allow dirs/cleandirs to work for empty functions

PATCH In review Richard Purdie 2 participants 2 messages Sep 14, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: Allow dirs/cleandirs to work for empty functions

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/lib/bb/build.py +0 -0
index 9dfcfec..5759502 100644
@@ -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')

#1 lore raw
Quoted 9 lines · Richard Purdie

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]

Looks good.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics