aboutsummaryrefslogtreecommitdiff
path: root/contrib/ntp/scripts/build
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/scripts/build')
-rw-r--r--contrib/ntp/scripts/build/Makefile.am2
-rw-r--r--contrib/ntp/scripts/build/Makefile.in9
-rw-r--r--contrib/ntp/scripts/build/genAuthors.in82
3 files changed, 89 insertions, 4 deletions
diff --git a/contrib/ntp/scripts/build/Makefile.am b/contrib/ntp/scripts/build/Makefile.am
index 51a1bbccfb64..a165b1cd88f3 100644
--- a/contrib/ntp/scripts/build/Makefile.am
+++ b/contrib/ntp/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/contrib/ntp/scripts/build/Makefile.in b/contrib/ntp/scripts/build/Makefile.in
index d758d613fbf7..f33f41dd3ee5 100644
--- a/contrib/ntp/scripts/build/Makefile.in
+++ b/contrib/ntp/scripts/build/Makefile.in
@@ -133,7 +133,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = mkver
+CONFIG_CLEAN_FILES = genAuthors mkver
CONFIG_CLEAN_VPATH_FILES =
SCRIPTS = $(noinst_SCRIPTS)
AM_V_P = $(am__v_P_@AM_V@)
@@ -156,7 +156,8 @@ am__can_run_installinfo = \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/mkver.in
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/genAuthors.in \
+ $(srcdir)/mkver.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
@@ -427,7 +428,7 @@ top_srcdir = @top_srcdir@
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 = \
check--help \
@@ -473,6 +474,8 @@ $(top_srcdir)/configure: $(am__configure_deps)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+genAuthors: $(top_builddir)/config.status $(srcdir)/genAuthors.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
mkver: $(top_builddir)/config.status $(srcdir)/mkver.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
diff --git a/contrib/ntp/scripts/build/genAuthors.in b/contrib/ntp/scripts/build/genAuthors.in
new file mode 100644
index 000000000000..f0e49c587e7c
--- /dev/null
+++ b/contrib/ntp/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 <user@place>
+#
+# 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 (<BKU>) {
+ 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: **