abuild: allow override setfattr

In osme situations it might be needed to disable setfattr. Allow this
via: `SETFATTR=true abuild ...`

fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10027
This commit is contained in:
Natanael Copa 2021-04-28 10:33:23 +02:00
parent 754270e460
commit 32b7789e9a
1 changed files with 3 additions and 2 deletions

View File

@ -27,6 +27,7 @@ fi
: ${ADDGROUP:="abuild-addgroup"}
: ${CC:="gcc"}
: ${CXX:="g++"}
: ${SETFATTR:="setfattr"}
apk_opt_wait="--wait 30"
@ -1847,7 +1848,7 @@ default_dbg() {
mv "$ddbg_dstfile" "$ddbg_dstdir"
${CROSS_COMPILE}strip "$ddbg_srcfile"
if [ -n "$xattr" ]; then
echo "$xattr" | setfattr --restore=-
echo "$xattr" | "$SETFATTR" --restore=-
fi
done
return 0
@ -2402,7 +2403,7 @@ stripbin() {
local XATTR=$(getfattr --match="" --dump "${filename}")
"${stripcmd}" "${filename}"
if [ -n "$XATTR" ]; then
echo "$XATTR" | setfattr --restore=-
echo "$XATTR" | "$SETFATTR" --restore=-
fi
done
}