abuild: remove host uid/gid from pkg

Closes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10127
This commit is contained in:
Sertonix 2024-06-24 19:45:44 +02:00 committed by Natanael Copa
parent 0a91a31e47
commit d85ea24eca

View File

@ -1763,7 +1763,7 @@ human_size() {
}
create_apks() {
local file= dir= name= ver= apk= datadir= size=
local file= dir= name= ver= apk= datadir= size= i=
local gzip=$(command -v pigz || echo gzip)
if ! options_has "keepdirs"; then
rmdir "$pkgdir"/usr/lib \
@ -1788,6 +1788,13 @@ create_apks() {
done
fi
for i in root $pkgusers; do
printf '%s %s:0\n' "$i" "$i"
done > "$pkgbasedir"/.owner-map
for i in root $pkggroups; do
printf '%s %s:0\n' "$i" "$i"
done > "$pkgbasedir"/.group-map
for file in "$pkgbasedir"/.control.*/.PKGINFO; do
local dir="${file%/.PKGINFO}"
local name=$(pkginfo_val pkgname "$file")
@ -1824,6 +1831,8 @@ create_apks() {
--format=posix \
--pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0,ctime:=0 \
--mtime="@${SOURCE_DATE_EPOCH}" \
--owner-map="$pkgbasedir"/.owner-map \
--group-map="$pkgbasedir"/.group-map \
--no-recursion --null -T - \
-f - -c | abuild-tar --hash | $gzip -n -9 >"$dir"/data.tar.gz