[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH glib] Auto-generate AUTHORS file from GIT logs during make dist



From: "Daniel P. Berrange" <berrange redhat com>

Instead of manually keeping the AUTHORS file in sync with
GIT, auto-generate it during make dist phase

Signed-off-by: Daniel P. Berrange <berrange redhat com>
---
 AUTHORS => AUTHORS.in |  9 +--------
 ChangeLog             |  0
 Makefile.am           | 13 +++++++++++--
 autogen.sh            |  5 +++++
 cfg.mk                | 15 ---------------
 5 files changed, 17 insertions(+), 25 deletions(-)
 rename AUTHORS => AUTHORS.in (52%)
 delete mode 100644 ChangeLog

diff --git a/AUTHORS b/AUTHORS.in
similarity index 52%
rename from AUTHORS
rename to AUTHORS.in
index db05f64..6ee6c9c 100644
--- a/AUTHORS
+++ b/AUTHORS.in
@@ -10,13 +10,6 @@ The primary maintainers of libvirt-glib are:
 
 Patches have been received from:
 
-   Guido G??nther <agx sigxcpu org>
-   Nirbheek Chauhan <nirbheek gentoo org>
-   Michal Privoznik <mprivozn redhat com>
-   Jovanka Gulicoska <jovanka gulicoska gmail com>
-   Timo Juhani Lindfors <timo lindfors iki fi>
-   Alexander Larsson <alexl redhat com>
-   Claudio Bley <cbley av-test de>
-   Stefano Facchini <stefano facchini gmail com>
+#authorslist#
 
    ... send patches to get your name added ...
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index e69de29..0000000
diff --git a/Makefile.am b/Makefile.am
index 9add74e..9101fdb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,17 +13,18 @@ EXTRA_DIST = $(PACKAGE).spec \
 	     GNUmakefile \
 	     maint.mk \
 	     cfg.mk \
+	     AUTHORS.in \
 	     $(NULL)
 
 DISTCLEAN_FILES = $(PACKAGE).spec $(pkgconfig_DATA)
 
 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc=yes --enable-introspection=yes
 
-dist-hook: gen-ChangeLog
+dist-hook: gen-ChangeLog gen-AUTHORS
 
 # Generate the ChangeLog file (with all entries since the switch to git)
 # and insert it into the directory we're about to use to create a tarball.
-.PHONY: gen-ChangeLog
+.PHONY: gen-ChangeLog gen-AUTHORS
 gen-ChangeLog:
 	if test -d .git || test -d ../.git; then					\
 	  $(top_srcdir)/build-aux/gitlog-to-changelog		\
@@ -31,3 +32,11 @@ gen-ChangeLog:
 	  rm -f $(distdir)/ChangeLog;				\
 	  mv $(distdir)/cl-t $(distdir)/ChangeLog;		\
 	fi
+
+gen-AUTHORS:
+	$(AM_V_GEN)if test -d $(srcdir)/.git; then                      \
+	  out="`cd $(srcdir) && git log --pretty=format:'%aN <%aE>' | sort -u`" && \
+	  perl -p -e "s/#authorslist#// and print '$$out'"            \
+	    < $(srcdir)/AUTHORS.in > $(distdir)/AUTHORS-tmp &&        \
+	  mv -f $(distdir)/AUTHORS-tmp $(distdir)/AUTHORS ;           \
+	fi
diff --git a/autogen.sh b/autogen.sh
index bcec826..8030ab1 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -29,6 +29,11 @@ if test -z "$*"; then
         echo "the $0 command line."
 fi
 
+# Real ChangeLog/AUTHORS is auto-generated from GIT logs at
+# make dist time, but automake requires that it
+# exists at all times :-(
+touch ChangeLog AUTHORS
+
 mkdir -p build-aux
 intltoolize --force
 autoreconf -if
diff --git a/cfg.mk b/cfg.mk
index 099ffa3..293d4e4 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -18,7 +18,6 @@
 # Tests not to run as part of "make distcheck".
 local-checks-to-skip =			\
   changelog-check			\
-  check-AUTHORS				\
   makefile-check			\
   makefile_path_separator_check		\
   patch-check				\
@@ -109,20 +108,6 @@ sc_copyright_format:
 # We don't use this feature of maint.mk.
 prev_version_file = /dev/null
 
-# Give credit where due:
-# Ensure that each commit author email address (possibly mapped via
-# git log's .mailmap) appears in our AUTHORS file.
-sc_check_author_list:
-	@fail=0;							\
-	for i in $$(git log --pretty=format:%aE%n|sort -u|grep -v '^$$'); do \
-	  sanitized=$$(echo "$$i"|LC_ALL=C sed 's/\([^a-zA-Z0-9_ -]\)/\\\1/g'); \
-	  grep -iq "<$$sanitized>" $(srcdir)/AUTHORS			\
-	    || { printf '%s\n' "$$i" >&2; fail=1; };			\
-	done;								\
-	test $$fail = 1							\
-	  && echo '$(ME): committer(s) not listed in AUTHORS' >&2;	\
-	test $$fail = 0
-
 
 exclude_file_name_regexp--sc_bindtextdomain = ^(libvirt-gconfig/tests|examples)/|libvirt-glib/libvirt-glib-event.c|libvirt-glib/libvirt-glib-main.c
 
-- 
1.8.1.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]