Adapt to new build vs source dir bits, and dont execute a function if hte function...
authorChris Larson <clarson@kergoth.com>
Wed, 31 Mar 2004 18:14:29 +0000 (18:14 +0000)
committerChris Larson <clarson@kergoth.com>
Wed, 31 Mar 2004 18:14:29 +0000 (18:14 +0000)
bin/oe/build.py

index da86578..3e110f5 100644 (file)
@@ -87,16 +87,20 @@ def init(data):
 def exec_func(func, d, dirs = None):
        """Execute an OE 'function'"""
 
+       body = data.getVar(func, d)
+       if not body:
+               return
+
        if not dirs:
                dirs = string.split(data.getVarFlag(func, 'dirs', d) or "")
        for adir in dirs:
                adir = data.expand(adir, d)
-               mkdirhier(adir) 
+               mkdirhier(adir)
 
        if len(dirs) > 0:
                adir = dirs[-1]
        else:
-               adir = data.getVar('S', d)
+               adir = data.getVar('B', d)
 
        adir = data.expand(adir, d)
 
@@ -117,11 +121,7 @@ def exec_func_python(func, d):
        """Execute a python OE 'function'"""
        import re, os
 
-       body = data.getVar(func, d)
-       if not body:
-               return
-
-       tmp = "def " + func + "():\n%s" % body
+       tmp = "def " + func + "():\n%s" % data.getVar(func, d)
        comp = compile(tmp + '\n' + func + '()', oe.data.getVar('FILE', d, 1) + ':' + func, "exec")
        prevdir = os.getcwd()
        g = {} # globals