From: Robert Yang Date: Thu, 4 Sep 2014 06:12:06 +0000 (-0700) Subject: sstate.bbclass: update the timestamps after install X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~32316 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbee747466a6947319cff2ffd676abf9432c16ae;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git sstate.bbclass: update the timestamps after install Update the sstate file's timestamps after it is installed, it will be very useful for removing the old sstate file, especially, it's not easy to remove when use the shared SSTATE_DIR, we can easily remove them with this change, for example: $ find state-cache -type f -ctime +10 -exec rm -f {} \; Will remove the sstate file which isn't used by recent 10 days. We can use the -atime, but it is not always available, for example, when mounted with "-o noatime". The touch is a very light weight action, and the scripts/sstate-cache-management.sh also requires this. Signed-off-by: Robert Yang Signed-off-by: Ross Burton --- diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index 72ac882dbbf..9160e7f6dad 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -624,6 +624,8 @@ sstate_unpack_package () { mkdir -p ${SSTATE_INSTDIR} cd ${SSTATE_INSTDIR} tar -xmvzf ${SSTATE_PKG} + # Use "! -w ||" to return true for read only files + [ ! -w ${SSTATE_PKG} ] || touch --no-dereference ${SSTATE_PKG} } BB_HASHCHECK_FUNCTION = "sstate_checkhashes"