summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2007-09-05 09:01:37 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2007-09-05 09:01:37 +0000
commit57d81fd620b54f69959b2152d7b38d91c98f56ce (patch)
tree5bdf6a2bb3218f1b3c741a9f0877fbacc7f77c1b
parentaeed07d2fa935ad1b7c37824f7d869f7f71337f6 (diff)
downloadbitbake-57d81fd620b54f69959b2152d7b38d91c98f56ce.tar.gz
build.py: Add support for cleaning directories before a task in the form: do_taskname[cleandirs] = 'dir'
-rw-r--r--ChangeLog2
-rw-r--r--lib/bb/build.py7
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0c7e6d8a8..4125e0316 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/lib/bb/build.py b/lib/bb/build.py
index e9a6fc8c6..501f4f820 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -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: