]> Savannah Git Hosting - gnulib.git/commitdiff
gendocs: allow other chars in source file names
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 27 Jan 2024 20:44:25 +0000 (12:44 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 27 Jan 2024 20:44:54 +0000 (12:44 -0800)
* build-aux/gendocs.sh: Generalize to also allow leading ‘-’
and newlines (!) in source file names.  Exit if there
is an error creating the tarball.

ChangeLog
build-aux/gendocs.sh

index 7f40b7c6b9306a8f579cd7fb6e61e8b810b2882a..58fd6e5d4c7107892449b6a003492235a365d599 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-01-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+       gendocs: allow other chars in source file names
+       * build-aux/gendocs.sh: Generalize to also allow leading ‘-’
+       and newlines (!) in source file names.  Exit if there
+       is an error creating the tarball.
+
 2024-01-27  Patrice Dumas  <pertusus@free.fr>
 
        gendocs: allow spaces, metacharacters and quotes in source file names
index 605c7e31941c901bba2f244b48b2c669ccafd273..9b601010a15621039fc7c190df49e567f4710a5e 100755 (executable)
@@ -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=2024-01-01.00
+scriptversion=2024-01-27.12
 
 # Copyright 2003-2024 Free Software Foundation, Inc.
 #
@@ -66,7 +66,7 @@ generate_html=true
 generate_info=true
 generate_tex=true
 outdir=manual
-source_extra=
+unset source_extra
 split=node
 srcfile=
 texarg="-t @finalout"
@@ -416,11 +416,23 @@ fi # end html
 printf "\nMaking .tar.gz for sources...\n"
 d=`dirname $srcfile`
 (
-  cd "$d"
-  ls -d *.texinfo *.texi *.txi *.eps "$source_extra" 2>/dev/null \
-     | tar -czhf "$abs_outdir/$PACKAGE.texi.tar.gz" -T-
+  cd "$d" || exit
+
+  # Set PATS to a list of globbing patterns that expand to
+  # file names to be put into the .tar.gz for sources.
+  # Omit patterns that do not expand to file names.
+  pats=
+  for pat in '*.texinfo' '*.texi' '*.txi' '*.eps'; do
+    for file in $pat; do
+      test "$file" = "$pat" && test ! -e "$file" || pats="$pats $pat"
+      break
+    done
+  done
+
+  tar -czhf "$abs_outdir/$PACKAGE.texi.tar.gz" \
+    -- $pats ${source_extra-"$source_extra"} &&
   ls -l "$abs_outdir/$PACKAGE.texi.tar.gz"
-)
+) || exit
 texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"`
 
 # \f