From: Evgeni Golov Date: Tue, 12 Apr 2016 17:20:10 +0000 (+0200) Subject: nicer date format and support for SOURCE_DATE_EPOCH in LXC_GENERATE_DATE X-Git-Tag: lxc-2.1.0~450^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F966%2Fhead;p=thirdparty%2Flxc.git nicer date format and support for SOURCE_DATE_EPOCH in LXC_GENERATE_DATE Using $(date) for LXC_GENERATE_DATE has various flaws: * formating depends on the locale of the system we execute configure on * the output is not really a date but more a timestamp Let's use $(date --utc '+%Y-%m-%d') instead. While at it, also support SOURCE_DATE_EPOCH [1] to make the build reproducible [1] https://reproducible-builds.org/specs/source-date-epoch/ Signed-off-by: Evgeni Golov --- diff --git a/configure.ac b/configure.ac index 84f8699ae..9475b0ed2 100644 --- a/configure.ac +++ b/configure.ac @@ -545,7 +545,7 @@ AS_AC_EXPAND(LXC_DEFAULT_CONFIG, "$sysconfdir/lxc/default.conf") AS_AC_EXPAND(DATADIR, "$datadir") AS_AC_EXPAND(LOCALSTATEDIR, "$localstatedir") AS_AC_EXPAND(DOCDIR, "$docdir") -AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)") +AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date --utc --date=@${SOURCE_DATE_EPOCH:-$(date +%s)} '+%Y-%m-%d')") AS_AC_EXPAND(LXCPATH, "$with_config_path") AS_AC_EXPAND(LXC_GLOBAL_CONF, "$with_global_conf") AS_AC_EXPAND(LXC_USERNIC_CONF, "$with_usernic_conf")