summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2020-04-30 19:49:55 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-09 18:55:43 +0100
commit462e3f505217c9b9e0d2c1cbdafb0c8910bb6a59 (patch)
tree7fecf58bf093dab1d04d9d23446fbca7e1a1f163
parentd3f6ffb148e8837f2f6ba81f07dbfd6bbec64726 (diff)
downloadopenembedded-core-contrib-462e3f505217c9b9e0d2c1cbdafb0c8910bb6a59.tar.gz
openembedded-core-contrib-462e3f505217c9b9e0d2c1cbdafb0c8910bb6a59.tar.bz2
openembedded-core-contrib-462e3f505217c9b9e0d2c1cbdafb0c8910bb6a59.zip
sstate.bbclass: Do not fail if files cannot be touched
It may be that a file is not allowed to be touched, e.g., if it is a symbolic link into a global sstate cache served over NFS. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/sstate.bbclass15
1 files changed, 11 insertions, 4 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index c73c3b42a7..aa9c30b4e1 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -690,7 +690,10 @@ def sstate_package(ss, d):
if not os.path.exists(siginfo):
bb.siggen.dump_this_task(siginfo, d)
else:
- os.utime(siginfo, None)
+ try:
+ os.utime(siginfo, None)
+ except PermissionError:
+ pass
return
@@ -776,7 +779,7 @@ sstate_task_postfunc[dirs] = "${WORKDIR}"
sstate_create_package () {
# Exit early if it already exists
if [ -e ${SSTATE_PKG} ]; then
- touch ${SSTATE_PKG}
+ [ ! -w ${SSTATE_PKG} ] || touch ${SSTATE_PKG}
return
fi
@@ -810,7 +813,7 @@ sstate_create_package () {
else
rm $TFILE
fi
- touch ${SSTATE_PKG}
+ [ ! -w ${SSTATE_PKG} ] || touch ${SSTATE_PKG}
}
python sstate_sign_package () {
@@ -1122,7 +1125,11 @@ python sstate_eventhandler() {
if not os.path.exists(siginfo):
bb.siggen.dump_this_task(siginfo, d)
else:
- os.utime(siginfo, None)
+ try:
+ os.utime(siginfo, None)
+ except PermissionError:
+ pass
+
}
SSTATE_PRUNE_OBSOLETEWORKDIR ?= "1"