]> code.ossystems Code Review - openembedded-core.git/commitdiff
sstate.bbclass: check if mirror directory is writable
authorEd Bartosh <ed.bartosh@linux.intel.com>
Wed, 12 Apr 2017 21:00:18 +0000 (00:00 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 13 Jun 2017 06:32:48 +0000 (07:32 +0100)
Commit 51edde653707e7a3cd2186082458f01f32cd1996 makes a wrong assumption
that SSTATE_MIRRORS have write permissions.

A mirror is by definition outside of it's user control. In my use case
it happens I does not have permissions to update the access time of the
dereferenced symbolic-link file.

Checked if file is writable before changing its atime.

Thanks to Paulo Neves for the patch.

[YOCTO #11307]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/sstate.bbclass

index 4fdfcc83ecacadeb41d4bfedaf97d803fb7a31e2..e2bc7355b4d534db806f3b1580f536fc051bcd8b 100644 (file)
@@ -725,7 +725,7 @@ python sstate_sign_package () {
 sstate_unpack_package () {
        tar -xvzf ${SSTATE_PKG}
        # update .siginfo atime on local/NFS mirror
-       [ -h ${SSTATE_PKG}.siginfo ] && touch -a ${SSTATE_PKG}.siginfo
+       [ -w ${SSTATE_PKG}.siginfo ] && [ -h ${SSTATE_PKG}.siginfo ] && touch -a ${SSTATE_PKG}.siginfo
        # Use "! -w ||" to return true for read only files
        [ ! -w ${SSTATE_PKG} ] || touch --no-dereference ${SSTATE_PKG}
        [ ! -w ${SSTATE_PKG}.sig ] || [ ! -e ${SSTATE_PKG}.sig ] || touch --no-dereference ${SSTATE_PKG}.sig