summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorJose Quaresma <quaresma.jose@gmail.com>2021-10-20 18:25:46 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-23 17:41:46 +0100
commitf6e7445c94443544e92fda97a017ce93393c5f84 (patch)
tree388ddd7c9ded3930fdc8c2a3123aa588cd4bc91e /meta
parente5031366ff3519814aff8b95c524659a398e62c1 (diff)
downloadopenembedded-core-f6e7445c94443544e92fda97a017ce93393c5f84.tar.gz
sstate: fix touching files inside pseudo
running the 'id' command inside the sstate_create_package function shows that this funcion run inside the pseudo: uid=0(root) gid=0(root) groups=0(root) The check for touch files [ ! -w ${SSTATE_PKG} ] will always return true and the touch can fail when the real user don't have permission or in readonly filesystem. As the documentation refers, the file test operator "-w" check if the file has write permission (for the user running the test). We can avoid this test running the touch and mask any return errors that we have. Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/sstate.bbclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 5736474f4c..6e4eb09f8e 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -830,7 +830,7 @@ sstate_task_postfunc[dirs] = "${WORKDIR}"
sstate_create_package () {
# Exit early if it already exists
if [ -e ${SSTATE_PKG} ]; then
- [ ! -w ${SSTATE_PKG} ] || touch ${SSTATE_PKG}
+ touch ${SSTATE_PKG} 2>/dev/null || true
return
fi
@@ -865,7 +865,7 @@ sstate_create_package () {
else
rm $TFILE
fi
- [ ! -w ${SSTATE_PKG} ] || touch ${SSTATE_PKG}
+ touch ${SSTATE_PKG} 2>/dev/null || true
}
python sstate_sign_package () {