mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-13 18:50:31 +00:00
abuild: make built package reproducible
Flags to make the tarball reproducible is taken from here: http://h2.jaguarpaw.co.uk/posts/reproducible-tar/
This commit is contained in:
parent
672032a4be
commit
f04a2ee34b
14
abuild.in
14
abuild.in
@ -1565,7 +1565,11 @@ create_apks() {
|
|||||||
# normalize timestamps
|
# normalize timestamps
|
||||||
find . -exec touch -h -d "@$SOURCE_DATE_EPOCH" {} +
|
find . -exec touch -h -d "@$SOURCE_DATE_EPOCH" {} +
|
||||||
|
|
||||||
tar --xattrs -f - -c "$@" | abuild-tar --hash | $gzip -9 >"$dir"/data.tar.gz
|
tar --xattrs \
|
||||||
|
--format=posix \
|
||||||
|
--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime,delete=mtime \
|
||||||
|
--mtime="@${SOURCE_DATE_EPOCH}" \
|
||||||
|
-f - -c "$@" | abuild-tar --hash | $gzip -n -9 >"$dir"/data.tar.gz
|
||||||
|
|
||||||
msg "Create checksum..."
|
msg "Create checksum..."
|
||||||
# append the hash for data.tar.gz
|
# append the hash for data.tar.gz
|
||||||
@ -1575,8 +1579,12 @@ create_apks() {
|
|||||||
|
|
||||||
# control.tar.gz
|
# control.tar.gz
|
||||||
cd "$dir"
|
cd "$dir"
|
||||||
tar -f - -c $(cat "$dir"/.metafiles) | abuild-tar --cut \
|
tar \
|
||||||
| $gzip -9 > control.tar.gz
|
--format=posix \
|
||||||
|
--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime,delete=mtime \
|
||||||
|
--mtime="@${SOURCE_DATE_EPOCH}" \
|
||||||
|
-f - -c $(cat "$dir"/.metafiles) | abuild-tar --cut \
|
||||||
|
| $gzip -n -9 > control.tar.gz
|
||||||
abuild-sign -q control.tar.gz || exit 1
|
abuild-sign -q control.tar.gz || exit 1
|
||||||
|
|
||||||
msg "Create $apk"
|
msg "Create $apk"
|
||||||
|
Loading…
Reference in New Issue
Block a user