build: Allow dirs/cleandirs to work for empty functions
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
@@ -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')
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]
Signed-off-by Richard Purdie <[email protected]>
Looks good.
Signature · 5 lines
Christopher Larson clarson at kergoth dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics