diff options
Diffstat (limited to 'Build/extra')
-rw-r--r-- | Build/extra/epstopdf/Makefile | 14 | ||||
-rw-r--r-- | Build/extra/epstopdf/epstopdf.1 | 12 | ||||
-rwxr-xr-x | Build/extra/epstopdf/epstopdf.pl | 40 | ||||
-rw-r--r-- | Build/extra/epstopdf/test-dosepsbin.eps | bin | 0 -> 21238 bytes |
4 files changed, 48 insertions, 18 deletions
diff --git a/Build/extra/epstopdf/Makefile b/Build/extra/epstopdf/Makefile index 1d965fac5f5..fe7d3a545d6 100644 --- a/Build/extra/epstopdf/Makefile +++ b/Build/extra/epstopdf/Makefile @@ -17,6 +17,7 @@ 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-dosepsbin \ check-filter check-filter-outfile \ check-gray \ check-gscmd check-gsopt check-gsopts \ @@ -24,9 +25,9 @@ check: check-help check-version check-help-r check-usage \ check-output \ check-pdfversion \ check-percent \ - check-restricted-nosafer \ check-restricted-device \ check-restricted-gscmd \ + check-restricted-nosafer \ check-restricted-outfile \ check-restricted-safe-in check-restricted-safe-out \ check-simple \ @@ -140,6 +141,11 @@ check-binhdr-cr: check-binhdr-crlf: $(MAKE) file=test-binhdr-crlf check1 +# Another DOS EPS binary file. +# Reported to tex-k from Pat Ridley, 26 Sep 2020 12:38:42. +check-dosepsbin: + $(MAKE) file=test-dosepsbin check1 + check-pdfversion: $(e2p) test-simple.eps pdfinfo test-simple.pdf | grep '^PDF version.*1\.5$$' @@ -157,7 +163,11 @@ check-tn5002: # can't override kpsewhich, so just test gs cmd lookup. check-which: - ! $(e2p) --gscmd=/nonesuch test-simple.eps + ! $(e2p) --gscmd=/noneslash test-simple.eps + ! $(e2p) --gscmd=./nonedot test-simple.eps + ! $(e2p) --gscmd=../nonedotdot test-simple.eps + ! $(e2p) --gscmd=nonepath test-simple.eps + ! $(re2p) --gscmd=nonepath test-simple.eps check-write-error: ! $(e2p) test-simple.eps --outfile=/dev/full diff --git a/Build/extra/epstopdf/epstopdf.1 b/Build/extra/epstopdf/epstopdf.1 index d77de631082..88168570079 100644 --- a/Build/extra/epstopdf/epstopdf.1 +++ b/Build/extra/epstopdf/epstopdf.1 @@ -1,4 +1,4 @@ -.TH EPSTOPDF 1 "6 March 2023" +.TH EPSTOPDF 1 "8 July 2023" .\" $Id$ .SH NAME epstopdf, repstopdf \- convert an EPS file to PDF @@ -118,6 +118,10 @@ This must be used if a gs option or its value contains whitespace. In restricted mode, options are limited to those with names and values known to be safe. Some options taking booleans, integers or fixed names are allowed, those taking general strings are not. +.PP +In order to give a comprehensible error message, epstopdf checks whether +kpsewhich and (the specified) gs are found in the current PATH, or +executable if they are specified as absolute names. .SH EXAMPLES These examples all equivalently convert `test.eps' to `test.pdf': @@ -153,7 +157,7 @@ reproduced. \fBpdfcrop\fP(1). .PP The epstopdf LaTeX package, which automates running this script on the -fly under TeX: https://ctan.org/pkg/epstopdf-pkg. +fly under LaTeX: https://ctan.org/pkg/epstopdf-pkg. .SH AUTHOR Originally written by Sebastian Rahtz, for Elsevier Science, with subsequent contributions from Thomas Esser, Gerben Wierda, Heiko @@ -161,9 +165,11 @@ Oberdiek, and many others. Currently maintained by Karl Berry. .PP Man page originally written by Jim Van Zandt. .PP +epstopdf package page on CTAN: https://ctan.org/pkg/epstopdf. +.PP epstopdf home page: https://tug.org/epstopdf. .PP You may freely use, modify and/or distribute this man page. -The epstopdf script is released under a modified BSD license. +The epstopdf script is released under the modified BSD license. .PP $Id$ diff --git a/Build/extra/epstopdf/epstopdf.pl b/Build/extra/epstopdf/epstopdf.pl index 6ab36788d16..e8a74ba52ed 100755 --- a/Build/extra/epstopdf/epstopdf.pl +++ b/Build/extra/epstopdf/epstopdf.pl @@ -36,7 +36,7 @@ # emacs-page # my $ver = "2.32"; -# 2023/07/qqq 2.32 (Karl Berry) +# 2023/07/08 2.32 (Karl Berry) # * check that kpsewhich and gs are in PATH. # * correct TL path for kpsewhich to bin/windows. # 2023/03/06 v2.31 (Karl Berry) @@ -512,34 +512,48 @@ if ($restricted && $on_windows) { } debug "kpsewhich command: $kpsewhich"; -### check that PROG is in PATH and executable, abort if not. -# it'd be better to actually try running the program, but then we'd have -# to either replicate Perl's logic for finding the command interpreter +### check that PROG is in PATH and executable, abort if not. It'd be +# better to actually try running the program, but then we'd have to +# either replicate Perl's logic for finding the command interpreter # (trivial on Unix, complicated on Windows), or do a fork/exec and close -# the file descriptors ourselves, which seems too painful. Instead we'll -# just look along PATH for the program, which is good enough in -# practice for us, since the only goal here is to give a better error -# message if the program isn't available. +# the file descriptors ourselves, which seems too painful. Nor do we +# want to load/assume File::Which. Instead we'll look along PATH +# ourselves, which is good enough in practice for us, since the only +# goal here is to give a better error message if the program isn't +# available. sub check_prog_exists { my ($prog) = @_; + my @w_ext = ("exe", "com", "bat"); debug " Checking if $prog is in PATH"; - if ($prog =~ m,^(/|\./|\.\./),) { + + # absolute unix + if (! $on_windows_or_cygwin && $prog =~ m,^((\.(\.)?)?/),) { return 1 if -x $prog; # absolute or explicitly relative error "Required program $prog not found, given explicit directory"; + + # absolute windows: optional drive letter, then . or .., then \ or /. + } elsif ($on_windows_or_cygwin + && $prog =~ m,^(([a-zA-Z]:)?(\.(\.)?)?[/\\]),) { + return 1 if -x $prog; + for my $ext (@w_ext) { + return 1 if (-x "$prog.$ext"); + } + error "Required program $prog not found, given explicit Windows directory"; } + + # not absolute, check path for my $dir (split ($on_windows_or_cygwin ? ";" : ":", $ENV{"PATH"})) { $dir = "." if $dir eq ""; # empty path element debug " Checking dir $dir"; if (-x "$dir/$prog") { return 1; } elsif ($on_windows_or_cygwin) { - for my $ext ("exe", "com", "bat") { - if (-x "$dir/$prog.$ext") { - return 1; - } + for my $ext (@w_ext) { + return 1 if (-x "$dir/$prog.$ext"); } } } + # if made it through the whole loop, not found, so quit. error "Required program $prog not found in PATH ($ENV{PATH})"; } diff --git a/Build/extra/epstopdf/test-dosepsbin.eps b/Build/extra/epstopdf/test-dosepsbin.eps Binary files differnew file mode 100644 index 00000000000..d5872ae8309 --- /dev/null +++ b/Build/extra/epstopdf/test-dosepsbin.eps |