On 2015-07-20, Paul Kocialkowski wrote:
> In order to achieve reproducible builds in U-Boot, timestamps that are defined
> at build-time have to be somewhat eliminated. The SOURCE_DATE_EPOCH 
> environment
> variable allows setting a fixed value for those timestamps.
...
> diff --git a/Makefile b/Makefile
> index 37cc4c3..71aeac7 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1231,9 +1231,10 @@ define filechk_version.h
>  endef
>  
>  define filechk_timestamp.h
> -     (LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
> -     LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
> -     LC_ALL=C date +'#define U_BOOT_TZ "%z"')
> +     (SOURCE_DATE="$${SOURCE_DATE_EPOCH:+@$$SOURCE_DATE_EPOCH}"; \
> +     LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_DATE "%b %d 
> %C%y"'; \
> +     LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_TIME "%T"'; 
> \
> +     LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_TZ "%z"' )
>  endef
>  
>  $(version_h): include/config/uboot.release FORCE

This does effectively hard-code U_BOOT_TZ to UTC; may as well not call
date for setting U_BOOT_TZ. Or conditionally set it to UTC only when
SOURCE_DATE_EPOCH is set?

Any reason not to use the longhand options for date, e.g. --utc and
--date ? They're more readable; are they less portable?


live well,
  vagrant

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to