mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-04-19 06:42:18 +03:00
functions.sh: move apk_tar from abuild
Allows sharing code with other abuild tools
This commit is contained in:
parent
3f5614abbe
commit
6627a52596
11
abuild.in
11
abuild.in
@ -1791,13 +1791,6 @@ human_size() {
|
||||
printf("%.1f %s\n", y, type[i+2]) }'
|
||||
}
|
||||
|
||||
apk_tar() {
|
||||
tar --format=posix \
|
||||
--pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0,ctime:=0 \
|
||||
--mtime="@$SOURCE_DATE_EPOCH" \
|
||||
--no-recursion --null -T - -f - -c "$@"
|
||||
}
|
||||
|
||||
create_apks() {
|
||||
local file= dir= name= ver= apk= datadir= size= i= gzip=
|
||||
gzip=$(command -v pigz || echo gzip)
|
||||
@ -1861,7 +1854,7 @@ create_apks() {
|
||||
|
||||
# explicitly sort package content
|
||||
find "$@" -print0
|
||||
fi | LC_ALL=C sort -z | apk_tar --xattrs \
|
||||
fi | LC_ALL=C sort -z | apk_tar -T - --xattrs \
|
||||
--xattrs-exclude=security.selinux \
|
||||
--owner-map="$pkgbasedir"/.owner-map \
|
||||
--group-map="$pkgbasedir"/.group-map \
|
||||
@ -1875,7 +1868,7 @@ create_apks() {
|
||||
|
||||
# control.tar.gz
|
||||
cd "$dir"
|
||||
apk_tar < .metafiles | abuild-tar --cut \
|
||||
apk_tar -T - < .metafiles | abuild-tar --cut \
|
||||
| $gzip -n -9 > control.tar.gz
|
||||
abuild-sign -q control.tar.gz || exit 1
|
||||
|
||||
|
@ -246,6 +246,15 @@ any_buildscript() {
|
||||
fi
|
||||
}
|
||||
|
||||
apk_tar() {
|
||||
if [ -n "$SOURCE_DATE_EPOCH" ]; then
|
||||
set -- --mtime="@$SOURCE_DATE_EPOCH" "$@"
|
||||
fi
|
||||
tar --format=posix \
|
||||
--pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0,ctime:=0 \
|
||||
--no-recursion --null -f - -c "$@"
|
||||
}
|
||||
|
||||
# output functions
|
||||
msg() {
|
||||
[ -n "$quiet" ] && return 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user