diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-22 10:22:34 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-22 10:22:34 +0100 |
commit | fd4457199ef604dc4d5f8346c8b2a09dc3939129 (patch) | |
tree | 32234080a437751424a79bd170f62858c1527e13 /meta/classes/base.bbclass | |
parent | 2a69c58046a86d0f783acebd8a77e9419b43139a (diff) | |
download | poky-fd4457199ef604dc4d5f8346c8b2a09dc3939129.tar.gz |
base/sstate: Add cleanall task to remove downloads and sstate cached files
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r-- | meta/classes/base.bbclass | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index aee75297eb..1547ed0305 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -621,4 +621,32 @@ def check_gcc3(data): | |||
621 | 621 | ||
622 | return False | 622 | return False |
623 | 623 | ||
624 | addtask cleanall after do_clean | ||
625 | python do_cleanall() { | ||
626 | sstate_clean_cachefiles(d) | ||
627 | |||
628 | localdata = bb.data.createCopy(d) | ||
629 | bb.data.update_data(localdata) | ||
630 | |||
631 | dl_dir = bb.data.getVar('DL_DIR', localdata, True) | ||
632 | dl_dir = os.path.realpath(dl_dir) | ||
633 | |||
634 | src_uri = bb.data.getVar('SRC_URI', localdata, True) | ||
635 | if not src_uri: | ||
636 | return | ||
637 | for url in src_uri.split(): | ||
638 | try: | ||
639 | local = bb.data.expand(bb.fetch.localpath(url, localdata), localdata) | ||
640 | except bb.MalformedUrl, e: | ||
641 | raise FuncFailed('Unable to generate local path for malformed uri: %s' % e) | ||
642 | if local is None: | ||
643 | continue | ||
644 | local = os.path.realpath(local) | ||
645 | if local.startswith(dl_dir): | ||
646 | bb.note("Removing %s*" % local) | ||
647 | oe.path.remove(local + "*") | ||
648 | } | ||
649 | do_cleanall[nostamp] = "1" | ||
650 | |||
651 | |||
624 | EXPORT_FUNCTIONS do_setscene do_fetch do_unpack do_configure do_compile do_install do_package | 652 | EXPORT_FUNCTIONS do_setscene do_fetch do_unpack do_configure do_compile do_install do_package |