From: Kevin McCarthy Date: Tue, 6 Feb 2018 02:43:12 +0000 (-0800) Subject: Use git to generate the release date if available. X-Git-Tag: mutt-1-10-rel~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fefbd81f7339573ade08d29af2bf2e8e07349da7;p=mutt Use git to generate the release date if available. For now, fall back to the ChangeLog. Perhaps the release date should be generated from a file, similar to VERSION, for those cases instead. --- diff --git a/Makefile.am b/Makefile.am index cd547d78..77bda4bb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -75,7 +75,7 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO UPDATING \ mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h \ README.SSL smime.h group.h \ muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \ - ChangeLog mkchangelog.sh mutt_idna.h sidebar.h OPS.SIDEBAR \ + ChangeLog mkchangelog.sh mkreldate.sh mutt_idna.h sidebar.h OPS.SIDEBAR \ snprintf.c regex.c crypt-gpgme.h hcachever.sh.in \ txt2c.c txt2c.sh version.sh check_sec.sh @@ -139,10 +139,8 @@ keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.SIDEBAR $(srcdir)/OPS.PGP $(srcdir $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME \ > keymap_alldefs.h -reldate.h: $(srcdir)/ChangeLog - echo 'const char *ReleaseDate = "'`head -n 1 $(srcdir)/ChangeLog | LC_ALL=C cut -d ' ' -f 1`'";' > reldate.h.tmp; \ - cmp -s reldate.h.tmp reldate.h || cp reldate.h.tmp reldate.h; \ - rm reldate.h.tmp +reldate.h: $(srcdir)/mkreldate.sh $(srcdir)/ChangeLog + (cd $(srcdir) && ./mkreldate.sh) > reldate.h # The '#undef ENABLE_NLS' is to work around an automake ordering issue: # BUILT_SOURCES are processed before SUBDIRS. diff --git a/mkreldate.sh b/mkreldate.sh new file mode 100755 index 00000000..bdbffdb8 --- /dev/null +++ b/mkreldate.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# Generates the reldate.h contents from either git or the ChangeLog file + +if [ -e ".git" ] && command -v git >/dev/null 2>&1; then + reldate=$(git log -1 --date=short --pretty=format:"%cd") +else + reldate=$(head -n 1 ChangeLog | LC_ALL=C cut -d ' ' -f 1) +fi + +echo 'const char *ReleaseDate = "'$reldate'";'