From fbcf7d7188c0baa9fe4d1d7fc875bac2668058b1 Mon Sep 17 00:00:00 2001 From: kardel Date: Wed, 16 Jul 2008 20:53:56 +0000 Subject: [PATCH] make mkver fetch the date information from src/usr.sbin/ntp/importdate in order to achieve consistent version strings across all builds --- dist/ntp/ntp2netbsd | 15 ++++++++------- usr.sbin/ntp/importdate | 1 + usr.sbin/ntp/scripts/mkver | 17 +++++++++++++++++ 3 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 usr.sbin/ntp/importdate diff --git a/dist/ntp/ntp2netbsd b/dist/ntp/ntp2netbsd index 44d642b4ac07..4e9c97093667 100755 --- a/dist/ntp/ntp2netbsd +++ b/dist/ntp/ntp2netbsd @@ -1,6 +1,6 @@ #! /bin/sh # -# $NetBSD: ntp2netbsd,v 1.8 2008/07/16 11:11:37 perry Exp $ +# $NetBSD: ntp2netbsd,v 1.9 2008/07/16 20:53:56 kardel Exp $ # # Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. # All rights reserved. @@ -42,11 +42,11 @@ # $ cp config.h /usr/src/usr.sbin/ntp/include # - not really - we have some changed defaults and the vax port has no ieee.h support. # so do a careful diff and patch - Frank Kardel -# $ cp scripts/mkver /usr/src/usr.sbin/ntp/scripts -# Note you will have to edit mkver to remove date and -# build number information. -# Consult the old version on how this is done. -# This should possibly be automated in the future. +# $ echo cp scripts/mkver /usr/src/usr.sbin/ntp/scripts +# merge possible changes to mkver +# our version uses the import date in the file +# /usr/src/usr.sbin/ntp/importdate for the date and buildnumber information +# to achieve consistent version string over all builds # $ cd .. # $ rm -r src ntp-4.x.y # $ cd /usr/src/usr.sbin/ntp @@ -56,7 +56,8 @@ # esp. libntp and ntpd. # - check for and remove img tags in html docs. # - update distrib/sets if necessary. - +# - update src/usr.sbin/ntp/importdate to match the date of this import +# if [ $# -ne 2 ]; then echo "ntp2netbsd src dest"; exit 1; fi r=$1 diff --git a/usr.sbin/ntp/importdate b/usr.sbin/ntp/importdate new file mode 100644 index 000000000000..a85884d63cdd --- /dev/null +++ b/usr.sbin/ntp/importdate @@ -0,0 +1 @@ +Sun Jun 24 16:55:11 GMT 2007 (import) diff --git a/usr.sbin/ntp/scripts/mkver b/usr.sbin/ntp/scripts/mkver index 39ea4e5276fb..e9520dfb5430 100755 --- a/usr.sbin/ntp/scripts/mkver +++ b/usr.sbin/ntp/scripts/mkver @@ -17,6 +17,23 @@ case "-lcrypto" in *) ConfStr="${ConfStr}-?" ;; esac +ifile="`dirname $0`/../importdate" + +if [ -f "$ifile" ]; then + ConfStr="$ConfStr "`cat "$ifile"` +else + ConfStr="$ConfStr `LC_TIME=C TZ= date`" + + if [ ! -f .version ]; then + echo 0 > .version + fi + RUN="`cat .version`" + RUN="`expr $RUN + 1`" + echo $RUN > .version + + ConfStr="$ConfStr (${RUN})" +fi + echo "Version <${ConfStr}>"; rm -f version.c