diff options
author | Todd C. Miller <Todd.Miller@sudo.ws> | 2022-12-08 10:10:41 -0700 |
---|---|---|
committer | Todd C. Miller <Todd.Miller@sudo.ws> | 2022-12-08 10:10:41 -0700 |
commit | 4a1c22d453b33f3294144491d74f5504b3c31e1a (patch) | |
tree | 02a84ae4634130f5b4a78b414b6852c8f64ec70c /Makefile.in | |
parent | cb3f6566b1a602dbfc406f43c9de7628841fc7d8 (diff) | |
download | sudo-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.in | 23 |
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 \ |