From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2124) id AFF483858D37; Mon, 10 Oct 2022 10:29:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AFF483858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665397760; bh=i8eH5+p9BSMmRz2sbO8qkjfM7NblOCA0BaU15B+oohg=; h=From:To:Subject:Date:From; b=Fs2ZAkN4Tf1O/wJd69DKqVJzCVNHhDIBLaJH6AbLMAaGXGVdR/+27BBYVYseY2fnp LFOCrB7rxB1tYnek6VzEU6kbN9AwxGjT8qyhVl4CFUFxop2ecgfk8MTPxzeHjp5JOS eJ8aeEoQsUs7lKUBsJjLutQ5qSQ+yyCjeOHBkh9E= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Nick Clifton To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org Subject: [binutils-gdb] Add ability to create reproducible source tarballs. X-Act-Checkin: binutils-gdb X-Git-Author: Nick Clifton X-Git-Refname: refs/heads/master X-Git-Oldrev: c29a6445a981cee5e8eebe3617ef5c049fd3409f X-Git-Newrev: f54c53e9f4e01ba19a2b3a664fee42798b60e38a Message-Id: <20221010102920.AFF483858D37@sourceware.org> Date: Mon, 10 Oct 2022 10:29:20 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df54c53e9f4e0= 1ba19a2b3a664fee42798b60e38a commit f54c53e9f4e01ba19a2b3a664fee42798b60e38a Author: Nick Clifton Date: Mon Oct 10 11:28:45 2022 +0100 Add ability to create reproducible source tarballs. =20 * src-release.sh: Add "-r " option to create reproducible tarballs based upon a fixed timestamp of . * binutils/README-how-to-make-a-release: Add a line showing how= to use -r when creating a binutils release. Diff: --- ChangeLog | 7 +++++++ binutils/README-how-to-make-a-release | 4 ++++ src-release.sh | 20 ++++++++++++++++---- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 927e0eed7d8..73c3a006881 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2022-10-10 Nick Clifton + + * src-release.sh: Add "-r " option to create reproducible + tarballs based upon a fixed timestamp of . + * binutils/README-how-to-make-a-release: Add a line showing how to + use -r when creating a binutils release. + 2022-10-04 Nick Clifton =20 * README-maintainer-mode: Add a minimum version of dejagnu diff --git a/binutils/README-how-to-make-a-release b/binutils/README-how-to= -make-a-release index 9fcebf5f0a4..3d7f6cec414 100644 --- a/binutils/README-how-to-make-a-release +++ b/binutils/README-how-to-make-a-release @@ -251,6 +251,10 @@ When the time comes to actually make the release.... =20 ./src-release.sh -b -g -l -x binutils =20 + OR ... for a more reproducible tarball: + + ./src-release.sh -b -g -l -x -r `git log -1 --format=3D%cd --d= ate=3Dformat:%F bfd/version.m4` binutils + 24. Check that the files in the tarballs have the correct permissions. =20 diff --git a/src-release.sh b/src-release.sh index 079b545ae7c..76c355a583c 100755 --- a/src-release.sh +++ b/src-release.sh @@ -30,6 +30,7 @@ SHA256PROG=3Dsha256sum MAKE=3Dmake CC=3Dgcc CXX=3Dg++ +release_date=3D =20 # Default to avoid splitting info files by setting the threshold high. MAKEINFOFLAGS=3D--split-size=3D5000000 @@ -184,9 +185,17 @@ do_tar() ver=3D$2 echo "=3D=3D> 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 + if test x$release_date =3D=3D "x" ; then + find $package-$ver -follow \( $CVS_NAMES \) -prune -o -type f -prin= t \ + | tar cTfh - $package-$ver.tar + else + # Attempt to create a consistent, reproducible tarball using the + # specified date. + find $package-$ver -follow \( $CVS_NAMES \) -prune -o -type f -print \ + | LC_ALL=3DC sort \ + | tar cTfh - $package-$ver.tar \ + --mtime=3D$release_date --group=3D0 --owner=3D0 + fi } =20 # Compress the output with bzip2 @@ -340,6 +349,7 @@ usage() echo " -g: Compress with gzip" echo " -l: Compress with lzip" echo " -x: Compress with xz" + echo " -r : Create a reproducible tarball using as the m= time" exit 1 } =20 @@ -363,7 +373,7 @@ build_release() =20 compressors=3D"" =20 -while getopts ":bglx" opt; do +while getopts ":bglr:x" opt; do case $opt in b) compressors=3D"$compressors bz2";; @@ -371,6 +381,8 @@ while getopts ":bglx" opt; do compressors=3D"$compressors gz";; l) compressors=3D"$compressors lz";; + r) + release_date=3D$OPTARG;; x) compressors=3D"$compressors xz";; \?)