From 9c9fad56548f0cb447a538dcfdf390eb39cdc6c5 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 5 Sep 2007 08:40:25 +0000 Subject: build.py: Add support for cleaning directories before a task in the form: do_taskname[cleandirs] = 'dir' git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2693 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- bitbake/lib/bb/build.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/bb') diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index e9a6fc8c6..501f4f820 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/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: -- cgit v1.2.3