bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] gendocs.sh: don't overwrite existing index.html


From: Sergey Poznyakoff
Subject: Re: [PATCH] gendocs.sh: don't overwrite existing index.html
Date: Mon, 01 Mar 2021 21:22:13 +0200

Hi Bernhard,

> If the point is to avoid a dangling symlink, then shouldn't this
> (also) check for "${PACKAGE}.html"?

Actually, the main point is to avoid destroying the existing file with
a meaningless dangling symlink.  That being said, I have nothing
against checking for existence of "${PACKAGE}.html" as well.  Like that:

diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
index 1872de9..a5e5905 100755
--- a/build-aux/gendocs.sh
+++ b/build-aux/gendocs.sh
@@ -2,7 +2,7 @@
 # gendocs.sh -- generate a GNU manual in many formats.  This script is
 #   mentioned in maintain.texi.  See the help message below for usage details.
 
-scriptversion=2021-01-01.00
+scriptversion=2021-03-01.13
 
 # Copyright 2003-2021 Free Software Foundation, Inc.
 #
@@ -346,7 +346,13 @@ html_split()
   split_html_dir=$PACKAGE.html
   (
     cd ${split_html_dir} || exit 1
-    ln -sf ${PACKAGE}.html index.html
+    if [ ! -f index.html ]; then
+      if [ -f ${PACKAGE}.html ]; then  
+        ln -sf ${PACKAGE}.html index.html
+      else
+        echo "$0: no index.html and ${PACKAGE}.html in $split_html_dir" >&2
+      fi
+    fi
     tar -czf "$abs_outdir/${PACKAGE}.html_$1.tar.gz" -- *.html
   )
   eval html_$1_tgz_size=`calcsize "$outdir/${PACKAGE}.html_$1.tar.gz"`


Best regards,
Sergey




reply via email to

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