From fbf64ad4ed17c761967f072fb17bad1c37499a82 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 24 Sep 2016 00:09:15 +0300 Subject: [PATCH] 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 aabcb6fb..cb42ea92 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 a7028c27..0b111c35 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 54baf7d5..a7f24dc0 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 -- 2.44.0