[oe-commits] Robert Yang : sstate.bbclass: update the timestamps after install

git at git.openembedded.org git at git.openembedded.org
Mon Sep 29 11:14:20 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: bbee747466a6947319cff2ffd676abf9432c16ae
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=bbee747466a6947319cff2ffd676abf9432c16ae

Author: Robert Yang <liezhi.yang at windriver.com>
Date:   Wed Sep  3 23:12:06 2014 -0700

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 <liezhi.yang at windriver.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>

---

 meta/classes/sstate.bbclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 72ac882..9160e7f 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"



More information about the Openembedded-commits mailing list