Module Name:    src
Committed By:   apb
Date:           Wed Jan 15 14:40:30 UTC 2014

Modified Files:
        src/external/bsd/ntp/dist/libntp: ntp_calendar.c
        src/external/bsd/ntp/lib/libntp: Makefile

Log Message:
For MKREPRO, instead of using __DATE__ and __TIME__
in ntp_calendar.c::ntpcal_get_build_date(), use a date/time
extracted from the importdate file.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/libntp/ntp_calendar.c
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/ntp/lib/libntp/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/ntp_calendar.c
diff -u src/external/bsd/ntp/dist/libntp/ntp_calendar.c:1.2 src/external/bsd/ntp/dist/libntp/ntp_calendar.c:1.3
--- src/external/bsd/ntp/dist/libntp/ntp_calendar.c:1.2	Sat Dec 28 03:20:13 2013
+++ src/external/bsd/ntp/dist/libntp/ntp_calendar.c	Wed Jan 15 14:40:30 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_calendar.c,v 1.2 2013/12/28 03:20:13 christos Exp $	*/
+/*	$NetBSD: ntp_calendar.c,v 1.3 2014/01/15 14:40:30 apb Exp $	*/
 
 /*
  * ntp_calendar.c - calendar and helper functions
@@ -155,7 +155,11 @@ ntpcal_get_build_date(
 	 * problem.
 	 *
 	 */
+#ifdef MKREPRO_DATE
+	static const char build[] = MKREPRO_TIME "/" MKREPRO_DATE;
+#else
 	static const char build[] = __TIME__ "/" __DATE__;
+#endif
 	static const char mlist[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
 	char		  monstr[4];
 	const char *	  cp;

Index: src/external/bsd/ntp/lib/libntp/Makefile
diff -u src/external/bsd/ntp/lib/libntp/Makefile:1.7 src/external/bsd/ntp/lib/libntp/Makefile:1.8
--- src/external/bsd/ntp/lib/libntp/Makefile:1.7	Thu Jan  2 21:38:38 2014
+++ src/external/bsd/ntp/lib/libntp/Makefile	Wed Jan 15 14:40:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2014/01/02 21:38:38 joerg Exp $
+#	$NetBSD: Makefile,v 1.8 2014/01/15 14:40:30 apb Exp $
 
 LIBISPRIVATE=yes
 
@@ -79,4 +79,20 @@ CPPFLAGS+= -I${IDIST}/sntp/libopts
 
 COPTS.msyslog.c+=	-Wno-error=format-nonliteral
 
+# For MKREPRO, avoid using __DATE__ and __TIME__.
+# Instead, use the date and time from ${IMPORTDATE_FILE}.
+#
+# The file should contain one line, like this:
+#	Fri Dec 27 19:28:17 EST 2013 (import)
+#
+.if ${MKREPRO} == "yes"
+IMPORTDATE_FILE := ${.PARSEDIR}/../../importdate
+MKREPRO_DATE != ${TOOL_AWK} '{printf "%3s %2d %4d", $2, $3, $6}' \
+	<${IMPORTDATE_FILE} # "Mmm DD YYYY"
+MKREPRO_TIME != ${TOOL_AWK} '{print $4}' \
+	<${IMPORTDATE_FILE} # "HH:MM:SS"
+CPPFLAGS.ntp_calendar.c += -DMKREPRO_DATE=\"${MKREPRO_DATE:Q}\"
+CPPFLAGS.ntp_calendar.c += -DMKREPRO_TIME=\"${MKREPRO_TIME:Q}\"
+.endif
+
 .include <bsd.lib.mk>

Reply via email to