[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#347992: tetex-base: mptopdf fails when src file is not in current dir



Package: tetex-base
Version: 3.0-11
Severity: normal
File: /usr/share/texmf-tetex/scripts/context/perl/mptopdf.pl

If you run mptopdf on a metapost eps file in a subdirectory, then
mptopdf reports that it converted it.  However, it actualy leaves the
output in ./mpbasename.pdf.  For example:

$ mptopdf xyz/fig.11
This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
...
Output written on fig.pdf (1 page, 13923 bytes).
MPtoPDF 1.3 : xyz/fig.11 is converted to xyz/fig-11.pdf
$ ls -l xyz/fig-11.pdf
ls: xyz/fig-11.pdf: No such file or directory
$ ls -l fig.pdf  # here it is
-rw-r--r--  1 sanjoy sanjoy 13923 2006-01-13 16:27 fig.pdf

Here is a patch:

--- mptopdf.pl.bak	2004-08-31 06:06:09.000000000 -0400
+++ mptopdf.pl	2006-01-13 16:37:15.000000000 -0500
@@ -22,6 +22,7 @@
 use Config ;
 use Getopt::Long ;
 use strict ;
+use File::Basename;
 
 $Getopt::Long::passthrough = 1 ; # no error message
 $Getopt::Long::autoabbrev  = 1 ; # partial switch accepted
@@ -106,8 +107,9 @@
           { system ("$command   \\relax $file") }
         else
           { system ("$command \\\\relax $file") }
-        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") }
         if ($done) { $report .= " +" }
         $report .= " $_-$1.pdf" ;
         ++$done } }


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages tetex-base depends on:
ii  dpkg                         1.13.11.0.1 package maintenance system for Deb
ii  tex-common                   0.13        Common infrastructure for using an
ii  ucf                          2.004       Update Configuration File: preserv

Versions of packages tetex-base recommends:
ii  tetex-doc                     3.0-11     The documentation component of the

Versions of packages tetex-bin depends on:
ii  debconf [debconf-2.0]    1.4.65          Debian configuration management sy
ii  debianutils              2.15.2          Miscellaneous utilities specific t
ii  dpkg                     1.13.11.0.1     package maintenance system for Deb
ii  ed                       0.2-20          The classic unix line editor
ii  libc6                    2.3.5-8         GNU C Library: Shared libraries an
ii  libcairo2                1.0.2-3         The Cairo 2D vector graphics libra
ii  libfontconfig1           2.3.2-1         generic font configuration library
ii  libfreetype6             2.1.7-2.4       FreeType 2 font engine, shared lib
ii  libgcc1                  1:4.0.2-5       GCC support library
ii  libice6                  6.8.2.dfsg.1-11 Inter-Client Exchange library
ii  libjpeg62                6b-10           The Independent JPEG Group's JPEG 
ii  libkpathsea4             3.0-12          path search library for teTeX (run
ii  libpaper1                1.1.14-3        Library for handling paper charact
ii  libpng12-0               1.2.8rel-5      PNG library - runtime
ii  libpoppler0c2            0.4.2-1         PDF rendering library
ii  libsm6                   6.8.2.dfsg.1-11 X Window System Session Management
ii  libstdc++6               4.0.2-5         The GNU Standard C++ Library v3
ii  libt1-5                  5.1.0-2         Type 1 font rasterizer library - r
ii  libx11-6                 6.8.2.dfsg.1-11 X Window System protocol client li
ii  libxaw8                  6.8.2.dfsg.1-11 X Athena widget set library
ii  libxext6                 6.8.2.dfsg.1-11 X Window System miscellaneous exte
ii  libxmu6                  6.8.2.dfsg.1-11 X Window System miscellaneous util
ii  libxp6                   6.8.2.dfsg.1-11 X Window System printing extension
ii  libxpm4                  6.8.2.dfsg.1-11 X pixmap library
ii  libxrender1              1:0.9.0-2       X Rendering Extension client libra
ii  libxt6                   6.8.2.dfsg.1-11 X Toolkit Intrinsics
ii  mime-support             3.35-1          MIME files 'mime.types' & 'mailcap
ii  perl                     5.8.7-9         Larry Wall's Practical Extraction 
ii  sed                      4.1.2-8         The GNU sed stream editor
ii  ucf                      2.004           Update Configuration File: preserv
ii  zlib1g                   1:1.2.3-8       compression library - runtime

Versions of packages tetex-extra depends on:
ii  dpkg                         1.13.11.0.1 package maintenance system for Deb
ii  tetex-bin                    3.0-12      The teTeX binary files
ii  ucf                          2.004       Update Configuration File: preserv

-- debconf information:
  tetex-base/olddat: true
  tetex-base/fmtutil-failed:
  tetex-bin/upd_map: true
* tetex-bin/cnf_name:
  tetex-bin/fmtutil: true
  tetex-bin/fmtutil-failed:
  tetex-bin/userperm: false
* tetex-bin/texmf: true
  tetex-bin/updmap-failed:
* tetex-bin/hyphen:
  tetex-bin/oldcfg: true
  tetex-base/oldcfg: true
* tetex-base/oldupdm: true
  tetex-base/updmap-failed:
* tetex-bin/use_debconf: true
* tetex-bin/groupname: users
  tetex-bin/groupperm: true
* tetex-bin/lsr-perms: true



Reply to: