2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 09:57:41 +00:00

Only regenerate ChangeLog if there have been changes.

Also check that "hg --version" or "git --version" works before using
hg or git.  Bug #1043.
This commit is contained in:
Todd C. Miller 2022-12-08 10:10:41 -07:00
parent f5488d733d
commit 179fd32472
3 changed files with 17 additions and 8 deletions

1
.gitignore vendored
View File

@ -24,6 +24,7 @@ libtool
pathnames.h pathnames.h
ChangeLog ChangeLog
PVS-Studio.cfg PVS-Studio.cfg
stamp-*
uncrustify.files uncrustify.files
docs/*.man docs/*.man

View File

@ -21,6 +21,7 @@ Makefile$
^ChangeLog$ ^ChangeLog$
^PVS-Studio\.cfg$ ^PVS-Studio\.cfg$
^stamp-
^uncrustify\.files$ ^uncrustify\.files$
^docs/.*\.man$ ^docs/.*\.man$
^docs/.*\.mdoc$ ^docs/.*\.mdoc$

View File

@ -234,17 +234,24 @@ depend: siglist.c signame.c
--file $(top_builddir)/src/Makefile --file $(top_builddir)/src/Makefile
ChangeLog: ChangeLog:
if test -d $(srcdir)/.hg; then \ if test -d $(srcdir)/.hg && hg -R $(srcdir) identify -ibt >stamp-$@.tmp 2>&1; then \
if hg log -R $(srcdir) --template=changelog -r "sort(branch(.) or follow(), -date)" > $@.tmp; then \ cmp stamp-$@.tmp stamp-$@ >/dev/null 2>&1 || { \
mv -f $@.tmp $(srcdir)/$@; \ mv -f stamp-$@.tmp stamp-$@; \
else \ if hg log -R $(srcdir) --template=changelog -r "sort(branch(.) or follow(), -date)" > $@.tmp; then \
rm -f $@.tmp; \ mv -f $@.tmp $(srcdir)/$@; \
fi; \ fi; \
elif test -d $(srcdir)/.git; then \ }; \
$(scriptdir)/log2cl.pl -R $(srcdir)/.git > $(srcdir)/$@; \ 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 \ elif test ! -f $(srcdir)/$@; then \
echo "ChangeLog data not available" > $(srcdir)/$@; \ echo "ChangeLog data not available" > $(srcdir)/$@; \
fi fi
rm -f $@.tmp stamp-$@.tmp
config.status: config.status:
@if [ ! -s config.status ]; then \ @if [ ! -s config.status ]; then \