bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

texi2dvi: Honor -o


From: Akim Demaille
Subject: texi2dvi: Honor -o
Date: Mon, 07 Mar 2005 17:32:49 +0100
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux)

The recent change that detached --output from --clean no longer honors
--output.  In addition, I recently found a case where thumbpdf fails
(because of gs), but the resulting PDF without thumbs is better than
nothing.

I would like to emphasize that we lost something since -o no longer
implies -c: we can't read the file while we compile, no even the old
file.  I think it would be nice from texi2dvi to support this.  In
fact, I think it should always offer this service: compile to an
auxiliary output, and mv it only at the end, so that xpdf and other
xdvi don't die on an incomplete file.  WDYT?  Do you know of any means
to tell (pdf)tex to --output to another file?

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * util/texi2dvi: Fix -o when -c is not passed.
        Don't make thumbpdf failures fatal.

Index: util/texi2dvi
===================================================================
RCS file: /cvsroot/texinfo/texinfo/util/texi2dvi,v
retrieving revision 1.47
diff -u -u -r1.47 texi2dvi
--- util/texi2dvi 28 Feb 2005 13:41:03 -0000 1.47
+++ util/texi2dvi 7 Mar 2005 16:32:10 -0000
@@ -818,30 +818,37 @@
      && grep 'thumbpdf\.sty'  "$filename_noext.log" >&6 2>&1; \
   then
     verbose "Running $thumbpdf $filename_noext ..."
-    $thumbpdf "$filename_noext" >&5 ||
-      fatal 1 "$thumbpdf exited with bad status, quitting."
-    run_tex
+    if $thumbpdf "$filename_noext" >&5; then
+      run_tex
+    else
+      report "$thumbpdf exited with bad status." \
+            "Ignoring its output."
+    fi
   fi
 
+  # Honor the actual output destination.
+  case $clean:$oname in
+    :) dest=;;
 
-  # If we were in clean mode, compilation was in a tmp directory.
-  # Copy the DVI (or PDF) file into the directory where the compilation
-  # has been done.  (The temp dir is about to get removed anyway.)
-  # We also return to the original directory so that
-  # - the next file is processed in correct conditions
-  # - the temporary file can be removed
-  if test -n "$clean"; then
-    if test -n "$oname"; then
-       dest=$oname
-    else
-       dest=$orig_pwd
-    fi
+    t:)  # If we were in clean mode, compilation was in a tmp
+        # directory.  Copy the DVI (or PDF) file into the directory
+        # where the compilation has been done.  (The temp dir is
+        # about to get removed anyway.)
+        dest=$orig_pwd;;
+
+    *:*) dest=$oname;;
+  esac
+  if test -n "$dest"; then
     verbose "Copying $oformat file from `pwd` to $dest"
     cp -p "./$filename_noext.$oformat" "$dest"
-    cd / # in case $orig_pwd is on a different drive (for DOS)
-    cd $orig_pwd || exit 1
   fi
 
+  # Return to the original directory so that
+  # - the next file is processed in correct conditions
+  # - the temporary file can be removed
+  cd / # in case $orig_pwd is on a different drive (for DOS)
+  cd $orig_pwd || exit 1
+
   # Remove temporary files.
   if test "x$debug" = "x"; then
     verbose "Removing $tmpdir_src $tmpdir_xtr $tmpdir_bak ..."





reply via email to

[Prev in Thread] Current Thread [Next in Thread]