]> Savannah Git Hosting - gnulib.git/commitdiff
gendocs: get only targetted manual source and includes, when possible
authorPatrice Dumas <pertusus@free.fr>
Mon, 29 Jan 2024 17:39:44 +0000 (18:39 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 29 Jan 2024 17:39:44 +0000 (18:39 +0100)
* build-aux/gendocs.sh: if makeinfo, based on version, has the
--trace-includes option, gather only the targetted manual srcfile and
the included files obtained with makeinfo --trace-includes. In that
case output include files to tar stdin and use -T-. Bruno Haible for
the version comparison and use of tar.

ChangeLog
build-aux/gendocs.sh

index dff23544d06cb3f9c0b8372a5092fc0d9acf2178..3ada614959ef01f59816df5308ceccd053dc4361 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-01-29  Patrice Dumas  <pertusus@free.fr>
+
+       gendocs: get only targetted manual source and includes, when possible
+       * build-aux/gendocs.sh: if makeinfo, based on version, has the
+       --trace-includes option, gather only the targetted manual srcfile and
+       the included files obtained with makeinfo --trace-includes. In that
+       case output include files to tar stdin and use -T-. Bruno Haible for
+       the version comparison and use of tar.
+
 2024-01-29  Bruno Haible  <bruno@clisp.org>
 
        Port FALLTHROUGH to Mac OS X 10.9.
index bdf105e02bfd06c469a8d3ba5b47bde96dfcb90c..60447d4f5c327e181372e23e26eb7e1e5271635d 100755 (executable)
@@ -422,16 +422,42 @@ d=`dirname $srcfile`
   # 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
+
+  if case `$MAKEINFO --version | sed -e 's/^[^0-9]*//' -e 1q` in \
+       [1-6]* | 7.[01]*) false;; \
+       *) true;; \
+     esac \
+  ; then
+
+    for pat in '*.eps'; do
+      for file in $pat; do
+        test "$file" = "$pat" && test ! -e "$file" || pats="$pats $pat"
+        break
+      done
+    done
+
+    # if $MAKEINFO is recent enough, use --trace-includes on the
+    # $srcfile to get the included files of the targetted manual only
+    base=`basename "$srcfile"`
+
+    cmd="$SETLANG $MAKEINFO $commonarg --trace-includes \"$base\""
+    eval "$cmd" \
+    | tar -czhf "$abs_outdir/$PACKAGE.texi.tar.gz" \
+        --verbatim-files-from -T- -- "$base" $pats \
+        ${source_extra+"$source_extra"} \
+    && ls -l "$abs_outdir/$PACKAGE.texi.tar.gz"
+  else
+    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
-  done
 
-  tar -czhf "$abs_outdir/$PACKAGE.texi.tar.gz" \
-    -- $pats ${source_extra+"$source_extra"} &&
-  ls -l "$abs_outdir/$PACKAGE.texi.tar.gz"
+    tar -czhf "$abs_outdir/$PACKAGE.texi.tar.gz" \
+       -- $pats ${source_extra+"$source_extra"} \
+    && ls -l "$abs_outdir/$PACKAGE.texi.tar.gz"
+  fi
 ) || exit
 texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"`