forwarded 480725 dev-context@ntg.nl
thanks

Dear Hans, dear Taco,

on the Debian side we got the attached bug report together with a patch
for mptopdf.pl. Can you comment on it, or consider it for inclusion?

Thanks and all the best

Norbert

Please leave [EMAIL PROTECTED] on the Cc list, thanks

-------------------------------------------------------------------------------
Dr. Norbert Preining <[EMAIL PROTECTED]>        Vienna University of Technology
Debian Developer <[EMAIL PROTECTED]>                         Debian TeX Group
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
DARENTH (n.)
Measure = 0.0000176 mg. Defined as that amount of margarine capable of
covering one hundred slices of bread to the depth of one
molecule. This is the legal maximum allowed in sandwich bars in
Greater London.
                        --- Douglas Adams, The Meaning of Liff
--- Begin Message ---
Package: context
Version: 2008.01.28-1
Severity: important
Tags: patch upstream
thanks 

When using mptopdf on a .mp file containing only one figure and thus
using beginfig(-1) to have no numbering of the resulting file at all,
the PDF is not created. This is because mpost produces a .ps file in
this case, while mptopdf.pl expects a suffix containing one or more
digits or being .mps.

Example input .mp file:
##########################
input metauml;
beginfig(-1);
  Begin.b;
  End.e;
  e.w = b.e + (15,0);
  drawObjects(b,e);
  clink(transition)(b, e);
endfig;
end
##########################

The attached patch fixes this bug. Please note, that now the resulting
file has the same name as the input .mp file with "s/.mp$/.pdf/" - not
including the intermediate suffix as it is done with the figure numbers.
It is now also done like this, if the intermediate output file has the
suffix .mps, while I don't know when and why this may occur.

Best regards,
Martin
diff -Naur old/usr/share/texmf/scripts/context/perl/mptopdf.pl new/usr/share/texmf/scripts/context/perl/mptopdf.pl
--- old/usr/share/texmf/scripts/context/perl/mptopdf.pl	2008-05-11 20:27:25.000000000 +0200
+++ new/usr/share/texmf/scripts/context/perl/mptopdf.pl	2008-05-11 20:27:34.000000000 +0200
@@ -120,7 +120,9 @@
 
 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 {
@@ -132,15 +134,17 @@
             $command = "$command \\\\relax $file" ;
         }
         system($command) ;
-        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  ;
     }
 }

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


--- End Message ---
_______________________________________________
dev-context mailing list
dev-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/dev-context

Reply via email to