[projects/rc-scripts] update autofoo rules to ensure ChangeLog is generated if missing

glen glen at pld-linux.org
Fri Sep 23 23:33:36 CEST 2016


commit fbf64ad4ed17c761967f072fb17bad1c37499a82
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sat Sep 24 00:09:15 2016 +0300

    update autofoo rules to ensure ChangeLog is generated if missing

 Makefile.am  | 6 ++++++
 autogen.sh   | 7 -------
 changelog.sh | 6 ++++++
 3 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index aabcb6f..cb42ea9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,6 +36,12 @@ EXTRA_DIST = \
 	$(sbin_SCRIPTS) \
 	$(bin_SCRIPTS)
 
+DISTCLEANFILES = \
+	ChangeLog
+
+ChangeLog:
+	$(top_srcdir)/changelog.sh $(top_builddir)
+
 install-data-hook:
 	install -d $(DESTDIR)$(localstatedir)/cache/$(PACKAGE)
 	[ -f $(DESTDIR)$(localstatedir)/cache/$(PACKAGE)/msg.cache ] || touch $(DESTDIR)$(localstatedir)/cache/$(PACKAGE)/msg.cache
diff --git a/autogen.sh b/autogen.sh
index a7028c2..0b111c3 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -6,13 +6,6 @@ test -z "$srcdir" && srcdir=.
 
 PKG_NAME="PLD Linux Distribution rc-scripts"
 
-if [ -x ./changelog.sh ]; then
-	./changelog.sh
-else
-	echo "Error: missing script changelog.sh to generate ChangeLog" >&2
-	exit 1
-fi
-
 cd "$srcdir"
 
     
diff --git a/changelog.sh b/changelog.sh
index 54baf7d..a7f24dc 100755
--- a/changelog.sh
+++ b/changelog.sh
@@ -1,6 +1,12 @@
 #!/bin/sh
 # Run this to generate ChangeLog.
 
+top_builddir=${1:-$(pwd)}
+
+set -e
+
+cd "$top_builddir"
+
 [ -e .git/shallow ] && git fetch --unshallow
 git log --format='%+ai [%h] %aN <%ae>%n%n%x09* %s' --stat | sed '1d' > ChangeLog
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/rc-scripts.git/commitdiff/03fb1187015294e42abcf69e38ecfef5d9604cd8



More information about the pld-cvs-commit mailing list