[Python-checkins] CVS: python/dist/src/Doc/tools mkhowto,1.29,1.30

Fred L. Drake fdrake@users.sourceforge.net
Tue, 30 Oct 2001 08:09:53 -0800


Update of /cvsroot/python/python/dist/src/Doc/tools
In directory usw-pr-cvs1:/tmp/cvs-serv7491

Modified Files:
	mkhowto 
Log Message:
Add a new option, --dvips-safe, which sets the $DVIPS_SAFE option in
LaTeX2HTML.  This is not safe to do in general (for the reasons LaTeX2HTML
protects against dvips to begin with), but is safe if we do not actually
need to run dvips.  Note that we also assume it is safe if the user
specifically requests PostScript generation.  See the comments for further
explanation.


Index: mkhowto
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkhowto,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** mkhowto	2001/08/10 20:17:09	1.29
--- mkhowto	2001/10/30 16:09:51	1.30
***************
*** 110,113 ****
--- 110,135 ----
      up_title = None
      #
+     # 'dvips_safe' is a weird option.  It is used mostly to make
+     # LaTeX2HTML not try to be too smart about protecting the user
+     # from a bad version of dvips -- some versions would core dump if
+     # the path to the source DVI contained a dot, and it's appearantly
+     # difficult to determine if the version available has that bug.
+     # This option gets set when PostScript output is requested
+     # (because we're going to run dvips regardless, and we'll either
+     # know it succeeds before LaTeX2HTML is run, or we'll have
+     # detected the failure and bailed), or the user asserts that it's
+     # safe from the command line.
+     #
+     # So, why does LaTeX2HTML think it appropriate to protect the user
+     # from a dvips that's only potentially going to core dump?  Only
+     # because they want to avoid doing a lot of work just to have to
+     # bail later with no useful intermediates.  Unfortunately, they
+     # bail *before* they know whether dvips will be needed at all.
+     # I've gone around the bush a few times with the LaTeX2HTML
+     # developers over whether this is appropriate behavior, and they
+     # don't seem interested in changing their position.
+     #
+     dvips_safe = 0
+     #
      DEFAULT_FORMATS = ("html",)
      ALL_FORMATS = ("dvi", "html", "pdf", "ps", "text")
***************
*** 132,140 ****
                                      "about=", "numeric", "style=", "paper=",
                                      "up-link=", "up-title=", "dir=",
!                                     "global-module-index="]
                                     + list(self.ALL_FORMATS))
          for opt, arg in opts:
              if opt == "--all":
                  self.formats = list(self.ALL_FORMATS)
              elif opt in ("-H", "--help"):
                  usage(self)
--- 154,163 ----
                                      "about=", "numeric", "style=", "paper=",
                                      "up-link=", "up-title=", "dir=",
!                                     "global-module-index=", "dvips-safe"]
                                     + list(self.ALL_FORMATS))
          for opt, arg in opts:
              if opt == "--all":
                  self.formats = list(self.ALL_FORMATS)
+                 self.dvips_safe = "ps" in self.formats
              elif opt in ("-H", "--help"):
                  usage(self)
***************
*** 186,189 ****
--- 209,214 ----
              elif opt == "--paper":
                  self.paper = arg
+             elif opt == "--dvips-safe":
+                 self.dvips_safe = 1
              #
              # Format specifiers:
***************
*** 203,206 ****
--- 228,234 ----
          """Add a format to the formats list if not present."""
          if not format in self.formats:
+             if format == "ps":
+                 # assume this is safe since we're going to run it anyway
+                 self.dvips_safe = 1
              self.formats.append(format)
  
***************
*** 452,455 ****
--- 480,484 ----
          l2hoption(fp, "EXTERNAL_UP_TITLE", options.up_title)
          l2hoption(fp, "GLOBAL_MODULE_INDEX", options.global_module_index)
+         l2hoption(fp, "DVIPS_SAFE", options.dvips_safe)
          fp.write("1;\n")
          fp.close()