From: Robert Yang Date: Thu, 13 Dec 2018 09:33:13 +0000 (+0800) Subject: ccache.bbclass: Add task do_cleanccache X-Git-Tag: uninative-2.4~631 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=36cead66fbadd8c3827aec4b67ea124ee3c2ff94;p=openembedded-core.git ccache.bbclass: Add task do_cleanccache Signed-off-by: Robert Yang --- 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"