From e684f0597e24a1d09af301d82b340b2df7cf2080 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 6 Feb 2020 03:01:38 +0000 Subject: CTAN sync 202002060301 --- .../mptopdf/doc/context/scripts/mkii/mptopdf.man | 4 +-- .../pdftex/mptopdf/scripts/context/perl/mptopdf.pl | 30 +++++++++------------- 2 files changed, 14 insertions(+), 20 deletions(-) (limited to 'macros/pdftex') diff --git a/macros/pdftex/mptopdf/doc/context/scripts/mkii/mptopdf.man b/macros/pdftex/mptopdf/doc/context/scripts/mkii/mptopdf.man index 56be818067..545c16fa00 100644 --- a/macros/pdftex/mptopdf/doc/context/scripts/mkii/mptopdf.man +++ b/macros/pdftex/mptopdf/doc/context/scripts/mkii/mptopdf.man @@ -1,6 +1,6 @@ -.TH "mptopdf" "1" "01-01-2019" "version 1.4.1" "convert MetaPost figures to PDF" +.TH "mptopdf" "1" "01-01-2020" "version 1.4.1" "convert MetaPost figures to PDF" .SH NAME -.B mptopdf + mptopdf - convert MetaPost figures to PDF .SH SYNOPSIS .B mptopdf [ .I OPTIONS ... diff --git a/macros/pdftex/mptopdf/scripts/context/perl/mptopdf.pl b/macros/pdftex/mptopdf/scripts/context/perl/mptopdf.pl index 165d4d2179..5fe53c98f4 100644 --- a/macros/pdftex/mptopdf/scripts/context/perl/mptopdf.pl +++ b/macros/pdftex/mptopdf/scripts/context/perl/mptopdf.pl @@ -3,6 +3,12 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $ # MikTeX users can set environment variable TEXSYSTEM to "miktex". +# There have been suggestions to patch this script for dealing with different +# output templates (a relative new metapost feature) but these have given +# unwanted side effects. One can always wrap this script in another script +# to deal with whatever patterns needed. We won't touch what has worked for +# ages. (December 2019) + #D \module #D [ file=mptopdf.pl, #D version=2010.05.28, % 2000.05.29 @@ -118,14 +124,9 @@ if (($pattern eq '')||($Help)) { @files = glob "$pattern" ; } -# this patch was send via debian but is not tested by me - foreach my $file (@files) { $_ = $file ; - # if (s/\.(\d+|mps)$// && -e $file) { - if (s/\.(\d+|mps|ps)$// && -e $file) { - my $suffix = $1 ; - my $pdf = basename($_).".pdf" ; + if (s/\.(\d+|mps)$// && -e $file) { if ($miktex) { $command = "pdftex -undump=mptopdf" ; } else { @@ -141,22 +142,15 @@ foreach my $file (@files) { print "\n$program : error while processing tex file\n" ; exit 1 ; } - # my $pdfsrc = basename($_).".pdf"; - # rename ($pdfsrc, "$_-$1.pdf") ; - # if (-e $pdfsrc) { - # CopyFile ($pdfsrc, "$_-$1.pdf") ; - if ($suffix =~ m/\.\d+$/) { - rename ($pdf, "$_-$suffix.pdf") ; - if (-e $pdf) { - CopyFile ($pdf, "$_-$suffix.pdf") ; - } - $pdf = "$_-$suffix.pdf" ; + my $pdfsrc = basename($_).".pdf"; + rename ($pdfsrc, "$_-$1.pdf") ; + if (-e $pdfsrc) { + CopyFile ($pdfsrc, "$_-$1.pdf") ; } if ($done) { $report .= " +" ; } - # $report .= " $_-$1.pdf" ; - $report .= " $pdf" ; + $report .= " $_-$1.pdf" ; ++$done ; } } -- cgit v1.2.3