From dcc773eed69f48d0f2d2df6801dc8c99c2690883 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 16 Jan 2006 18:35:00 +0100 Subject: stable 2006.01.16 18:35 --- scripts/context/perl/mptopdf.pl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/context/perl/mptopdf.pl b/scripts/context/perl/mptopdf.pl index 5f19ecaf4..767d2d260 100644 --- a/scripts/context/perl/mptopdf.pl +++ b/scripts/context/perl/mptopdf.pl @@ -22,6 +22,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $ use Config ; use Getopt::Long ; use strict ; +use File::Basename ; $Getopt::Long::passthrough = 1 ; # no error message $Getopt::Long::autoabbrev = 1 ; # partial switch accepted @@ -43,7 +44,7 @@ my $report = '' ; my $texlatexswitch = " --tex=latex --format=latex " ; my $mplatexswitch = " --tex=latex " ; -my $dosish = ($Config{'osname'} =~ /^(ms)?dos|^os\/2|^(ms|cyg)win/i) ; +my $dosish = ($Config{'osname'} =~/^(ms)?dos|^os\/2|^mswin/i) ; my $miktex = ($ENV{"TEXSYSTEM"} =~ /miktex/io); my $escapeshell = ( ($ENV{'SHELL'}) && ($ENV{'SHELL'} =~ m/sh/i )); @@ -107,8 +108,12 @@ foreach my $file (@files) else { $command = "$command \\\\relax $file" } system($command) ; - rename ("$_.pdf", "$_-$1.pdf") ; - if (-e "$_.pdf") { CopyFile ("$_.pdf", "$_-$1.pdf") } + # rename ("$_.pdf", "$_-$1.pdf") ; + # if (-e "$_.pdf") { CopyFile ("$_.pdf", "$_-$1.pdf") } + my $pdfsrc = basename($_).".pdf"; + rename ($pdfsrc, "$_-$1.pdf") ; + if (-e $pdfsrc) { CopyFile ($pdfsrc, "$_-$1.pdf") } + # end of patch if ($done) { $report .= " +" } $report .= " $_-$1.pdf" ; ++$done } } -- cgit v1.2.3