public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Nick Clifton <nickc@redhat.com>
Cc: Jan Beulich <jbeulich@suse.com>,  Sam James <sam@gentoo.org>,
	 Binutils <binutils@sourceware.org>,
	 Nick Clifton via Gdb-patches <gdb-patches@sourceware.org>,
	 Tzvetelin Katchov <katchov@gnu.org>
Subject: Re: RFC: Sort tarballs created by the src-release.sh script
Date: Mon, 03 Oct 2022 21:56:25 +0200	[thread overview]
Message-ID: <875yh0heae.fsf@igel.home> (raw)
In-Reply-To: <1e772307-1f10-6e1c-5ffb-8513a41db5ab@redhat.com> (Nick Clifton's message of "Mon, 3 Oct 2022 15:40:03 +0100")

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."

  reply	other threads:[~2022-10-03 19:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 12:59 Nick Clifton
2022-09-28 13:05 ` Andreas Schwab
2022-09-28 13:34   ` Nick Clifton
2022-09-29 12:24     ` Nick Clifton
2022-09-29 12:36       ` Jan Beulich
2022-09-30 11:38         ` Nick Clifton
2022-10-02  7:54           ` Sam James
2022-10-02  7:54             ` Sam James
2022-10-03  6:55             ` Jan Beulich
2022-10-03  6:59               ` Sam James
2022-10-03  7:41                 ` Andreas Schwab
2022-10-03 14:40               ` Nick Clifton
2022-10-03 19:56                 ` Andreas Schwab [this message]
2022-10-04  7:10                 ` Jan Beulich
2022-10-05 12:23                   ` Nick Clifton
2022-10-05 13:00                     ` Jan Beulich
2022-10-03  7:47             ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875yh0heae.fsf@igel.home \
    --to=schwab@suse.de \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jbeulich@suse.com \
    --cc=katchov@gnu.org \
    --cc=nickc@redhat.com \
    --cc=sam@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).