]> code.ossystems Code Review - openembedded-core.git/commit
sstate: fix touching files inside pseudo
authorJose Quaresma <quaresma.jose@gmail.com>
Wed, 20 Oct 2021 17:25:46 +0000 (18:25 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 23 Oct 2021 16:41:46 +0000 (17:41 +0100)
commitf6e7445c94443544e92fda97a017ce93393c5f84
tree388ddd7c9ded3930fdc8c2a3123aa588cd4bc91e
parente5031366ff3519814aff8b95c524659a398e62c1
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>
meta/classes/sstate.bbclass