From 88ed039ed13674ce7440cc57dba288cf166796fe Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 13 Nov 2023 03:03:52 +0000 Subject: CTAN sync 202311130303 --- macros/texinfo/latest/texi2dvi | 74 +++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'macros/texinfo/latest/texi2dvi') diff --git a/macros/texinfo/latest/texi2dvi b/macros/texinfo/latest/texi2dvi index e65b4cfec7..b9757b9ddd 100644 --- a/macros/texinfo/latest/texi2dvi +++ b/macros/texinfo/latest/texi2dvi @@ -197,7 +197,7 @@ EOF version () { cat < @@ -549,7 +549,7 @@ destdir () } -# move_to_dest FILE... - Move FILE(s) to the place where the user expects. +# move_to_dest FILE - Move FILE to the place where the user expects. # Truly move it, that is, it must not remain in its build location # unless that is also the output location. (Otherwise it might appear # as an extra file in make distcheck.) @@ -558,48 +558,46 @@ destdir () # or an auxiliary file with the same base name. move_to_dest () { -# echo "move_to_dest $*, tidy=$tidy, oname=$oname" - # If we built in place and have no output name, there is nothing to # do, so just return. case $tidy:$oname in false:) return;; esac - for file - do - test -f "$file" \ - || error 1 "no such file or directory: $file" - case $tidy:$oname in - true:) mtd_destdir=$orig_pwd - mtd_destfile=$mtd_destdir/$file;; - true:*) mtd_destfile=`output_base_name "$file"` - mtd_destdir=`dirname "$mtd_destfile"`;; - false:*) mtd_destfile=$oname - mtd_destdir=`dirname "$mtd_destfile"`;; - esac + test -f "$1" || error 1 "no such file or directory: $1" + case $tidy:$oname in + true:) dest=$orig_pwd/$1 ;; + true:*) dest=`output_base_name "$1"` ;; + false:*) dest=$oname ;; + esac - # We want to compare the source location and the output location, - # and if they are different, do the move. But if they are the - # same, we must preserve the source. Since we can't assume - # stat(1) or test -ef is available, resort to comparing the - # directory names, canonicalized with pwd. We can't use cmp -s - # since the output file might not actually change from run to run; - # e.g., TeX DVI output is timestamped to only the nearest minute. - mtd_destdir=`cd "$mtd_destdir" && pwd` - mtd_destbase=`basename "$mtd_destfile"` - - mtd_sourcedir=`dirname "$file"` - mtd_sourcedir=`cd "$mtd_sourcedir" && pwd` - mtd_sourcebase=`basename "$file"` - - if test "$mtd_sourcedir/$mtd_sourcebase" != "$mtd_destdir/$mtd_destbase" - then - verbose "Moving $file to $mtd_destfile" - rm -f "$mtd_destfile" - mv "$file" "$mtd_destfile" + # We want to compare the source location and the output location, + # and if they are different, do the move. But if they are the + # same, we must preserve the source. Since we can't assume + # stat(1) or test -ef is available, resort to comparing the + # directory names, canonicalized with pwd. We can't use cmp -s + # since the output file might not actually change from run to run; + # e.g., TeX DVI output is timestamped to only the nearest minute. + mtd_destdir=`dirname "$dest"` + mtd_destdir=`cd "$mtd_destdir" && pwd` + mtd_destbase=`basename "$dest"` + + mtd_sourcedir=`dirname "$1"` + mtd_sourcedir=`cd "$mtd_sourcedir" && pwd` + mtd_sourcebase=`basename "$1"` + + if test "$mtd_sourcedir/$mtd_sourcebase" != "$mtd_destdir/$mtd_destbase" + then + verbose "Moving $1 to $dest" + rm -f "$dest" + if mv "$1" "$dest" ; then + # For --output, report that the file was moved, as TeX has just + # reported that it wrote output at the original location. + test z"$oname" != z && echo "Moved $1 to $dest" + else + error 1 "Could not move $1 to $dest" fi - done + fi } @@ -1319,7 +1317,9 @@ run_hevea () case $1 in html|text) move_to_dest "$out_base";; info) # There can be foo.info-1, foo.info-2 etc. - move_to_dest "$out_base"*;; + for file in "$out_base"* ; do + move_to_dest "$file" + done ;; esac else error 1 "$run_hevea_name exited with bad status, quitting." -- cgit v1.2.3