diff options
author | Bruno Haible <bruno@clisp.org> | 2020-04-10 14:21:47 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-04-10 14:21:47 +0200 |
commit | 242644e7d7ab831b2d0c138bcad21d6b2758fbcc (patch) | |
tree | 5b96cab326d7cb296add575c4ac293f48dc70ae2 /MODULES.html.sh | |
parent | e3b56bc2e68f747320d67754df575976266a5712 (diff) | |
download | gnulib-242644e7d7ab831b2d0c138bcad21d6b2758fbcc.tar.gz |
MODULES.html.sh: Support for reproducible builds from git-less tarballs.
Reported by Bernhard M. Wiedemann <bwiedemann@suse.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00061.html>.
* MODULES.html.sh: In a git-less tarball, use the date of the first
ChangeLog entry.
Diffstat (limited to 'MODULES.html.sh')
-rwxr-xr-x | MODULES.html.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/MODULES.html.sh b/MODULES.html.sh index b1638dada1..d1ec78f626 100755 --- a/MODULES.html.sh +++ b/MODULES.html.sh @@ -3695,7 +3695,11 @@ func_echo '<LI>A POT file and some PO files' func_end UL func_echo '<HR>' -git_checkout_date=`git log -n 1 --date=iso --format=fuller | sed -n -e 's/^CommitDate: //p'` +git_checkout_date=`if test -d .git; then + git log -n 1 --date=iso --format=fuller | sed -n -e 's/^CommitDate: //p'; + else + sed -n -e 's/^\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\).*/\1/p' -e 1q ChangeLog; + fi` pretty_date=`LC_ALL=C date +"%e %B %Y" --date="$git_checkout_date"` func_echo "Generated by <CODE>MODULES.html.sh</CODE> from a git checkout as of ${pretty_date}." |