[rb-general] using SOURCE_DATE_EPOCH with date

Ximin Luo infinity0 at debian.org
Wed Jan 4 18:34:00 CET 2017


Bernhard M. Wiedemann:
> Hi
> 
> what is the best way to use SOURCE_DATE_EPOCH with date?
> 
> I found
> date ${SOURCE_DATE_EPOCH/#/--date=}
> to be quite elegant, but it does not work with dash.
> 
> date --date=@${SOURCE_DATE_EPOCH:-$(date +%s)}
> does work with dash and bash, but is not as nice.
> 
> Also there are longer variants like
> https://github.com/jackaudio/jack2/pull/196/files
> 
> that would not look nice when used in Makefiles.
> Can you think of better ways than these?
> And which one(s) should we recommend for patches we send upstream?
> 

Hi Bernhard, see https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal#Reading_the_variable and feel free to edit this too.

I don't think there is a "nicer" way for shell than the 2nd one that you already found.

X

-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git


More information about the rb-general mailing list