[oe-commits] [meta-openembedded] 57/73: ntp: Reproducible build: Respect SOURCE_DATE_EPOCH

git at git.openembedded.org git at git.openembedded.org
Sun Nov 25 20:56:08 UTC 2018


This is an automated email from the git hooks/post-receive script.

armin_kuster pushed a commit to branch thud-next
in repository meta-openembedded.

commit 37e061519c9c5c26567de976ce82c0719fc3ce29
Author: douglas.royds <douglas.royds at taitradio.com>
AuthorDate: Tue Nov 13 18:08:34 2018 +1300

    ntp: Reproducible build: Respect SOURCE_DATE_EPOCH
    
    If a SOURCE_DATE_EPOCH is set in the environment, use that date in the build
    version string, otherwise use the current build date.
    See https://reproducible-builds.org/docs/source-date-epoch/
    
    Should GNU date options fail, try BSD date options as a fall-back.
    This patch can potentially be pushed upstream for use on Mac OSX or OpenBSD,
    though it has not been tested on OSX or any BSD platform.
    
    Upstream-Status: Submitted http://bugs.ntp.org/show_bug.cgi?id=3550
    Signed-off-by: Douglas Royds <douglas.royds at taitradio.com>
    Signed-off-by: Khem Raj <raj.khem at gmail.com>
    Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
 .../ntp/reproducibility-respect-source-date-epoch.patch  | 16 ++++++++++++++++
 meta-networking/recipes-support/ntp/ntp_4.2.8p12.bb      |  1 +
 2 files changed, 17 insertions(+)

diff --git a/meta-networking/recipes-support/ntp/ntp/reproducibility-respect-source-date-epoch.patch b/meta-networking/recipes-support/ntp/ntp/reproducibility-respect-source-date-epoch.patch
new file mode 100644
index 0000000..58e71c3
--- /dev/null
+++ b/meta-networking/recipes-support/ntp/ntp/reproducibility-respect-source-date-epoch.patch
@@ -0,0 +1,16 @@
+--- ntp-4.2.8p12.original/scripts/build/mkver.in	2018-11-12 14:06:49.333020430 +1300
++++ ntp-4.2.8p12/scripts/build/mkver.in	2018-11-12 14:15:04.947480167 +1300
+@@ -15,7 +15,12 @@
+  *) ConfStr="${ConfStr}- at VER_SUFFIX@" ;;
+ esac
+ 
+-ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`"
++if [ -n "$SOURCE_DATE_EPOCH" ]; then
++   ConfStr="$ConfStr `LC_TIME=C TZ=UTC date -d@$SOURCE_DATE_EPOCH 2>/dev/null`" ||
++   ConfStr="$ConfStr `LC_TIME=C TZ=UTC date -r $SOURCE_DATE_EPOCH`"
++else
++   ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`"
++fi
+ 
+ if [ ! -f .version ]; then
+   echo 0 > .version
diff --git a/meta-networking/recipes-support/ntp/ntp_4.2.8p12.bb b/meta-networking/recipes-support/ntp/ntp_4.2.8p12.bb
index 4254301..536679f 100644
--- a/meta-networking/recipes-support/ntp/ntp_4.2.8p12.bb
+++ b/meta-networking/recipes-support/ntp/ntp_4.2.8p12.bb
@@ -12,6 +12,7 @@ DEPENDS = "libevent"
 
 SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \
            file://ntp-4.2.4_p6-nano.patch \
+           file://reproducibility-respect-source-date-epoch.patch \
            file://ntpd \
            file://ntp.conf \
            file://ntpdate \

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list