texlive[53115]

commits+ascherer at tug.org commits+ascherer at tug.org
Fri Dec 13 19:23:33 CET 2019


Revision: 53115
          http://tug.org/svn/texlive?view=revision&revision=53115
Author:   ascherer
Date:     2019-12-13 19:23:33 +0100 (Fri, 13 Dec 2019)
Log Message:
-----------
Apply Debian patch correctly and simplify @files loop.

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/context/perl/mptopdf.pl

Modified: trunk/Build/source/texk/texlive/linked_scripts/context/perl/mptopdf.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/context/perl/mptopdf.pl	2019-12-13 00:54:01 UTC (rev 53114)
+++ trunk/Build/source/texk/texlive/linked_scripts/context/perl/mptopdf.pl	2019-12-13 18:23:33 UTC (rev 53115)
@@ -118,47 +118,37 @@
     @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" ;
+    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") ;
         }
-        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 .= " +" ;
-        }
-      # $report .= " $_-$1.pdf" ;
-        $report .= " $pdf" ;
-        ++$done  ;
+        $pdf = "$base-$suffix.pdf" ;
     }
+    if ($done) {
+        $report .= " +" ;
+    }
+    $report .= " $pdf" ;
+    ++$done  ;
 }
 
 if ($report eq '') {



More information about the tex-live-commits mailing list