[Po4a-commits] "po4a/lib/Locale/Po4a TeX.pm,1.97,1.98"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Sun Feb 22 16:53:36 UTC 2009


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory alioth:/tmp/cvs-serv19723/lib/Locale/Po4a

Modified Files:
	TeX.pm 
Log Message:
	* NEWS,lib/Locale/Po4a/TeX.pm: Use kpsewhich instead of directly
	TEXINPUTS to find included files.


Index: TeX.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TeX.pm,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- TeX.pm	14 Jul 2008 15:45:47 -0000	1.97
+++ TeX.pm	22 Feb 2009 16:53:34 -0000	1.98
@@ -907,8 +907,8 @@
 =item read_file
 
 Recursively read a file, appending included files which are not listed in the
- at exclude_include array.  Included files are searched in the directory of the
-input document or in a directory listed in the TEXINPUTS environment variable.
+ at exclude_include array.  Included files are searched using the B<kpsewhich>
+command from the Kpathsea library.
 
 Except from the file inclusion part, it is a cut and paste from
 Transtractor's read.
@@ -955,18 +955,9 @@
             }
             if ($include) {
                 # search the file
-                foreach (($my_dirname,
-                          defined($ENV{"TEXINPUTS"})?
-                              split(/:/, $ENV{"TEXINPUTS"}):
-                              ".")) {
-                    if      (-r "$_/$newfilename") {
-                        $newfilename = "$_/$newfilename";
-                        last;
-                    } elsif (-r "$_/$newfilename.tex") {
-                        $newfilename = "$_/$newfilename.tex";
-                        last;
-                    }
-                }
+                open (KPSEA, "kpsewhich " . $newfilename . " |");
+                $newfilename = <KPSEA>;
+
                 push @entries, read_file($self,
                                          $newfilename);
                 if ($tag eq "include") {
@@ -1015,18 +1006,8 @@
 sub parse_definition_file {
     my ($self,$filename,$only_try)=@_;
 
-    foreach (($my_dirname,
-              defined($ENV{"TEXINPUTS"})?
-                  split(/:/, $ENV{"TEXINPUTS"}):
-                  ".")) {
-        if ((not defined $_) or (not length $_)) {
-            $_ = ".";
-        }
-        if (-r $_."/".$filename) {
-            $filename = $_."/".$filename;
-            last;
-        }
-    }
+    open (KPSEA, "kpsewhich " . $filename . " |");
+    $filename = <KPSEA>;
 
     if (! open (IN,"<$filename")) {
         warn wrap_mod("po4a::tex",




More information about the Po4a-commits mailing list