diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.am | 44 | ||||
-rw-r--r-- | scripts/Makefile.in | 135 | ||||
-rwxr-xr-x | scripts/UpdatePoint | 331 | ||||
-rwxr-xr-x | scripts/VersionName | 50 | ||||
-rwxr-xr-x | scripts/check--help | 22 | ||||
-rwxr-xr-x | scripts/checkChangeLog | 29 | ||||
-rwxr-xr-x | scripts/cvo.sh | 150 | ||||
-rwxr-xr-x | scripts/genCommitLog | 13 | ||||
-rwxr-xr-x | scripts/genver | 23 | ||||
-rwxr-xr-x | scripts/html2man.in | 136 | ||||
-rw-r--r-- | scripts/mkver.in | 2 | ||||
-rw-r--r-- | scripts/ntp-wait.in | 34 | ||||
-rwxr-xr-x | scripts/ntptrace.in | 1 |
13 files changed, 873 insertions, 97 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 76d7655..017ea02 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,5 +1,39 @@ -bin_SCRIPTS= ntp-wait ntptrace -noinst_SCRIPTS= calc_tickadj checktime freq_adj html2man mkver ntpsweep ntpver plot_summary summary -EXTRA_DIST = VersionName fixautomakedepsmagic genCommitLog genver \ - hpadjtime.sh monitoring ntp-close ntp-groper ntp-restart \ - ntp-status rc1 rc2 stats +NULL= + +if NTP_BINSUBDIR_IS_BIN +bin_SCRIPTS = ntp-wait ntptrace +else +sbin_SCRIPTS = ntp-wait ntptrace +endif + +noinst_SCRIPTS = \ + calc_tickadj \ + checktime \ + freq_adj \ + html2man \ + mkver \ + ntpsweep \ + ntpver \ + plot_summary \ + summary \ + $(NULL) + +EXTRA_DIST = \ + check--help \ + checkChangeLog \ + cvo.sh \ + fixautomakedepsmagic \ + genCommitLog \ + genver \ + hpadjtime.sh \ + monitoring \ + ntp-close \ + ntp-groper \ + ntp-restart \ + ntp-status \ + rc1 \ + rc2 \ + stats \ + UpdatePoint \ + VersionName \ + $(NULL) diff --git a/scripts/Makefile.in b/scripts/Makefile.in index 8577e77..e41f06c 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -42,9 +42,15 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/ntptrace.in $(srcdir)/ntpver.in \ $(srcdir)/plot_summary.in $(srcdir)/summary.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ - $(top_srcdir)/m4/define_dir.m4 \ - $(top_srcdir)/m4/hs_ulong_const.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ + $(top_srcdir)/m4/define_dir.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/ntp_cacheversion.m4 \ + $(top_srcdir)/m4/ntp_dir_sep.m4 \ + $(top_srcdir)/m4/ntp_lineeditlibs.m4 \ + $(top_srcdir)/m4/ntp_openssl.m4 \ + $(top_srcdir)/m4/ntp_vpathhack.m4 \ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -75,15 +81,14 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(bindir)" -SCRIPTS = $(bin_SCRIPTS) $(noinst_SCRIPTS) +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" +SCRIPTS = $(bin_SCRIPTS) $(noinst_SCRIPTS) $(sbin_SCRIPTS) SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ -ARLIB_DIR = @ARLIB_DIR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -100,14 +105,18 @@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -ECHO = @ECHO@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ +EDITLINE_LIBS = @EDITLINE_LIBS@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FGREP = @FGREP@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ INSTALL = @INSTALL@ @@ -116,6 +125,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ @@ -124,6 +134,7 @@ LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBPARSE = @LIBPARSE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ LN_S = @LN_S@ LSCF = @LSCF@ LTLIBOBJS = @LTLIBOBJS@ @@ -135,15 +146,22 @@ MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@ MAKE_LIBPARSE = @MAKE_LIBPARSE@ MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@ MAKE_NTPDSIM = @MAKE_NTPDSIM@ +MAKE_NTPSNMPD = @MAKE_NTPSNMPD@ MAKE_NTPTIME = @MAKE_NTPTIME@ MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@ MAKE_TICKADJ = @MAKE_TICKADJ@ MAKE_TIMETRIM = @MAKE_TIMETRIM@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -151,23 +169,32 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@ PATH_PERL = @PATH_PERL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PATH_SH = @PATH_SH@ +PATH_TEST = @PATH_TEST@ +POSIX_SHELL = @POSIX_SHELL@ PROPDELAY = @PROPDELAY@ RANLIB = @RANLIB@ -READLINE_LIBS = @READLINE_LIBS@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SNMP_CFLAGS = @SNMP_CFLAGS@ +SNMP_CPPFLAGS = @SNMP_CPPFLAGS@ +SNMP_LIBS = @SNMP_LIBS@ STRIP = @STRIP@ TESTDCF = @TESTDCF@ -U = @U@ VERSION = @VERSION@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -214,11 +241,40 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -bin_SCRIPTS = ntp-wait ntptrace -noinst_SCRIPTS = calc_tickadj checktime freq_adj html2man mkver ntpsweep ntpver plot_summary summary -EXTRA_DIST = VersionName fixautomakedepsmagic genCommitLog genver \ - hpadjtime.sh monitoring ntp-close ntp-groper ntp-restart \ - ntp-status rc1 rc2 stats +NULL = +@NTP_BINSUBDIR_IS_BIN_TRUE@bin_SCRIPTS = ntp-wait ntptrace +@NTP_BINSUBDIR_IS_BIN_FALSE@sbin_SCRIPTS = ntp-wait ntptrace +noinst_SCRIPTS = \ + calc_tickadj \ + checktime \ + freq_adj \ + html2man \ + mkver \ + ntpsweep \ + ntpver \ + plot_summary \ + summary \ + $(NULL) + +EXTRA_DIST = \ + check--help \ + checkChangeLog \ + cvo.sh \ + fixautomakedepsmagic \ + genCommitLog \ + genver \ + hpadjtime.sh \ + monitoring \ + ntp-close \ + ntp-groper \ + ntp-restart \ + ntp-status \ + rc1 \ + rc2 \ + stats \ + UpdatePoint \ + VersionName \ + $(NULL) all: all-am @@ -309,6 +365,40 @@ uninstall-binSCRIPTS: test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files +install-sbinSCRIPTS: $(sbin_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" + @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-sbinSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(sbindir)" && rm -f $$files mostlyclean-libtool: -rm -f *.lo @@ -356,7 +446,7 @@ check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -410,7 +500,7 @@ install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binSCRIPTS +install-exec-am: install-binSCRIPTS install-sbinSCRIPTS install-html: install-html-am @@ -448,7 +538,7 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binSCRIPTS +uninstall-am: uninstall-binSCRIPTS uninstall-sbinSCRIPTS .MAKE: install-am install-strip @@ -459,10 +549,11 @@ uninstall-am: uninstall-binSCRIPTS install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am uninstall-binSCRIPTS + install-sbinSCRIPTS install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am uninstall uninstall-am uninstall-binSCRIPTS \ + uninstall-sbinSCRIPTS # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/scripts/UpdatePoint b/scripts/UpdatePoint new file mode 100755 index 0000000..309cdcc --- /dev/null +++ b/scripts/UpdatePoint @@ -0,0 +1,331 @@ +#! /bin/sh + +# showusage is set to 1 on any command-line syntax error +showusage=0 +# are we playing by stable or dev rules? +repo= +# test is set to 1 if -t/--test is given to prevent modifications +test=0 + +case "$#" in + 1) repo=$1 + ;; + 2) repo=$2 + case $1 in + -t|--test) + test=1 + ;; + *) + showusage=1 + ;; + esac + ;; + *) showusage=1 + ;; +esac + +case "$repo" in + dev|stable) + ;; + '') + showusage=1 + ;; + *) echo "Unexpected repo type: <$repo>!" + showusage=1 + ;; +esac + +case "$showusage" in + 1) echo "Usage: $0 [-t] <stable|dev>" + echo "No changes are made to packageinfo.sh if -t is given." + exit 1 + ;; +esac + + +set -e + +. ./packageinfo.sh + +case "$repotype" in + $repo) + ;; + *) echo "You indicated repo type <$repo> but packageinfo.sh" + echo "indicates <$repotype>." + exit 1 + ;; +esac + +ver_repo_mismatch=1 + +case "$minor" in + 1|3|5|7|9) + case "$repo" in + dev) + ver_repo_mismatch=0 + ;; + stable) + ;; + esac + ;; + 0|2|4|6|8) + case "$repo" in + dev) + ;; + stable) + ver_repo_mismatch=0 + ;; + esac + ;; +esac + +case "$ver_repo_mismatch" in + 1) echo "Minor version <$minor> mismatches repotype <$repo>." + exit 1 + ;; +esac + +# Do we want to bump the point? +bp=1 +# Do we want to bump the beta point? +bbp=0 +# Do we want to change the RC point? (n=no, z=empty rcpoint and zero +# betapoint, i=incr) +crcp=n +# Do we want to change the prerelease value? +setpr=0 + +# for stable: +# if we are not in a beta or RC state, enter beta unless point is NEW. +# if we are in a beta state: +# - bump the beta point +# else if we are in an RC state: +# - if rcpoint is GO: +# - - set rcpoint= (empty) +# - - set prerelease= (empty) +# - - set betapoint=0 +# - else +# - - if rcpoint==(empty) +# - - - (bump-point) and set rcpoint to 0 (and fall thru, so -RC1 is first) +# - - bump the RC point + +# for dev, we only want to bump-point and possibly clear prerelease, +# but we do not modify rcpoint nor betapoint. + +case "$repo" in + dev) + case "$point" in + [Nn][Ee][Ww]) + crcp=z + ;; + *) + # crcp=n + ;; + esac + # bp=1 + ;; + stable) + case "$prerelease" in + '') + case "$betapoint::$rcpoint::$point" in + *::*::NEW) + # new minor release (no p) + crcp=z + # bp=1 + ;; + 0::::*) + # start of first beta cycle for the next point release + setpr=1 + newpr=beta + # bp=1 + bbp=1 + ;; + 0::[Gg][Oo]::*) + # skip all -beta and -RC prereleases to the next point. + crcp=z + setpr=1 + newpr= + # bp=1 + # bbp=0 + ;; + *) echo "betapoint is <$betapoint>, rcpoint is <$rcpoint>" + echo "betapoint must be 0 and rcpoint must be empty to start the" + echo "beta cycle." + exit 1 + ;; + esac + ;; + beta) + case "$betapoint::$rcpoint" in + [1-9]*::*) + bp=0 + bbp=1 + ;; + 0::) echo "betapoint is 0, rcpoint emtpy, and prerelease is beta." + echo "You probably intended prerelease= (that is, empty). It" + echo "will then be changed to beta by this script, starting the" + echo "first beta for the next point release." + exit 1 + ;; + *) + bp=0 + bbp=1 + ;; + esac + case "$rcpoint" in + [Gg][Oo]) + echo "prerelease is beta, rcpoint is GO, disallowed." + echo "rcpoint GO is allowed only when prerelease is RC or empty." + exit 1 + ;; + esac + ;; + rc|RC) + case "$rcpoint" in + '') + case "$betapoint" in + 0) # bp=1 + ;; + *) bp=0 + ;; + esac + crcp=i + ;; + [1-9]*) + bp=0 + crcp=i + ;; + [Gg][Oo]) + bp=0 + crcp=z + setpr=1 + newpr= + ;; + *) echo "Unexpected value for 'rcpoint' <$rcpoint>!" + exit 1 + ;; + esac + ;; + *) + echo "prerelease <$prerelease> unexpected" + exit 1 + ;; + esac + ;; + *) echo "impossible: repo <$repo>!" + exit 1 + ;; +esac + +case "$bp::$point" in + 0::*) + newpoint=$point + ;; + 1::[1-9]*) + newpoint=`expr $point + 1` + ;; + 1::) + newpoint=1 + ;; + 1::[Nn][Ee][Ww]) + newpoint= + ;; + *) echo "Unexpected value for 'point' <$point>!" + exit 1 + ;; +esac + +case "$bbp::$betapoint" in + 0::*) + newbetapoint=$betapoint + ;; + 1::[0-9]*) + newbetapoint=`expr $betapoint + 1` + ;; + *) echo "Unexpected value for 'betapoint' <$betapoint>!" + exit 1 + ;; +esac + +case "$crcp::$rcpoint" in + n::*) + newrcpoint=$rcpoint + ;; + i::) + newrcpoint=1 + ;; + i::[0-9]*) + newrcpoint=`expr $rcpoint + 1` + ;; + z::*) + newrcpoint= + newbetapoint=0 + ;; + *) echo "Unexpected value for 'crcp::rcpoint' <$crcp::$rcpoint>!" + exit 1 + ;; +esac + +case "$setpr" in + 0) + newpr=$prerelease +esac + +# display results +printf "prerelease $prerelease" +case "$newpr" in + $prerelease) + printf "\n" + ;; + *) printf " -> $newpr\n" + ;; +esac +printf "point $point" +case "$newpoint" in + $point) + printf "\n" + ;; + *) printf " -> $newpoint\n" + ;; +esac +printf "betapoint $betapoint" +case "$newbetapoint" in + $betapoint) + printf "\n" + ;; + *) printf " -> $newbetapoint\n" + ;; +esac +printf "rcpoint $rcpoint" +case "$newrcpoint" in + $rcpoint) + printf "\n" + ;; + *) printf " -> $newrcpoint\n" + ;; +esac + +printf "Previous version: " +scripts/VersionName + +# apply packageinfo.sh changes + +sed -e "s/^point=.*/point=$newpoint/" \ + -e "s/^betapoint=.*/betapoint=$newbetapoint/" \ + -e "s/^rcpoint=.*/rcpoint=$newrcpoint/" \ + -e "s/^prerelease=.*/prerelease=$newpr/" \ + < packageinfo.sh \ + > packageinfo.sh+ + +case "$test" in + 0) + mv packageinfo.sh+ packageinfo.sh + printf "Updated version: " + scripts/VersionName + ;; + *) + printf "Next version would be: " + scripts/VersionName -p ./packageinfo.sh+ + rm packageinfo.sh+ + ;; +esac diff --git a/scripts/VersionName b/scripts/VersionName index f601cc3..1030196 100755 --- a/scripts/VersionName +++ b/scripts/VersionName @@ -1,12 +1,27 @@ #! /bin/sh +packageinfo='./packageinfo.sh' +case "$#" in + 2) + case "$1" in + -p|--packageinfo) + packageinfo="$2" + esac + ;; + 0) + ;; + *) echo "Usage: $0 [-p packageinfo.sh]" + exit 1 + ;; +esac + # This script must be executed from the TLD of the source tree... -. ./packageinfo.sh +. "$packageinfo" NAME="$version" case $point in - [0-9]*) - NAME="${NAME}p$point" + [1-9]*) + NAME="${NAME}p${point}" ;; NEW) ;; '') ;; @@ -17,24 +32,23 @@ esac case $special in '') ;; - *) NAME="${NAME}-$special" ;; + *) NAME="${NAME}-${special}" ;; esac -case $releasecandidate in - [Nn][Oo]) ;; - [Yy][Ee][Ss]) NAME="${NAME}-RC" ;; - *) echo "Unexpected value for 'releasecandidate' <$releasecandidate>!" - exit 1 +case "$prerelease::$repotype" in + ''::*) ;; -esac - -case $repotype in - stable) - case $rcpoint in - [0-9]*) - NAME="${NAME}$rcpoint" - ;; - esac + beta::stable) + NAME="${NAME}-beta${betapoint}" + ;; + rc::dev|RC::dev) + NAME="${NAME}-RC" + ;; + rc::stable|RC::stable) + NAME="${NAME}-RC${rcpoint}" + ;; + *) echo "Unexpected value for 'prerelease::repotype' <$prerelease::$repotype>!" + exit 1 ;; esac diff --git a/scripts/check--help b/scripts/check--help new file mode 100755 index 0000000..1524675 --- /dev/null +++ b/scripts/check--help @@ -0,0 +1,22 @@ +#! /bin/sh + +# Look at the file specified in $1 to see if it contains 'no --help'. +# If it does: +# - Squawk +# - rename the file to ($1)- +# - exit with a non-zero status. +# otherwise: +# - exit with a 0 status. + +if test ! -f $1 +then + echo "$0: $1 is not a regular file!" 2>&3 + exit 1 +fi + +if grep -q 'no --help' $1 +then + echo "$0: $1 contains 'no --help'!" 2>&3 + mv ${1} ${1}- + exit 1 +fi diff --git a/scripts/checkChangeLog b/scripts/checkChangeLog new file mode 100755 index 0000000..46c56c4 --- /dev/null +++ b/scripts/checkChangeLog @@ -0,0 +1,29 @@ +#! /bin/sh + +. ./packageinfo.sh + +# HMS: Irix doesn't have 'head'... +cl1=`head -1 ChangeLog || sed -e 1q ChangeLog` + +case "$repotype" in + dev) ;; + stable) ;; + *) echo "Unexpected repotype <$repotype>" + exit 1 + ;; +esac + +case "$repotype$cl1" in + dev---) + echo "Dev repo ChangeLog must not begin with '---'!" + exit 1 + ;; + dev*) + ;; + stable---) + ;; + stable*) + echo "Stable repo Changelog must begin with '---'!" + exit 1 + ;; +esac diff --git a/scripts/cvo.sh b/scripts/cvo.sh new file mode 100755 index 0000000..a8d00ef --- /dev/null +++ b/scripts/cvo.sh @@ -0,0 +1,150 @@ +#! /bin/sh + +# Copyright 2002, 2009, 2010 Harlan Stenn. Used by NTP with permission. +# Author: Harlan Stenn <harlan+cvo@pfcs.com> + +# Possible output formats: +# +# CVO=... Shell variable +# CVO=... ; export CVO Old-style exported envariable +# export CVO=... New-style exported envariable +# setenv CVO ... csh-style exported envariable + +TS="$*" + +CVO_raw=`config.guess` +CVO=$CVO_raw + +set 1 `echo $CVO | tr '-' ' '` +shift + +case "$#" in + 4) # eg: i686-pc-linux-gnu + CVO_CPU=$1 + CVO_VENDOR=$2 + cvo_KERN=$3 # Note the capitalization... + CVO_OS=$4 + case "$cvo_KERN" in + linux) # Braindamage. We want OS, not kernel info + if lsb_release > /dev/null 2>&1 + then + CVO_OS=`lsb_release --id --short | tr '[:upper:]' '[:lower:]'` + CVO_OS="$CVO_OS`lsb_release --release --short`" + elif test -f /etc/debian_version + then + set `cat /etc/debian_version` + CVO_OS=debian$1 + CVO_KOSVER=`uname -r` + elif test -f /etc/mandrake-release + then + set `cat /etc/mandrake-release` + CVO_OS=mandrake$4 + CVO_KOSVER=`uname -r` + elif test -f /etc/redhat-release + then + set `cat /etc/redhat-release` + case "$1" in + CentOS) + CVO_OS=centos$3 + ;; + Fedora) + CVO_OS=fedora$3 + ;; + *) + case "$3" in + Enterprise) + CVO_OS=redhat$7.E + ;; + Linux) + CVO_OS=redhat$5 + ;; + esac + ;; + esac + CVO_KOSVER=`uname -r` + elif test -f /etc/slackware-version + then + set `cat /etc/slackware-version` + CVO_OS=slackware$2 + CVO_KOSVER=`uname -r` + elif test -f /etc/SuSE-release + then + set `cat /etc/SuSE-release` + CVO_OS=suse$9 + CVO_KOSVER=`uname -r` + else + CVO_OS=$cvo_KERN`uname -r` + + fi + ;; + nto) # QNX + CVO_KOSVER=`uname -r` + ;; + *) + echo "gronk - I don't understand <$CVO>!" + exit 1 + ;; + esac + ;; + 3) CVO_CPU=$1 + CVO_VENDOR=$2 + CVO_OS=$3 + ;; + *) echo "gronk - config.guess returned $# pieces, not 3 pieces!" + exit 1 + ;; +esac + +case "$CVO_OS" in + cygwin) + # Decisions, decisions. + # uname -r is the cygwin version #, eg: 1.3.3(0.46/3/2) + # uname -s returns something like CYGWIN_NT-5.0 + CVO_OS="$CVO_OS`uname -r | sed 's/(.*//'`" + ;; +esac +set `echo $CVO_OS | sed 's/\([0-9]\)/ \1/'` + +case "$#" in + 2) ;; + *) echo "gronk - <$CVO_OS> expanded to $#, not 2 pieces!" + exit 1 + ;; +esac + +CVO_OSNAME=$1 +CVO_OSVER=$2 + +case "$CVO_OSNAME" in + solaris) + CVO_KOSVER=`uname -v` + ;; +esac + +CVO=$CVO_CPU-$CVO_VENDOR-$CVO_OS + +case "$TS" in + '') + set | grep CVO + ;; + *) + # keys['cvo'] = "cvo.CVO['CVO']" + TS=`echo $TS | sed -e s/@cvo@/$CVO/g` + # keys['cpu'] = "cvo.CVO['CVO_CPU']" + TS=`echo $TS | sed -e s/@cpu@/$CVO_CPU/g` + # keys['kosver'] = "cvo.CVO['CVO_KOSVER']" + TS=`echo $TS | sed -e s/@kosver@/$CVO_KOSVER/g` + # keys['os'] = "cvo.CVO['CVO_OS']" + TS=`echo $TS | sed -e s/@os@/$CVO_OS/g` + # keys['osname'] = "cvo.CVO['CVO_OSNAME']" + TS=`echo $TS | sed -e s/@osname@/$CVO_OSNAME/g` + # keys['osver'] = "cvo.CVO['CVO_OSVER']" + TS=`echo $TS | sed -e s/@osver@/$CVO_OSVER/g` + # keys['vendor'] = "cvo.CVO['CVO_VENDOR']" + TS=`echo $TS | sed -e s/@vendor@/$CVO_VENDOR/g` + # keys['raw'] = "cvo.CVO['CVO_raw']" + TS=`echo $TS | sed -e s/@raw@/$CVO_raw/g` + + echo $TS + ;; +esac diff --git a/scripts/genCommitLog b/scripts/genCommitLog index 2a258ad..318e286 100755 --- a/scripts/genCommitLog +++ b/scripts/genCommitLog @@ -2,6 +2,15 @@ set -e -. packageinfo.sh -bk -R prs -hr${CLTAG}.. -nd':I:' | bk changes -m -v - > CommitLog.new +GCL_REMOVEWRITE=0 +. ./packageinfo.sh +if [ ! -w . ] ; then + GCL_REMOVEWRITE=1 + chmod u+w . + [ -f CommitLog -a ! -w CommitLog ] && chmod u+w CommitLog +fi +bk changes -v -m -r${CLTAG}.. > CommitLog.new mv CommitLog.new CommitLog +case "$GCL_REMOVEWRITE" in + 1) chmod a-w CommitLog . +esac diff --git a/scripts/genver b/scripts/genver index 0ce1922..ddf25cd 100755 --- a/scripts/genver +++ b/scripts/genver @@ -16,6 +16,9 @@ do *version.def) outputs="include/version.def $outputs" ;; + *version.texi) + outputs="include/version.texi $outputs" + ;; *) echo "Unrecognized option: $i" exit 1 ;; @@ -23,7 +26,7 @@ do done case "$outputs" in - '') outputs="version.m4 include/version.def" ;; + '') outputs="version.m4 include/version.def include/version.texi" ;; esac set -e @@ -65,3 +68,21 @@ case "$outputs" in esac ;; esac + +case "$outputs" in + *version.texi*) + echo "@set UPDATED `date +'%d %B %Y'`" > /tmp/version.texi+ + echo "@set EDITION $dversion" >> /tmp/version.texi+ + echo "@set VERSION $dversion" >> /tmp/version.texi+ + cmp -s /tmp/version.texi+ include/version.texi + rc=$? + case "$force$rc" in + 00) + rm -f /tmp/version.texi+ + ;; + *) + mv /tmp/version.texi+ include/version.texi + ;; + esac + ;; +esac diff --git a/scripts/html2man.in b/scripts/html2man.in index b7cebce..2f5fb3f 100755 --- a/scripts/html2man.in +++ b/scripts/html2man.in @@ -20,31 +20,33 @@ $MANDIR = "./man"; # name of man page, man section, 'see also' section %manfiles = ( 'ntpd' => ['ntpd', 8, 'ntp.conf(5), ntpq(8), ntpdc(8)'], - 'ntpq' => ['ntpq', 8, 'ntpd(8), ntpdc(8)'], + 'ntpq' => ['ntpq', 8, 'ntp_decode(5), ntpd(8), ntpdc(8)'], 'ntpdate' => ['ntpdate', 8, 'ntpd(8)'], 'ntpdc' => ['ntpdc', 8, 'ntpd(8)'], - 'ntptime' => ['ntpdtime', 8, 'ntpd(8), ntpdate(8)'], + 'ntptime' => ['ntptime', 8, 'ntpd(8), ntpdate(8)'], 'ntptrace' => ['ntptrace', 8, 'ntpd(8)'], + 'ntp-wait' => ['ntp-wait', 8, 'ntpd(8)'], 'keygen' => ['ntp-keygen', 8, 'ntpd(8), ntp_auth(5)'], - 'confopt' => ['ntp.conf', 5, 'ntpd(8)'], + 'tickadj' => ['tickadj', 8, 'ntpd(8)'], + 'confopt' => ['ntp.conf', 5, 'ntpd(8), ntp_auth(5), ntp_mon(5), ntp_acc(5), ntp_clock(5), ntp_misc(5)'], 'authopt' => ['ntp_auth', 5, 'ntp.conf(5), ntpd(8)'], - 'monopt' => ['ntp_mon', 5, 'ntp.conf(5)'], + 'monopt' => ['ntp_mon', 5, 'ntp.conf(5), ntp_decode(5)'], 'accopt' => ['ntp_acc', 5, 'ntp.conf(5)'], 'clockopt' => ['ntp_clock', 5, 'ntp.conf(5)'], + 'decode' => ['ntp_decode', 5, 'ntpq(8), ntp_mon(5)'], 'miscopt' => ['ntp_misc', 5, 'ntp.conf(5)']); -# Disclaimer to go in SEE ALSO section of the man page -$seealso_disclaimer = 'These man pages are automatically hacked from the main NTP ' . - 'documentation pages, which are maintained in HTML format. These files are ' . - 'included in the NTP source distribution. If you installed NTP from a binary ' . - 'package, or it came pre-installed on your system, chances are the documentation ' . - 'was also included in the usual place for your system. The HTML files are more ' . - 'correct and complete than these man pages, which are provided for your reference ' . - 'only.'; +%table_headers = ( + 'ntpd' => 'l l l l.', + 'ntpq' => 'l l.', + 'monopt' => 'l l l.', + 'decode' => 'l l l l.', + 'authopt' => 'c c c c c c.' +); -# Disclaimer to go right at the top -$top_disclaimer = 'This file was automatically generated from HTML source, and may be ' . - 'incorrect. See the SEE ALSO section at the end of this file for more info'; +# Disclaimer to go in SEE ALSO section of the man page +$seealso_disclaimer = "The official HTML documentation.\n\n" . + "This file was automatically generated from HTML source.\n"; mkdir $MANDIR, 0777; mkdir "$MANDIR/man8", 0777; @@ -64,7 +66,8 @@ sub process { $fileinfo = $manfiles{$filename}; $p = HTML::TokeParser->new("$filename.html") || die "Can't open $filename.html: $!"; - open(MANOUT, ">$MANDIR/man$fileinfo->[1]/$fileinfo->[0].$fileinfo->[1]") + $fileout = "$MANDIR/man$fileinfo->[1]/$fileinfo->[0].$fileinfo->[1]"; + open(MANOUT, ">$fileout") || die "Can't open: $!"; $p->get_tag("title"); @@ -73,7 +76,6 @@ sub process { # Setup man header print MANOUT ".TH " . $fileinfo->[0] . " " . $fileinfo->[1] . "\n"; - print MANOUT ".UC 4\n"; print MANOUT ".SH NAME\n"; $pat = $fileinfo->[0]; if ($name =~ /$pat/) { @@ -81,10 +83,13 @@ sub process { # Add the manpage name, if not in the HTML title already print MANOUT "$fileinfo->[0] - "; } - print MANOUT "$name\n\n"; - - print MANOUT "$top_disclaimer\n"; + print MANOUT "$name\n.SH \\ \n\n"; + @fontstack = (); + $deflevel = 0; + $pre = 0; + $ignore = 0; + $first_td = 1; # Now start scanning. We basically print everything after translating some tags. # $token->[0] has "T", "S", "E" for Text, Start, End # $token->[1] has the tag name, or text (for "T" case) @@ -92,19 +97,37 @@ sub process { while (my $token = $p->get_token) { if($token->[0] eq "T") { my $text = $token->[1]; - if($tag) { - $text =~ s/^[\n ]*//; - $text =~ s/[\n ]*$/ /; + if (!$pre) { + if($tag) { + $text =~ s/^[\n\t ]*//; + } + $text =~ s/^[\n\t ][\n\t ]+$//; + $text =~ s/[\n\t ]+/ /g; + $text =~ s/ \;/ /g; + $text =~ s/>\;/>/g; + $text =~ s/<\;/</g; + $text =~ s/"\;/"/g; + $text =~ s/&\;/&/g; + $text =~ s/^\./\\[char46]/; } - $text =~ s/ \;/ /g; - $text =~ s/^\./\\./; print MANOUT "$text"; $tag = 0; } if($token->[0] eq "S") { if($token->[1] eq "h4") { my $text = uc($p->get_trimmed_text("/h4")); - print MANOUT ".SH $text\n"; + # ignore these sections in ntpd.html + if ($filename eq "ntpd" && + ($text eq "CONFIGURATION OPTIONS")) { + $ignore = 1; + close(MANOUT); + open(MANOUT, ">/dev/null"); + } elsif ($ignore) { + $ignore = 0; + close(MANOUT); + open(MANOUT, ">>$fileout"); + } + print MANOUT "\n\n.SH $text\n"; } if($token->[1] eq "tt") { push @fontstack, "tt"; @@ -118,22 +141,42 @@ sub process { my $text = $p->get_trimmed_text("/address"); print MANOUT "\n.SH AUTHOR\n$text\n"; } - if($token->[1] eq "dt") { - $tmp = $deflevel-4; - print MANOUT "\n.RS $tmp\n"; + if($token->[1] eq "dt" || $token->[1] eq "br" && $deflevel > 0) { + print MANOUT "\n.TP 8\n"; $tag = 1; } if($token->[1] eq "dd") { - print MANOUT "\n.RS $deflevel\n"; + print MANOUT "\n"; $tag = 1; } if($token->[1] eq "dl") { - $deflevel+=4; + $deflevel+=1; + if ($deflevel > 0) { + print MANOUT "\n.RS ", $deflevel > 1 ? 8 : 0; + } + } + if($token->[1] eq "p") { + print MANOUT "\n"; + } + if($token->[1] eq "pre") { + print MANOUT "\n.nf"; + $pre = 1; + } + if($token->[1] eq "table") { + print MANOUT "\n.TS\n"; + print MANOUT "expand allbox tab(%);\n"; + print MANOUT $table_headers{$filename}; + print MANOUT "\n"; + } + if($token->[1] eq "td") { + if ($first_td == 0) { + print MANOUT " % "; + } + $first_td = 0; } } elsif($token->[0] eq "E") { - if($token->[1] eq "dd") { - print MANOUT "\n.RE\n"; + if($token->[1] eq "h4") { $tag = 1; } if($token->[1] eq "tt") { @@ -157,15 +200,34 @@ sub process { print MANOUT "$fontswitch"; } if($token->[1] eq "dl") { - $deflevel-=4; + if ($deflevel > 0) { + print MANOUT "\n.RE"; + } + print MANOUT "\n"; + $deflevel-=1; } - if($token->[1] eq "dt") { - print MANOUT "\n.RE"; + if($token->[1] eq "p") { + print MANOUT "\n"; $tag = 1; } + if($token->[1] eq "pre") { + print MANOUT "\n.fi"; + $pre = 0; + } + if($token->[1] eq "table") { + print MANOUT ".TE\n"; + } + if($token->[1] eq "tr") { + print MANOUT "\n"; + $first_td = 1; + } } } - print MANOUT ".SH SEE ALSO\n\n"; + if ($ignore) { + close(MANOUT); + open(MANOUT, ">>$fileout"); + } + print MANOUT "\n.SH SEE ALSO\n\n"; print MANOUT "$fileinfo->[2]\n\n"; print MANOUT "$seealso_disclaimer\n"; close(MANOUT); diff --git a/scripts/mkver.in b/scripts/mkver.in index 11aa613..4557a04 100644 --- a/scripts/mkver.in +++ b/scripts/mkver.in @@ -17,7 +17,7 @@ case "@LCRYPTO@" in *) ConfStr="${ConfStr}-?" ;; esac -ConfStr="$ConfStr `LC_TIME=C TZ= date`" +ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`" if [ ! -f .version ]; then echo 0 > .version diff --git a/scripts/ntp-wait.in b/scripts/ntp-wait.in index a26630b..7b026ca 100644 --- a/scripts/ntp-wait.in +++ b/scripts/ntp-wait.in @@ -4,14 +4,13 @@ die "perl5 needed\n" unless ($] > 5); use Getopt::Std; -$opt_f = 0; # 'Hard' failure if 'state' is unknown $opt_n = 1000; # How many tries before we give up? (10 min+) $opt_s = 6; # Seconds to sleep between tries (6s = 10/min) $opt_v = 0; # Be verbose? -getopts('fn:s:v'); +getopts('n:s:v'); -$cmd = 'ntpq -c "rv 0 state"'; +$cmd = 'ntpq -c "rv 0"'; $| = 1; # Autoflush output. @@ -19,20 +18,33 @@ print "Waiting for ntpd to synchronize... " if ($opt_v); for ($i = 0; $i < $opt_n; ++$i) { open(Q, $cmd." 2>&1 |") || die "Can't start ntpq: $!"; while(<Q>) { - if (/^state=4/) { - print "\bOK!\n" if ($opt_v); - exit 0; - } - - if (/request variable was unknown/) { - print "\bCan't tell!\nPerhaps you are running an old version of ntpd.\n" if ($opt_v); - exit $opt_f; + chomp; + # the first line should be similar to: + # associd=0 status=0645 leap_none, sync_ntp, ... + if (/^associd=0 status=(\S{4}) (\S+), (\S+),/) { + my $status = $1; + my $leap = $2; + my $sync = $3; + # print $_; + # print "status <$status>, leap <$leap>, sync <$sync>\n"; + last if ($leap =~ /(sync|leap)_alarm/); + if ($leap =~ /leap_(none|((add|del)_sec))/) { + # We could check $sync here to make sure we like the source... + print "\bOK!\n" if ($opt_v); + exit 0; + } + print "\bUnexpected 'leap' status <$leap>\n"; + exit 1; } if (/Connection refused/) { print "\bntpd is not running!\n" if ($opt_v); exit 1; } + + # Otherwise, we have a bigger problem. + print "\bUnexpected first line <$_>\n"; + exit 1; } close(Q); print "\b".substr("*+:.", $i % 4, 1) if ($opt_v); diff --git a/scripts/ntptrace.in b/scripts/ntptrace.in index c3c2a20..d44dab4 100755 --- a/scripts/ntptrace.in +++ b/scripts/ntptrace.in @@ -8,6 +8,7 @@ use vars qw($opt_n $opt_m); $ntpq = "ntpq"; +$Getopt::Std::STANDARD_HELP_VERSION=1; getopts('nm:'); $dodns = 1; |