texlive[42895] Build/source/extra/epstopdf: epstopdf 2.26:

commits+karl at tug.org commits+karl at tug.org
Sun Jan 8 01:10:22 CET 2017


Revision: 42895
          http://tug.org/svn/texlive?view=revision&revision=42895
Author:   karl
Date:     2017-01-08 01:10:22 +0100 (Sun, 08 Jan 2017)
Log Message:
-----------
epstopdf 2.26: (errorUsage): prepend program name.
allow infile outfile.pdf command line.
allow -o and --output as synonyms for --outfile.
Suggestion from Ryo Furue, original patch from Norbert Preining:
http://tug.org/pipermail/tex-k/2017-January/002735.html

Modified Paths:
--------------
    trunk/Build/source/extra/epstopdf/Makefile
    trunk/Build/source/extra/epstopdf/README
    trunk/Build/source/extra/epstopdf/epstopdf.1
    trunk/Build/source/extra/epstopdf/epstopdf.pl

Modified: trunk/Build/source/extra/epstopdf/Makefile
===================================================================
--- trunk/Build/source/extra/epstopdf/Makefile	2017-01-07 23:39:19 UTC (rev 42894)
+++ trunk/Build/source/extra/epstopdf/Makefile	2017-01-08 00:10:22 UTC (rev 42895)
@@ -6,20 +6,22 @@
 re2p = ./r$(prg) --restricted
 re2p_script = ./r$(prg)
 
-default: 
+default: check
 
+$(re2p_script):
+	ln -s $(prg).pl $@
+
 # These are not comprehensive tests by any means.  Mostly we're just
 # making sure we don't crash.
-check: check-help check-version \
-       check-help-r \
+check: check-help check-version check-help-r check-usage \
        check-atend \
        check-binary check-bin2 \
        check-binhdr-lf check-binhdr-cr check-binhdr-crlf \
+       check-filter check-filter-outfile \
        check-gray \
        check-gscmd check-gsopt check-gsopts \
-       check-filter check-filter-outfile \
-       check-gscmd \
        check-nogs \
+       check-output \
        check-percent \
        check-restricted-device \
        check-restricted-gscmd \
@@ -37,25 +39,22 @@
 check-help-r: $(re2p_script)
 	$(re2p_script) --help | grep restricted  # should have default=true
 
-check-nogs:
-	$(e2p) --no-gs test-simple.eps >test-simple.out
-# the two files should be different:
-	cmp -s test-simple.eps test-simple.out || exit 0
-	
-$(re2p_script):
-	ln -s $(prg).pl $@
+check-usage:
+	! $(e2p)                 # no args
+	! $(e2p) arg1 arg2 arg3  # too many args
+	! $(e2p) --nonesuch      # no option
 
-check-restricted-device:
+check-restricted-device: $(re2p_script)
 	! $(re2p) --device=unsafe test-simple.eps
 
-check-restricted-gscmd:
+check-restricted-gscmd: $(re2p_script)
 	! $(re2p) --gscmd=/bin/unsafe test-simple.eps
 	! $(re2p) --gscmd=unsafe test-simple.eps
 
-check-restricted-safe-in:
+check-restricted-safe-in: $(re2p_script)
 	! $(re2p) /unsafe/in.eps
 
-check-restricted-safe-out:
+check-restricted-safe-out: $(re2p_script)
 	! $(re2p) test-simple.eps -o /unsafe/out.eps
 
 check-filter:
@@ -90,6 +89,24 @@
 	$(e2p) --gscmd=echo --gsopts='foo bar' test-simple.eps
 	! $(e2p) --restricted --gsopts=bar test-simple.eps # fails
 
+check-nogs:
+	$(e2p) --no-gs test-simple.eps >test-simple.out
+# the two files should be different:
+	cmp -s test-simple.eps test-simple.out || exit 0
+	
+check-output: $(re2p_script)
+	$(re2p) test-simple.eps -o test-p.pdf               # not if restricted
+	# should do this everywhere -- remove first, validate after.
+	#rm -f test-o.pdf; $(e2p) -o test-o.pdf test-simple.eps; pdfinfo test-o.pdf
+	$(e2p) -o test-o.pdf test-simple.eps
+	$(e2p) --outfile test-o.pdf test-simple.eps
+	$(e2p) --outfile=test-o.pdf test-simple.eps
+	$(e2p) --output test-o.pdf test-simple.eps
+	$(e2p) test-simple.eps test-p.pdf
+	$(re2p) test-simple.eps test-p.pdf
+	! $(e2p) test-simple.eps test-p.pdg                # not .pdf
+	! $(e2p) -o test-o.pdf test-simple.eps test-p.pdf  # two methods
+
 check-simple:
 	$(MAKE) file=test-simple check1
 
@@ -126,10 +143,12 @@
 check-floral:
 	$(MAKE) file=test-floral check1
 
+# subtarget for simple test that conversion of $(file) works.
 check1:
 	$(e2p) $(file).eps 
 	pdfinfo $(file).pdf | grep "Page size"
 
+# 

 # put tar contents in a directory for CTAN.
 dist: $(prg).tar.gz $(prg).html
 .PHONY: dist

Modified: trunk/Build/source/extra/epstopdf/README
===================================================================
--- trunk/Build/source/extra/epstopdf/README	2017-01-07 23:39:19 UTC (rev 42894)
+++ trunk/Build/source/extra/epstopdf/README	2017-01-08 00:10:22 UTC (rev 42895)
@@ -3,7 +3,7 @@
 
 This is the README for the epstopdf script distribution.
 
-Primary distribution point: http://mirror.ctan.org/support/epstopdf/
+Primary distribution point: http://ctan.org/pkg/epstopdf
   (list of mirrors at: http://ctan.org/mirrors)
 
 Home page: http://tug.org/epstopdf/
@@ -15,7 +15,12 @@
 options, so the problem can be reproduced.
 
 -------------------------------------------------------------------------
-The test-binary and test-bin2 files were supplied by Akira Kakuto and
+Various test files and a Makefile to drive them are in the source
+repository, which is currently a subdirectory of the texlive Subversion
+repo, purely for the developers' convenience:
+  http://tug.org/svn/texlive/trunk/Build/source/extra/epstopdf/
+
+The test-binary and test-bin2 files there were supplied by Akira Kakuto and
 Reinhard Kotucha.  They contain binary data.  They are public domain.
 
 The test-binhdr* files were supplied by Martin von Gagern, constructed

Modified: trunk/Build/source/extra/epstopdf/epstopdf.1
===================================================================
--- trunk/Build/source/extra/epstopdf/epstopdf.1	2017-01-07 23:39:19 UTC (rev 42894)
+++ trunk/Build/source/extra/epstopdf/epstopdf.1	2017-01-08 00:10:22 UTC (rev 42895)
@@ -1,9 +1,9 @@
-.TH EPSTOPDF 1 "28 May 2016"
+.TH EPSTOPDF 1 "7 January 2017"
 .\" $Id$
 .SH NAME
 epstopdf, repstopdf \- convert an EPS file to PDF
 .SH SYNOPSIS
-\fBepstopdf\fP [\fIoptions\fP] [\fIepsfile\fP]
+\fBepstopdf\fP [\fIoptions\fP] [\fIepsfile\fP [\fIpdffile\fP.pdf]]
 .SH DESCRIPTION
 By default, \fBepstopdf\fP converts the input PostScript file to PDF,
 using Ghostscript.
@@ -14,6 +14,11 @@
 BoundingBox.  Thus, the result needs no cropping, and the PDF MediaBox
 is correct.  
 .PP
+By default, the output name is the input name with any extension
+replaced by \fB.pdf\fP.  An output name ending with .pdf can also be given
+as a second argument on the command line, or the \fB--outfile\fP
+(\fB-o\fP) option can be used with any name.
+.PP
 PJL commands at the start of a file are removed.  DOS EPS binary files
 (TN 5002) are supported.
 .PP
@@ -107,6 +112,7 @@
 These examples all equivalently convert `test.eps' to `test.pdf':
 .nf
 epstopdf test.eps
+epstopdf test.eps test.pdf
 cat test.eps | epstopdf --filter >test.pdf
 cat test.eps | epstopdf -f -o=test.pdf
 .fi

Modified: trunk/Build/source/extra/epstopdf/epstopdf.pl
===================================================================
--- trunk/Build/source/extra/epstopdf/epstopdf.pl	2017-01-07 23:39:19 UTC (rev 42894)
+++ trunk/Build/source/extra/epstopdf/epstopdf.pl	2017-01-08 00:10:22 UTC (rev 42895)
@@ -34,9 +34,12 @@
 # "%%BoundingBox: (atend)" when input is not seekable (e.g., from a pipe),
 #
 # emacs-page
-my $ver = "2.25";
-
-# History
+#
+my $ver = "2.26";
+#  2017/01/07 v2.26 (Norbert Preining, Karl Berry)
+#    * allow cmdline of infile outfile.pdf.
+#    * explicitly allow -o as abbreviation for --outfile,
+#      to guard against future --options. (Also --output.)
 #  2016/06/30 v2.25 (Norbert Preining, Karl Berry)
 #    * don't set (default) device until after restricted check.
 #    * a few more debugging lines.
@@ -182,7 +185,7 @@
 my $program = "epstopdf";
 my $ident = '($Id$)' . " $ver";
 my $copyright = <<END_COPYRIGHT ;
-Copyright 2009-2016 Karl Berry et al.
+Copyright 2009-2017 Karl Berry et al.
 Copyright 2002-2009 Gerben Wierda et al.
 Copyright 1998-2001 Sebastian Rahtz et al.
 License RBSD: Revised BSD <http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5>
@@ -331,10 +334,15 @@
 my $rotmsg = $::opt_autorotate ? $::opt_autorotate : "[use gs default]";
 
 my $usage = <<"END_OF_USAGE";
-${title}Usage: $program [OPTION]... [EPSFILE]
+${title}Usage: $program [OPTION]... [EPSFILE [PDFFILE.pdf]]
 
-Convert EPS to PDF (or other formats), by default using Ghostscript.
+Convert an EPS file to PDF (or other formats), by default using Ghostscript.
 
+By default, the output name is the input name with any extension
+replaced by ".pdf".  An output name ending with .pdf can also be given
+as a second argument on the command line, or the --outfile (-o) option
+can be used with any name.
+
 The resulting output is guaranteed to start at the 0,0 coordinate, and
 sets a page size exactly corresponding to the BoundingBox.  Thus, the
 result does not need any cropping, and the PDF MediaBox is correct.
@@ -346,7 +354,7 @@
   --help             display this help and exit
   --version          display version information and exit
 
-  --outfile=FILE     write result to FILE   (default based on input name)
+  -o, --outfile=FILE write result to FILE   (default based on input name)
   --restricted       use restricted mode    (default: $bool[$restricted])
 
   --(no)debug        output debugging info  (default: $bool[$::opt_debug])
@@ -376,6 +384,7 @@
 
 Examples all equivalently converting test.eps to test.pdf:
   \$ $program test.eps
+  \$ $program test.eps test.pdf
   \$ cat test.eps | $program --filter >test.pdf
   \$ cat test.eps | $program -f -o=test.pdf
 
@@ -428,7 +437,7 @@
   "gsopts=s" => \&gsopts, # \ref{val_gsopts}
   "help|h",
   "hires!",
-  "outfile=s",            # \ref{openout_any}
+  "outfile|output|o=s",   # \ref{openout_any}
   "pdfsettings=s",
   "quiet",
   "res=s",
@@ -447,7 +456,7 @@
 sub debug      { print STDERR "* @_\n" if $::opt_debug; }
 sub warning    { print STDERR "==> Warning: @_\n"; }
 sub error      { die "$title!!! Error: @_\n"; }
-sub errorUsage { die "Error: @_ (try --help for more information)\n"; }
+sub errorUsage { die "$program: Error: @_ (try --help for more information)\n"; }
 sub warnerr    { $restricted ? error(@_) : warning(@_); }
 
 ### debug messages
@@ -480,13 +489,13 @@
 ### help, version options.
 if ($::opt_help) {
   print $usage;
-  exit (0);
+  exit 0;
 }
 
 if ($::opt_version) {
   print $title;
   print $copyright;
-  exit (0);
+  exit 0;
 }
 
 ### get input filename (\ref{openin_any} for validation)
@@ -496,10 +505,24 @@
     errorUsage "Input file cannot be used with filter option";
   debug "Filtering: will read standard input";
 } else {
+  # not filtering.
   @ARGV > 0 or errorUsage "Input filename missing";
-  @ARGV < 2 or errorUsage "Unknown option or too many input files";
+  # allow infile outfile.pdf.
+  if (@ARGV == 2) {
+    if ($::opt_outfile) {
+      errorUsage ("Multiple output specifications: second arg=$ARGV[1],"
+                  . " --outfile=$::opt_outfile");
+    }
+    if ($ARGV[1] !~ m/\.pdf$/i) {
+      errorUsage "Output file argument requires .pdf extension: $ARGV[1]";
+    }
+    # seems we can use it.
+    $::opt_outfile = $ARGV[1];
+    debug "Output filename from argv:", $::opt_outfile;
+  }
+  @ARGV > 2 and errorUsage "Too many arguments: @ARGV";
+  
   $InputFilename = $ARGV[0];
-  #-r $InputFilename or error "\"$InputFilename\" not readable";
   debug "Input filename:", $InputFilename;
 }
 



More information about the tex-live-commits mailing list