diff mbox series

ODP: [OE-Core][PATCH v12 4/7] sstate.bbclass: add support for ACLs and xattr

Message ID VI1PR04MB537337326938DAE0CF93155891E0A@VI1PR04MB5373.eurprd04.prod.outlook.com
State New
Headers show
Series ODP: [OE-Core][PATCH v12 4/7] sstate.bbclass: add support for ACLs and xattr | expand

Commit Message

Piotr Ɓobacz Aug. 28, 2023, 8:44 a.m. UTC
Hi Richard,
I have discovered in here https://savannah.gnu.org/bugs/?59184 that this is a bug in tar, which is already reported. The solution, which is given out there is ugly, but on the other hand solution which will be added to tar will cause also to update machines so we need probably to discuss the best option for us...

BR
Piotr
diff mbox series

Patch

diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass
index 95373fd60a..ac890fc98e 100644
--- a/meta/classes-global/sstate.bbclass
+++ b/meta/classes-global/sstate.bbclass
@@ -848,7 +848,7 @@  sstate_create_package () {
         mkdir --mode=0775 -p `dirname ${SSTATE_PKG}`
         TFILE=`mktemp ${SSTATE_PKG}.XXXXXXXX`

-       OPT="-cS"
+       OPT="--format=posix ${@bb.utils.contains('DISTRO_FEATURES', 'acl', '--acls', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', '--xattrs', '', d)} --numeric-owner -cS"
         ZSTD="zstd -${SSTATE_ZSTD_CLEVEL} -T${ZSTD_THREADS}"
         # Use pzstd if available
         if [ -x "$(command -v pzstd)" ]; then
@@ -914,7 +914,7 @@  sstate_unpack_package () {
                 ZSTD="pzstd -p ${ZSTD_THREADS}"
         fi

-       tar -I "$ZSTD" -xvpf ${SSTATE_PKG}
+       tar -I "$ZSTD" --format=posix ${@bb.utils.contains('DISTRO_FEATURES', 'acl', '--acls', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', '--xattrs', '', d)} -xvpf ${SSTATE_PKG}
         # update .siginfo atime on local/NFS mirror if it is a symbolic link
         [ ! -h ${SSTATE_PKG}.siginfo ] || [ ! -e ${SSTATE_PKG}.siginfo ] || touch -a ${SSTATE_PKG}.siginfo 2>/dev/null || true
         # update each symbolic link instead of any referenced file