From: Harlan Stenn Date: Tue, 24 May 2016 09:58:00 +0000 (-0700) Subject: Make sure we have an "author" file for git imports. HStenn. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d1ea3522d54cd611c6dbc73b936b55734efa6c3;p=thirdparty%2Fntp.git Make sure we have an "author" file for git imports. HStenn. bk: 574425a8cLExBq7lmvD1pbnMYCAfTg --- diff --git a/ChangeLog b/ChangeLog index 880570448..7577841ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ --- * [Sec 3042] Broadcast Interleave. HStenn. +* Make sure we have an "author" file for git imports. HStenn. +* Update the sntp problem tests for MacOS. HStenn. --- (4.2.8p7) 2016/04/26 Released by Harlan Stenn diff --git a/configure.ac b/configure.ac index caba8f688..a34ed6d83 100644 --- a/configure.ac +++ b/configure.ac @@ -4397,6 +4397,7 @@ AC_CONFIG_FILES([ntpsnmpd/Makefile]) AC_CONFIG_FILES([parseutil/Makefile]) AC_CONFIG_FILES([scripts/Makefile]) AC_CONFIG_FILES([scripts/build/Makefile]) +AC_CONFIG_FILES([scripts/build/genAuthors], [chmod +x scripts/build/genAuthors]) AC_CONFIG_FILES([scripts/build/mkver], [chmod +x scripts/build/mkver]) AC_CONFIG_FILES([scripts/calc_tickadj/Makefile]) AC_CONFIG_FILES([scripts/calc_tickadj/calc_tickadj], [chmod +x scripts/calc_tickadj/calc_tickadj]) diff --git a/scripts/build/Makefile.am b/scripts/build/Makefile.am index 51a1bbccf..a165b1cd8 100644 --- a/scripts/build/Makefile.am +++ b/scripts/build/Makefile.am @@ -1,7 +1,7 @@ run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \ autogen -L ../sntp/include -L ../sntp/ag-tpl -noinst_SCRIPTS = mkver +noinst_SCRIPTS = genAuthors mkver NULL= EXTRA_DIST = \ diff --git a/scripts/build/genAuthors.in b/scripts/build/genAuthors.in new file mode 100644 index 000000000..f0e49c587 --- /dev/null +++ b/scripts/build/genAuthors.in @@ -0,0 +1,82 @@ +#! @PATH_PERL@ + +# DESCRIPTION +# +# Make sure we have the list of authors for git imports. +# Call with the path to the Authors/ subdirectory. +# +# AUTHOR +# +# Harlan Stenn +# +# LICENSE +# +# This file is Copyright (c) 2016 Network Time Foundation +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice, +# author attribution and this notice are preserved. This file is offered +# as-is, without any warranty. + +use strict; +use warnings; + +# Read in the list of known authors. +# run: +# bk changes -and:USER: | sort -u +# to get the list of users who have made commits. +# Make sure that each of these users is in the set of known authors. +# Make sure the format of that file is 1 or more lines of the form: +# user = User Name +# +# If all of the above is true, exit 0. +# If there are any problems, squawk and exit 1. + +my $bk_u = "bk changes -and:USER: | sort -u |"; +chomp(my $bk_root = `bk root`); +my $A_path = "$bk_root/BitKeeper/etc/authors.txt"; +my %authors; +my $problem = 0; + +die "bkroot: <$bk_root>, A_path: <$A_path>\n" if (! -r $A_path); + +# Process the authors.txt file +open(my $FILE, '<', $A_path) or die "Could not open <$A_path>: $!\n"; +while (<$FILE>) { + chomp; + if (/^([\S]+) = ([\V]+) <([\w.-]+\@[\w.-]+)>$/) { + # print "Got '$1 = $2 <$3>'\n"; + $authors{$1} = ""; + } else { + print "In $A_path: unrecognized line: '$_'\n"; + $problem = 1; + } +} +close($FILE); + +#print "\%authors = ", join(' ', sort keys %authors), "\n"; + +die "Fix the problem(s) noted above!\n" if $problem; + +# Process "bk changes ..." + +open(BKU, $bk_u) || die "$0: <$bk_u> failed: $!\n"; +while () { + chomp; + my $Name = $_; + my $name = lc; + # print "Got Name <$Name>, name <$name>\n"; + if (!defined($authors{$Name})) { + $problem = 1; + print "<$Name> is not a defined author!\n"; + open(my $FILE, '>>', "$A_path/$name.txt") || die "Cannot create '$A_path/$name.txt': $!\n"; + print $FILE "$Name = \n"; + close($FILE); + } +} + +die "Fix the problem(s) noted above!\n" if $problem; + +# Local Variables: ** +# mode:cperl ** +# End: ** diff --git a/sntp/configure.ac b/sntp/configure.ac index a08aa1347..391e5866a 100644 --- a/sntp/configure.ac +++ b/sntp/configure.ac @@ -143,6 +143,8 @@ NTP_UNITYBUILD AC_PROG_CXX NTP_GOOGLETEST +SNTP_PROBLEM_TESTS + # All libraries should be in various LIB_* variables now. #LIBS= # Sadly not. There is a gettext() check somewhere, and on Solaris this pulls diff --git a/sntp/m4/ntp_problemtests.m4 b/sntp/m4/ntp_problemtests.m4 index 7cc14c9ec..ebc2cd91b 100644 --- a/sntp/m4/ntp_problemtests.m4 +++ b/sntp/m4/ntp_problemtests.m4 @@ -55,5 +55,6 @@ case "$ntp_ept:$cross:$host" in esac AC_MSG_RESULT([$ntp_test_ntp_signd]) AM_CONDITIONAL([BUILD_TEST_NTP_SIGND], [test x$ntp_test_ntp_signd = xyes]) + ]) dnl ====================================================================== diff --git a/sntp/m4/sntp_problemtests.m4 b/sntp/m4/sntp_problemtests.m4 new file mode 100644 index 000000000..fcf7014b1 --- /dev/null +++ b/sntp/m4/sntp_problemtests.m4 @@ -0,0 +1,47 @@ +dnl ###################################################################### +dnl SNTP_PROBLEM_TESTS +dnl +dnl Some platforms have problems building or running certain tests. +dnl While we're in the initial phase of the deployment of the test +dnl framework, sometimes we may need to disable these tests. +dnl +dnl This is where we do that. +dnl +AC_DEFUN([SNTP_PROBLEM_TESTS], [ +case "$build" in + $host) cross=0 ;; + *) cross=1 ;; +esac + +AC_MSG_CHECKING([if we want to enable tests with undiagnosed problems]) +AC_ARG_ENABLE( + [problem-tests], + [AS_HELP_STRING( + [--enable-problem-tests], + [+ enable tests with undiagnosed problems] + )], + [sntp_ept=$enableval], + [sntp_ept=yes] +) +AC_MSG_RESULT([$sntp_ept]) + +AC_MSG_CHECKING([if we can run test-kodDatabase]) +sntp_test_kodDatabase="no" +case "$sntp_ept:$cross:$host" in + no:0:*-apple-darwin12.6.0) ;; + *) sntp_test_kodDatabase="yes" ;; +esac +AC_MSG_RESULT([$sntp_test_kodDatabase]) +AM_CONDITIONAL([BUILD_TEST_KODDATABASE], [test x$sntp_test_kodDatabase = xyes]) + +AC_MSG_CHECKING([if we can run test-kodFile]) +sntp_test_kodFile="no" +case "$sntp_ept:$cross:$host" in + no:0:*-apple-darwin12.6.0) ;; + *) sntp_test_kodFile="yes" ;; +esac +AC_MSG_RESULT([$sntp_test_kodFile]) +AM_CONDITIONAL([BUILD_TEST_KODFILE], [test x$sntp_test_kodFile = xyes]) + +]) +dnl ====================================================================== diff --git a/sntp/tests/Makefile.am b/sntp/tests/Makefile.am index c5338c791..0e14a87b1 100644 --- a/sntp/tests/Makefile.am +++ b/sntp/tests/Makefile.am @@ -34,8 +34,6 @@ run_unity = cd $(srcdir) && ruby ../unity/auto/generate_test_runner.rb check_PROGRAMS = \ test-crypto \ test-keyFile \ - test-kodDatabase \ - test-kodFile \ test-log \ test-networking \ test-packetHandling \ @@ -43,6 +41,14 @@ check_PROGRAMS = \ test-utilities \ $(NULL) +if BUILD_TEST_KODDATABASE +check_PROGRAMS += test-kodDatabase +endif + +if BUILD_TEST_KODFILE +check_PROGRAMS += test-kodFile +endif + noinst_HEADERS = \ sntptest.h \ $(NULL)