diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2018-12-13 17:33:13 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-14 11:21:57 +0000 |
commit | 36cead66fbadd8c3827aec4b67ea124ee3c2ff94 (patch) | |
tree | 9f1be2ae7a92cac12aab5fe5a82eead006f3c432 /meta | |
parent | 35d7fe73bba15de16d2eb0a4b12ef03b57b23306 (diff) | |
download | openembedded-core-contrib-36cead66fbadd8c3827aec4b67ea124ee3c2ff94.tar.gz |
ccache.bbclass: Add task do_cleanccache
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/ccache.bbclass | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass index f3612c5019..fb3fbdf25c 100644 --- a/meta/classes/ccache.bbclass +++ b/meta/classes/ccache.bbclass @@ -48,3 +48,17 @@ python() { d.appendVar('DEPENDS', ' ccache-native') d.setVar('CCACHE', 'ccache ') } + +addtask cleanccache after do_clean +python do_cleanccache() { + import shutil + + ccache_dir = d.getVar('CCACHE_DIR') + if os.path.exists(ccache_dir): + bb.note("Removing %s" % ccache_dir) + shutil.rmtree(ccache_dir) + else: + bb.note("%s doesn't exist" % ccache_dir) +} +addtask cleanall after do_cleanccache +do_cleanccache[nostamp] = "1" |