bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] MODULES.html.sh: handle tarball builds


From: Bruno Haible
Subject: Re: [PATCH] MODULES.html.sh: handle tarball builds
Date: Fri, 10 Apr 2020 14:26:35 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-174-generic; KDE/5.18.0; x86_64; ; )

Hi Bernhard,

> Distributions typically build binaries from release tarballs
> that do not contain a .git directory.
> In such a setup the git log would fail.

I did not know that, as I'm not in the distro business.

> This patch provides a fallback that still allows for reproducibility.

As I wrote in
   <https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00061.html>,
the date is important for the readers of the generated file.

If the .git directory is not present, let's use the ChangeLog instead.


2020-04-10  Bruno Haible  <address@hidden>

        MODULES.html.sh: Support for reproducible builds from git-less tarballs.
        Reported by Bernhard M. Wiedemann <address@hidden> 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.

diff --git a/MODULES.html.sh b/MODULES.html.sh
index b1638da..d1ec78f 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}."
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]