From 57b0d7836855550a970047e551881fd08e4396f0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 14 Sep 2017 21:41:37 +0000 Subject: --gsopt value extraction and checking git-svn-id: svn://tug.org/texlive/trunk@45306 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/extra/epstopdf/Makefile | 10 +++++++--- Build/source/extra/epstopdf/epstopdf.pl | 11 ++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'Build') diff --git a/Build/source/extra/epstopdf/Makefile b/Build/source/extra/epstopdf/Makefile index c909dccc98b..ef62a30d9ce 100644 --- a/Build/source/extra/epstopdf/Makefile +++ b/Build/source/extra/epstopdf/Makefile @@ -51,6 +51,10 @@ check-restricted-gscmd: $(re2p_script) ! $(re2p) --gscmd=/bin/unsafe test-simple.eps ! $(re2p) --gscmd=unsafe test-simple.eps +check-restricted-gsopt: $(re2p_script) + $(re2p) --gsopt=-dAutoFilterColorImages=true test-simple.eps + ! $(re2p) --gsopt=-dNOSAFER=false test-simple.eps + check-restricted-safe-in: $(re2p_script) ! $(re2p) /unsafe/in.eps @@ -79,15 +83,15 @@ check-write-error: check-gscmd: ! $(e2p) --gscmd=false test-simple.eps - ! $(e2p) --gscmd='foo bar' test-simple.eps # fails + ! $(e2p) --gscmd='foo bar' test-simple.eps check-gsopt: ! $(e2p) --gscmd=false --gsopt=foo --gsopt=bar test-simple.eps - ! $(e2p) --restricted --gsopt=bar test-simple.eps # fails + ! $(e2p) --restricted --gsopt=bar test-simple.eps check-gsopts: $(e2p) --gscmd=echo --gsopts='foo bar' test-simple.eps - ! $(e2p) --restricted --gsopts=bar test-simple.eps # fails + ! $(e2p) --restricted --gsopts=bar test-simple.eps check-nogs: $(e2p) --no-gs test-simple.eps >test-simple.out diff --git a/Build/source/extra/epstopdf/epstopdf.pl b/Build/source/extra/epstopdf/epstopdf.pl index 88bff419b66..10f3026daf4 100755 --- a/Build/source/extra/epstopdf/epstopdf.pl +++ b/Build/source/extra/epstopdf/epstopdf.pl @@ -35,7 +35,11 @@ # # emacs-page # -my $ver = "2.26"; +my $ver = "2.27"; +# 2017/09/14 v2.27 (Karl Berry) +# * extract value from --gsopt with $3 not $2 (extra regexp group +# added previously), and check it with ^(...)$ so anchors apply to all. +# (report to Karl from Yannick Berker, 7 Sep 2017 14:07:09.) # 2017/01/07 v2.26 (Norbert Preining, Karl Berry) # * allow cmdline of infile outfile.pdf. # * explicitly allow -o as abbreviation for --outfile, @@ -295,6 +299,7 @@ my %optcheck = qw< MonoImageFilter /(CCITTFaxEncode|FlateEncode|RunLengthEncode) MonoImageResolution \d+ NOCIE true + NODISPLAY true NOEPS true NOINTERPOLATE true NOPSICC true @@ -628,9 +633,9 @@ foreach my $gsopt (@::opt_gsopt) { my $ok = 0; if ($gsopt =~ /^-[dD]([A-Za-z0-9]+)(=(.*))?$/) { my $name = $1; - my $value = $2; + my $value = $3; $value = 'true' if not defined $value; - if ($optcheck{$name} and $value =~ /^$optcheck{$name}$/) { + if ($optcheck{$name} and $value =~ /^($optcheck{$name})$/) { $ok = 1; } else { -- cgit v1.2.3