develooper Front page | perl.perl5.porters | Postings from November 2010

[PATCH] ExtUtils::ParseXS reads wrong typemap

From:
H.Merijn Brand
Date:
November 21, 2010 23:39
Subject:
[PATCH] ExtUtils::ParseXS reads wrong typemap
Message ID:
20101122083850.6e214faa@pc09.procura.nl
Would it be safe to make ExtUtils::ParseXS read only ONE typemap from
ExtUtils itself? If it finds a typemap from e.g. perl5 it will now read
it after the correct one

With one debugging line added:

$ xsubpp Syck.xs > /dev/null
####### Opening /pro/lib/perl5/5.12.2/ExtUtils/typemap
####### Opening ../../lib/ExtUtils/typemap


The last one is from a perl5.004 installation that installed one level
higher than 5.005 and on:

$ ls ../../lib{/*,}/ExtUtils/typemap
../../lib/5.00503/ExtUtils/typemap  ../../lib/5.13.5/ExtUtils/typemap
../../lib/5.00504/ExtUtils/typemap  ../../lib/5.13.6/ExtUtils/typemap
../../lib/5.10.0/ExtUtils/typemap   ../../lib/5.13.7/ExtUtils/typemap
../../lib/5.10.1/ExtUtils/typemap   ../../lib/5.6.0/ExtUtils/typemap
../../lib/5.11.0/ExtUtils/typemap   ../../lib/5.6.1/ExtUtils/typemap
../../lib/5.11.1/ExtUtils/typemap   ../../lib/5.6.2/ExtUtils/typemap
../../lib/5.11.2/ExtUtils/typemap   ../../lib/5.8.0/ExtUtils/typemap
../../lib/5.11.3/ExtUtils/typemap   ../../lib/5.8.1/ExtUtils/typemap
../../lib/5.11.4/ExtUtils/typemap   ../../lib/5.8.2/ExtUtils/typemap
../../lib/5.11.5/ExtUtils/typemap   ../../lib/5.8.3/ExtUtils/typemap
../../lib/5.12.0/ExtUtils/typemap   ../../lib/5.8.4/ExtUtils/typemap
../../lib/5.12.1/ExtUtils/typemap   ../../lib/5.8.5/ExtUtils/typemap
../../lib/5.12.2/ExtUtils/typemap   ../../lib/5.8.6/ExtUtils/typemap
../../lib/5.13.0/ExtUtils/typemap   ../../lib/5.8.7/ExtUtils/typemap
../../lib/5.13.1/ExtUtils/typemap   ../../lib/5.8.8/ExtUtils/typemap
../../lib/5.13.2/ExtUtils/typemap   ../../lib/5.8.9/ExtUtils/typemap
../../lib/5.13.3/ExtUtils/typemap   ../../lib/ExtUtils/typemap
../../lib/5.13.4/ExtUtils/typemap

--- ../../lib/5.13.7/ExtUtils/ParseXS.pm        2010-11-21 10:28:13.000000000 +0100
+++ /pro/lib/perl5/5.12.2/ExtUtils/ParseXS.pm   2010-11-22 08:33:26.368001586 +0100
@@ -142,6 +142,7 @@ sub process_file {

   push @tm, standard_typemap_locations();

+  my $seen_eu_tm = 0;
   foreach my $typemap (@tm) {
     next unless -f $typemap ;
     # skip directories, binary files etc.
@@ -149,6 +150,7 @@ sub process_file {
       unless -T $typemap ;
     open(TYPEMAP, $typemap)
       or warn ("Warning: could not open typemap file '$typemap': $!\n"), next;
+    $typemap =~ m{/ExtUtils/}i and $seen_eu_tm++ and next;
     my $mode = 'Typemap';
     my $junk = "" ;
     my $current = \$junk;
-->8---

-- 
H.Merijn Brand  http://tux.nl      Perl Monger  http://amsterdam.pm.org/
using 5.00307 through 5.12 and porting perl5.13.x on HP-UX 10.20, 11.00,
11.11, 11.23 and 11.31, OpenSuSE 10.1, 11.0 .. 11.3 and AIX 5.2 and 5.3.
http://mirrors.develooper.com/hpux/           http://www.test-smoke.org/
http://qa.perl.org      http://www.goldmark.org/jeff/stupid-disclaimers/



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About