[OE-core] [PATCH 2/7] build: add remove/mkdir/chdir debugging

Ross Burton ross.burton at intel.com
Mon Jul 13 14:03:00 UTC 2015


Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 bitbake/lib/bb/build.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 7cefee7..fa297c3 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -169,6 +169,7 @@ def exec_func(func, d, dirs = None):
     cleandirs = flags.get('cleandirs')
     if cleandirs:
         for cdir in d.expand(cleandirs).split():
+            bb.note("removing %s (for %s)" % (cdir, func))
             bb.utils.remove(cdir, True)
             bb.utils.mkdirhier(cdir)
 
@@ -179,6 +180,7 @@ def exec_func(func, d, dirs = None):
 
     if dirs:
         for adir in dirs:
+            bb.note("creating explicit %s (for %s)" % (adir, func))
             bb.utils.mkdirhier(adir)
         adir = dirs[-1]
     else:
@@ -251,7 +253,13 @@ def exec_func_python(func, d, runfile, cwd=None):
             olddir = os.getcwd()
         except OSError:
             olddir = None
+        bb.note("chdir(%s) for %s" % (cwd, func))
         os.chdir(cwd)
+    else:
+        try:
+            bb.note("pwd(%s) for %s" % (os.getcwd(), func))
+        except:
+            bb.note("no chdir for %s" % func)
 
     bb.debug(2, "Executing python function %s" % func)
 
@@ -301,6 +309,13 @@ def exec_func_shell(func, d, runfile, cwd=None):
     # Don't let the emitted shell script override PWD
     d.delVarFlag('PWD', 'export')
 
+    if cwd:
+        bb.note("shell for %s cd %s" % (func, cwd))
+    else:
+        try:
+            bb.note("pwd(%s) for %s" % (os.getcwd(), func))
+        except:
+            bb.note("no cd for %s" % func)
     with open(runfile, 'w') as script:
         script.write(shell_trap_code())
 
-- 
2.1.4




More information about the Openembedded-core mailing list