]> code.ossystems Code Review - openembedded-core.git/commitdiff
ccache.bbclass: Add task do_cleanccache
authorRobert Yang <liezhi.yang@windriver.com>
Thu, 13 Dec 2018 09:33:13 +0000 (17:33 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 14 Jan 2019 11:21:57 +0000 (11:21 +0000)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
meta/classes/ccache.bbclass

index f3612c501961485a88fb196d2fe184fe612b81dd..fb3fbdf25cd227d17a45963eecbf6267442c25c3 100644 (file)
@@ -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"