+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
# 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.
#
generate_info=true
generate_tex=true
outdir=manual
-source_extra=
+unset source_extra
split=node
srcfile=
texarg="-t @finalout"
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