[PATCH] s3:build_env.sh: allow to override build date
Andrew Bartlett
abartlet at samba.org
Mon Jun 26 09:10:36 UTC 2017
On Mon, 2017-06-26 at 10:03 +0200, Bernhard M. Wiedemann via samba-
technical wrote:
> and build host, kernel-version and user
> to enable reproducible builds of samba packages
>
> The date calls are designed to work with both GNU date and BSD date.
>
> See https://reproducible-builds.org/ for why this is good
> and https://reproducible-builds.org/specs/source-date-epoch/
> for the definition of this variable.
>
> Signed-off-by: Bernhard M. Wiedemann <bwiedemann at suse.de>
> ---
> source3/script/build_env.sh | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/source3/script/build_env.sh b/source3/script/build_env.sh
> index eb54f37aeda..be5ae6b794f 100755
> --- a/source3/script/build_env.sh
> +++ b/source3/script/build_env.sh
> @@ -23,6 +23,12 @@ else
> fi
>
> host=`hostname`
> +if [ -n "$SOURCE_DATE_EPOCH" ] ; then
> + uname=reproducible
> + date=`date -u -d "@$SOURCE_DATE_EPOCH" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" 2>/dev/null || date -u`
> + host=reproducible
> + whoami=reproducible
> +fi
>
> cat <<EOF
> /* This file is automatically generated with "make include/build_env.h". DO NOT EDIT */
Thanks for trying to push this area of work upstream. In this case I
would frankly prefer we just removed the variables rather than promote
further complexity.
BTW, please do try and align an approach with the debian patches, seen
here:
https://anonscm.debian.org/cgit/pkg-samba/samba.git/tree/debian/patches/no_build_system.patch
https://anonscm.debian.org/cgit/pkg-samba/samba.git/tree/debian/patches/no_build_env.patch
Thanks!
Andrew Bartlett
--
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba
More information about the samba-technical
mailing list