Make gzip-1.2.4 and tar-1.12 not include timestamps

There is no way for gzip 1.2.4 and tar 1.12 to disable the inclusion of
timestamps into the tarball/gzip, which creates non-reproducible
tarballs and hence packages.

While it is theoretically possible to set the timestamps to unix time 0
using touch, in reality this is not possible because mes libc does not
support utime() which sets the timestamp of a file from userspace. So we
need to ignore it rather than (re)set it.
This commit is contained in:
fosslinux 2022-01-14 16:24:39 +11:00
parent 634ec99771
commit 016b9511d2
6 changed files with 71 additions and 2 deletions

View file

@ -11,11 +11,18 @@ set -ex
mkdir build
cd build
catm gzip.c.new ../../files/stat_override.c gzip.c
cp gzip.c.new gzip.c
# Extract
ungz ../src/${pkg}.tar.gz
untar ../src/${pkg}.tar
cd ${pkg}
# Prepare
catm gzip.c.new ../../files/stat_override.c gzip.c
cp gzip.c.new gzip.c
# Compile
tcc -c -DNO_UTIME gzip.c
tcc -c bits.c