abuild: filter out security.selinux xattrs

This patch modifies abuild's behaviour to be independent of
whether SELinux labels are present in the build environment.

This is a workaround for containerised build environments where the
hosting environment has SELinux enabled. Security labels leak into the
container, manifesting as xattrs.

Discussion thread:
https://lists.alpinelinux.org/~alpine/devel/%3CCA%2Bgy4ieuXLuQddxmPuiucyZbut%3D14cR8tgmGrh0qE9qLDBivmg%40mail.gmail.com%3E
This commit is contained in:
Ross Younger 2021-05-19 16:01:42 +12:00 committed by Kevin Daudt
parent f2ab775123
commit d0ccbb7c09

View File

@ -1717,6 +1717,7 @@ create_apks() {
# explicitly sort package content
find "$@" -print0 | LC_ALL=C sort -z | tar --xattrs \
--xattrs-exclude=security.selinux \
--format=posix \
--pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0,ctime:=0 \
--mtime="@${SOURCE_DATE_EPOCH}" \