diff options
author | Andreas Scherer <andreas_tex@freenet.de> | 2019-12-13 18:23:33 +0000 |
---|---|---|
committer | Andreas Scherer <andreas_tex@freenet.de> | 2019-12-13 18:23:33 +0000 |
commit | 84142cd1f4cc8ea40a1126bf719747411d3bc132 (patch) | |
tree | 3f52f06ab49f6ea4fc4fce68ffe9975e00022521 /Build/source | |
parent | 28474dfac883bc6dbf88a377bf6479f5b8d6817b (diff) |
Apply Debian patch correctly and simplify @files loop.
git-svn-id: svn://tug.org/texlive/trunk@53115 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/context/perl/mptopdf.pl | 66 |
1 files changed, 28 insertions, 38 deletions
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 165d4d2179f..d5d238ce1e7 100755 --- a/Build/source/texk/texlive/linked_scripts/context/perl/mptopdf.pl +++ b/Build/source/texk/texlive/linked_scripts/context/perl/mptopdf.pl @@ -118,47 +118,37 @@ 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 ($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 ; - } - # 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" ; - } - if ($done) { - $report .= " +" ; + 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") ; } - # $report .= " $_-$1.pdf" ; - $report .= " $pdf" ; - ++$done ; + $pdf = "$base-$suffix.pdf" ; + } + if ($done) { + $report .= " +" ; } + $report .= " $pdf" ; + ++$done ; } if ($report eq '') { |