]> Savannah Git Hosting - gnulib.git/commitdiff
MODULES.html.sh: Support for reproducible builds from git-less tarballs.
authorBruno Haible <bruno@clisp.org>
Fri, 10 Apr 2020 12:21:47 +0000 (14:21 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 10 Apr 2020 12:21:47 +0000 (14:21 +0200)
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.

ChangeLog
MODULES.html.sh

index 6403b224057f5799ec7ade7e33c9a4ef7da4266d..ee0d9323e6f3a673493d1db79bd43b48852547f6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2020-04-10  Bruno Haible  <bruno@clisp.org>
+
+       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.
+
 2020-04-04  Bruno Haible  <bruno@clisp.org>
 
        Fix comments: The gettext library is under LGPL 2.1, not LGPL 2.0.
index b1638dada15c35dd971f7d3efd2a60ec67153e1a..d1ec78f626ac208cc4e56770d96bf0bd37802723 100755 (executable)
@@ -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}."