Re: RFC: Sort tarballs created by the src-release.sh script

Nick Clifton via Gdb-patches
2022-09-29T12:24:45Z

Hi Guys,

Thinking about this a little more last night, it occurred to me that if
we want reproducible tarballs then we should not be storing user names,
group names or modification times either. So what do you think about
this extended version of the patch:

diff --git a/src-release.sh b/src-release.sh
index 079b545ae7c..908492c28f7 100755
--- a/src-release.sh
+++ b/src-release.sh
@@ -185,8 +185,8 @@ do_tar()
echo "==> Making $package-$ver.tar"
rm -f $package-$ver.tar
find $package-$ver -follow \( $CVS_NAMES \) -prune \
- -o -type f -print \
- | tar cTfh - $package-$ver.tar
+ -o -type f -print | LC_ALL=C sort \
+ | tar cTfh - $package-$ver.tar --mtime=0 --group=0 --owner=0
}

# Compress the output with bzip2

Cheers
Nick