nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [nmh-workers] Reproducible build patch


From: valdis . kletnieks
Subject: Re: [nmh-workers] Reproducible build patch
Date: Tue, 24 Jul 2018 18:53:49 -0400

On Tue, 24 Jul 2018 16:40:48 +0100, Ralph Corderoy said:

> How about

>     +fmt='%Y-%m-%d %T %z'
>     +now=${SOURCE_DATE_EPOCH-$(date +%s)}
>     +if date -u -d @42 +"$fmt" >/dev/null 2>&1; then   # Coreutils.
>     +    date=$(date -u -d "@$now" +"$fmt")
>     +elif date -u -r 42 +"$fmt" >/dev/null 2>&1; then   # BSD.
>     +    date=$(date -u -r "$now" +"$fmt")
>     +else   # Posix, ignoring SOURCE_DATE_EPOCH.
>     +    date=$(date -u +"$fmt")
>     +fi

Oh, much better than that date || date || date monstrosity - I was
unable to figure out that the second one was intended for a different
date binary than the first one

Attachment: pgp61_4wKJi09.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]