From 9ee4ded9cfe164f66b345f0687831b6a28984c09 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 14 Dec 2019 23:10:12 +0000 Subject: resync linked_scripts/.../mptopdf to runtime git-svn-id: svn://tug.org/texlive/trunk@53132 c570f23f-e606-0410-a88d-b1316a301751 --- .../texlive/linked_scripts/context/perl/mptopdf.pl | 54 +++++++++++----------- 1 file changed, 26 insertions(+), 28 deletions(-) (limited to 'Build') diff --git a/Build/source/texk/texlive/linked_scripts/context/perl/mptopdf.pl b/Build/source/texk/texlive/linked_scripts/context/perl/mptopdf.pl index d5d238ce1e7..42db9001ec4 100755 --- a/Build/source/texk/texlive/linked_scripts/context/perl/mptopdf.pl +++ b/Build/source/texk/texlive/linked_scripts/context/perl/mptopdf.pl @@ -119,36 +119,34 @@ if (($pattern eq '')||($Help)) { } foreach my $file (@files) { - my ($base, $suffix) = $file =~ m/(\w+)\.(\d+|mps|ps)/ ; - next unless -e $file and defined $suffix ; - my $pdf = $base.".pdf" ; - if ($miktex) { - $command = "pdftex -undump=mptopdf" ; - } else { - $command = "pdftex -fmt=mptopdf -progname=context" ; - } - if ($dosish) { - $command = "$command \\relax $file" ; - } else { - $command = "$command \\\\relax $file" ; - } - my $error = system($command) ; - if ($error) { - print "\n$program : error while processing tex file\n" ; - exit 1 ; - } - if ($suffix =~ m/\d+$/) { - rename ($pdf, "$base-$suffix.pdf") ; - if (-e $pdf) { - CopyFile ($pdf, "$base-$suffix.pdf") ; + $_ = $file ; + if (s/\.(\d+|mps)$// && -e $file) { + if ($miktex) { + $command = "pdftex -undump=mptopdf" ; + } else { + $command = "pdftex -fmt=mptopdf -progname=context" ; } - $pdf = "$base-$suffix.pdf" ; - } - if ($done) { - $report .= " +" ; + if ($dosish) { + $command = "$command \\relax $file" ; + } else { + $command = "$command \\\\relax $file" ; + } + my $error = system($command) ; + if ($error) { + 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 ($done) { + $report .= " +" ; + } + $report .= " $_-$1.pdf" ; + ++$done ; } - $report .= " $pdf" ; - ++$done ; } if ($report eq '') { -- cgit v1.2.3