diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 08:56:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 08:56:01 +0000 |
commit | 502c540485a1626fce474639d572904a4e3c55fe (patch) | |
tree | c8bb1ed8bda9ce49697a30eaab650191e9462e2a /build-aux/gendocs.sh | |
parent | Adding debian version 1.21.4-1. (diff) | |
download | wget-502c540485a1626fce474639d572904a4e3c55fe.tar.xz wget-502c540485a1626fce474639d572904a4e3c55fe.zip |
Merging upstream version 1.24.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'build-aux/gendocs.sh')
-rwxr-xr-x | build-aux/gendocs.sh | 80 |
1 files changed, 66 insertions, 14 deletions
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh index 1ad5cf4..60447d4 100755 --- a/build-aux/gendocs.sh +++ b/build-aux/gendocs.sh @@ -2,9 +2,9 @@ # 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=2023-01-21.00 +scriptversion=2024-01-27.16 -# Copyright 2003-2023 Free Software Foundation, Inc. +# Copyright 2003-2024 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -66,14 +66,14 @@ generate_html=true generate_info=true generate_tex=true outdir=manual -source_extra= +unset source_extra split=node srcfile= texarg="-t @finalout" version="gendocs.sh $scriptversion -Copyright 2023 Free Software Foundation, Inc. +Copyright 2024 Free Software Foundation, Inc. There is NO warranty. You may redistribute this software under the terms of the GNU General Public License. For more information about these matters, see the files named COPYING." @@ -167,7 +167,7 @@ while test $# -gt 0; do --html) shift; default_htmlarg=false; htmlarg=$1;; --info) shift; infoarg=$1;; --no-ascii) generate_ascii=false;; - --no-html) generate_ascii=false;; + --no-html) generate_html=false;; --no-info) generate_info=false;; --no-tex) generate_tex=false;; --source) shift; source_extra=$1;; @@ -416,11 +416,49 @@ fi # end html printf "\nMaking .tar.gz for sources...\n" d=`dirname $srcfile` ( - cd "$d" - srcfiles=`ls -d *.texinfo *.texi *.txi *.eps $source_extra 2>/dev/null` || true - tar czfh "$abs_outdir/$PACKAGE.texi.tar.gz" $srcfiles - ls -l "$abs_outdir/$PACKAGE.texi.tar.gz" -) + 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= + + 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 + + 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"` # @@ -466,11 +504,25 @@ fi # printf "\nMaking index.html for %s...\n" "$PACKAGE" if test -z "$use_texi2html"; then - CONDS="/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\ - /%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d" + if test x$split = xnode; then + CONDS="/%%IF *HTML_NODE%%/d;/%%ENDIF *HTML_NODE%%/d;\ + /%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d;\ + /%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;" + elif test x$split = xchapter; then + CONDS="/%%IF *HTML_CHAPTER%%/d;/%%ENDIF *HTML_CHAPTER%%/d;\ + /%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\ + /%%IF *HTML_NODE%%/,/%%ENDIF *HTML_NODE%%/d;" + elif test x$split = xsection; then + CONDS="/%%IF *HTML_SECTION%%/d;/%%ENDIF *HTML_SECTION%%/d;\ + /%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d;\ + /%%IF *HTML_NODE%%/,/%%ENDIF *HTML_NODE%%/d;" + else + CONDS="/%%IF.*%%/d;/%%ENDIF.*%%/d;" # invalid split argument + fi else - # should take account of --split here. - CONDS="/%%ENDIF.*%%/d;/%%IF *HTML_SECTION%%/d;/%%IF *HTML_CHAPTER%%/d" + # for texi2html, we do not take account of --split and simply output + # all variants + CONDS="/%%IF.*%%/d;/%%ENDIF.*%%/d;" fi curdate=`$SETLANG date '+%B %d, %Y'` |