]> code.ossystems Code Review - openembedded-core.git/commitdiff
sstate.bbclass: delete sstate files when doing cleanall
authorPaul Eggleton <paul.eggleton@intel.com>
Mon, 22 Nov 2010 16:05:10 +0000 (16:05 +0000)
committerRichard Purdie <rpurdie@linux.intel.com>
Mon, 20 Dec 2010 17:54:16 +0000 (17:54 +0000)
This fixes the cleanall task to actually delete the sstage cache files. This
was not working correctly before due to attempting to use the current task's
hash in the package file name to be deleted, which of course is the hash of
the cleanall task when doing cleanall. The siginfo files are now deleted as
well.

Signed-off-by: Paul Eggleton <paul.eggleton@intel.com>
meta/classes/sstate.bbclass

index 3696a8cd3b411da82068654edb48217c5c46b34a..0ba130c8860f07f260c250e33a2bee0d808ac755 100644 (file)
@@ -6,7 +6,8 @@ SSTATE_MANFILEPREFIX = "${SSTATE_MANFILEBASE}${PN}"
 
 
 SSTATE_PKGARCH    = "${BASE_PACKAGE_ARCH}"
-SSTATE_PKGNAME    = "sstate-${PN}-${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}-${PV}-${PR}-${SSTATE_PKGARCH}-${SSTATE_VERSION}-${BB_TASKHASH}"
+SSTATE_PKGSPEC    = "sstate-${PN}-${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}-${PV}-${PR}-${SSTATE_PKGARCH}-${SSTATE_VERSION}-"
+SSTATE_PKGNAME    = "${SSTATE_PKGSPEC}${BB_TASKHASH}"
 SSTATE_PKG        = "${SSTATE_DIR}/${SSTATE_PKGNAME}"
 
 SSTATE_SCAN_CMD ?= "find ${SSTATE_BUILDDIR} \( -name "*.la" -o -name "*-config" \) -type f"
@@ -190,9 +191,12 @@ def sstate_installpkg(ss, d):
     return True
 
 def sstate_clean_cachefile(ss, d):
-    sstatepkg = bb.data.getVar('SSTATE_PKG', d, True) + '_' + ss['name'] + ".tgz"
-    bb.note("Removing %s" % sstatepkg)
-    oe.path.remove(sstatepkg)
+    import oe.path
+
+    sstatepkgdir = bb.data.getVar('SSTATE_DIR', d, True)
+    sstatepkgfile = sstatepkgdir + '/' + bb.data.getVar('SSTATE_PKGSPEC', d, True) + "*_" + ss['name'] + ".tgz*"
+    bb.note("Removing %s" % sstatepkgfile)
+    oe.path.remove(sstatepkgfile)
 
 def sstate_clean_cachefiles(d):
     for task in (bb.data.getVar('SSTATETASKS', d, True) or "").split():