2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 01:49:11 +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
ChangeLog
PVS-Studio.cfg
stamp-*
uncrustify.files
docs/*.man

View File

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

View File

@ -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 \