]> code.ossystems Code Review - openembedded-core.git/commitdiff
build.py: Add support for cleaning directories before a task in the form: do_tasknam...
authorRichard Purdie <richard@openedhand.com>
Wed, 5 Sep 2007 08:40:25 +0000 (08:40 +0000)
committerRichard Purdie <richard@openedhand.com>
Wed, 5 Sep 2007 08:40:25 +0000 (08:40 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2693 311d38ba-8fff-0310-9ca6-ca027cbcb966

bitbake/ChangeLog
bitbake/lib/bb/build.py

index 0c7e6d8a8e9fecf4f5c2c0d0163779eb1ba4e7c5..4125e03169f67b26fdda925ef5a3da3f96f4cc5e 100644 (file)
@@ -10,6 +10,8 @@ Changes in BitBake 1.8.x:
        - Handle paths in svn fetcher module parameter
        - Support the syntax "export VARIABLE"
        - Add bzr fetcher
+       - Add support for cleaning directories before a task in the form:
+         do_taskname[cleandirs] = "dir"
 
 Changes in Bitbake 1.8.8:
        - Rewrite svn fetcher to make adding extra operations easier 
index e9a6fc8c61b30dc84d35ec11a0d699314f19c122..501f4f8206e6714e81dd85bb5b1733ad446f9d6a 100644 (file)
@@ -74,10 +74,13 @@ def exec_func(func, d, dirs = None):
     if not body:
         return
 
+    cleandirs = (data.expand(data.getVarFlag(func, 'cleandirs', d), d) or "").split()
+    for cdir in cleandirs:
+        os.system("rm -rf %s" % cdir)
+
     if not dirs:
-        dirs = (data.getVarFlag(func, 'dirs', d) or "").split()
+        dirs = (data.expand(data.getVarFlag(func, 'dirs', d), d) or "").split()
     for adir in dirs:
-        adir = data.expand(adir, d)
         mkdirhier(adir)
 
     if len(dirs) > 0: