From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 05AEF3858D38; Mon, 3 Oct 2022 19:56:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 05AEF3858D38 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0730F218A2; Mon, 3 Oct 2022 19:56:27 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 942801332F; Mon, 3 Oct 2022 19:56:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UifHIWo+O2M3WAAAMHmgww (envelope-from ); Mon, 03 Oct 2022 19:56:26 +0000 From: Andreas Schwab To: Nick Clifton Cc: Jan Beulich , Sam James , Binutils , Nick Clifton via Gdb-patches , Tzvetelin Katchov Subject: Re: RFC: Sort tarballs created by the src-release.sh script References: <07a1ca21-5569-e67b-d0c7-6069974b1068@redhat.com> <3EC98FFD-FD7A-4A17-9FE0-EF5DAFB36B3C@gentoo.org> <1e772307-1f10-6e1c-5ffb-8513a41db5ab@redhat.com> X-Yow: Civilization is fun! Anyway, it keeps me busy!! Date: Mon, 03 Oct 2022 21:56:25 +0200 In-Reply-To: <1e772307-1f10-6e1c-5ffb-8513a41db5ab@redhat.com> (Nick Clifton's message of "Mon, 3 Oct 2022 15:40:03 +0100") Message-ID: <875yh0heae.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2022 19:56:30 -0000 On Okt 03 2022, Nick Clifton wrote: > We could use the src-release.sh file itself, like this: The timestamp of checked out files has no meaning, and is generally not reproducible. > diff --git a/src-release.sh b/src-release.sh > index 079b545ae7c..de1f98a70bb 100755 > --- a/src-release.sh > +++ b/src-release.sh > @@ -184,9 +184,15 @@ do_tar() > ver=$2 > echo "==> Making $package-$ver.tar" > rm -f $package-$ver.tar > + # The sort command and --mtime, --group and --owner options are > + # used in order to create consistent, reproducible tarballs. > + # BUILD_DATE is set to SOURCE_DATE_EPOCH if defined, or the > + # modification date of this file otherwise. cf: > + # https://reproducible-builds.org/docs/source-date-epoch/ > + BUILD_DATE="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date -r src-release.sh +%s)}" +%Y-%m-%d)" > 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=$BUILD_DATE --group=0 --owner=0 That won't work, as --mtime=$BUILD_DATE is interpreted in the local time zone. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."