tag 479762 confirmed patch
thanks

On Tue, May 06, 2008 at 11:32:16PM +0900, Tatsuya Kinoshita wrote:
> Package: perl
> Version: 5.10.0-9
> Severity: serious
> 
> On the current sid i386 environment, syscall.ph and asm/unistd.ph
> fail as follows:
> 
> ----
> $ perl -e "require 'syscall.ph'"
> Prototype mismatch: sub main::__LONG_MAX__ () vs none at 
> /usr/lib/perl/5.10/_h2ph_pre.ph line 257.
> Constant subroutine __LONG_MAX__ redefined at /usr/lib/perl/5.10/_h2ph_pre.ph 
> line 257.
> Can't locate unistd_32.ph in @INC (@INC contains: /etc/perl 
> /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 
> /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 
> /usr/local/lib/site_perl .) at /usr/lib/perl/5.10/asm/unistd.ph line 6.

The problem is that <asm/unistd.h> uses the quote include syntax
(#include "unistd_32.h") instead of the angle bracket one (#include
<asm/unistd_32.h>), and h2ph ignores those when chasing the files.

Patch attached; this should be forwarded upstream too after verifying 
that it works.
-- 
Niko Tyni   [EMAIL PROTECTED]
Allow the quote mark delimiter also for those #include directives chased with 
"h2ph -a". Debian bug #479762.

diff --git a/utils/h2ph.PL b/utils/h2ph.PL
index 0bfea18..ac0239c 100644
--- a/utils/h2ph.PL
+++ b/utils/h2ph.PL
@@ -724,8 +724,13 @@ sub queue_includes_from
                 $line .= <HEADER>;
             }
 
-            if ($line =~ /^#\s*include\s+<(.*?)>/) {
-                push(@ARGV, $1) unless $Is_converted{$1};
+            if ($line =~ /^#\s*include\s+([<"])(.*?)[>"]/) {
+                my ($delimiter, $new_file) = ($1, $2);
+                # copy the prefix in the quote syntax (#include "x.h") case
+                if ($delimiter eq q{"} && $file =~ m|^(.*)/|) {
+                    $new_file = "$1/$new_file";
+                }
+                push(@ARGV, $new_file) unless $Is_converted{$new_file};
             }
         }
     close HEADER;

Reply via email to