summaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorTodd C. Miller <Todd.Miller@sudo.ws>2022-12-08 10:10:41 -0700
committerTodd C. Miller <Todd.Miller@sudo.ws>2022-12-08 10:10:41 -0700
commit4a1c22d453b33f3294144491d74f5504b3c31e1a (patch)
tree02a84ae4634130f5b4a78b414b6852c8f64ec70c /Makefile.in
parentcb3f6566b1a602dbfc406f43c9de7628841fc7d8 (diff)
downloadsudo-4a1c22d453b33f3294144491d74f5504b3c31e1a.tar.gz
Only regenerate ChangeLog if there have been changes.
Also check that "hg --version" or "git --version" works before using hg or git. Bug #1043.
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in23
1 files changed, 15 insertions, 8 deletions
diff --git a/Makefile.in b/Makefile.in
index 4b57898fc..2e9fe3983 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -234,17 +234,24 @@ depend: siglist.c signame.c
--file $(top_builddir)/src/Makefile
ChangeLog:
- if test -d $(srcdir)/.hg; then \
- if hg log -R $(srcdir) --template=changelog -r "sort(branch(.) or follow(), -date)" > $@.tmp; then \
- mv -f $@.tmp $(srcdir)/$@; \
- else \
- rm -f $@.tmp; \
- fi; \
- elif test -d $(srcdir)/.git; then \
- $(scriptdir)/log2cl.pl -R $(srcdir)/.git > $(srcdir)/$@; \
+ if test -d $(srcdir)/.hg && hg -R $(srcdir) identify -ibt >stamp-$@.tmp 2>&1; then \
+ cmp stamp-$@.tmp stamp-$@ >/dev/null 2>&1 || { \
+ mv -f stamp-$@.tmp stamp-$@; \
+ if hg log -R $(srcdir) --template=changelog -r "sort(branch(.) or follow(), -date)" > $@.tmp; then \
+ mv -f $@.tmp $(srcdir)/$@; \
+ fi; \
+ }; \
+ elif test -d $(srcdir)/.git && git --git-dir $(srcdir)/.git describe --tags >stamp-$@.tmp 2>&1; then \
+ cmp stamp-$@.tmp stamp-$@ >/dev/null 2>&1 || { \
+ mv -f stamp-$@.tmp stamp-$@; \
+ if $(scriptdir)/log2cl.pl -R $(srcdir)/.git > $@.tmp; then \
+ mv -f $@.tmp $(srcdir)/$@; \
+ fi; \
+ }; \
elif test ! -f $(srcdir)/$@; then \
echo "ChangeLog data not available" > $(srcdir)/$@; \
fi
+ rm -f $@.tmp stamp-$@.tmp
config.status:
@if [ ! -s config.status ]; then \