Tweak enc2xs to follow symlinks and ignore missing @INC directories.

Bug-Debian: http://bugs.debian.org/290336

- ignore missing directories,
- follow symlinks (/usr/share/perl/5.8 -> 5.8.4).
- filter "." out when running "enc2xs -C", it's unnecessary and causes
  issues with follow => 1 (see #603686 and [rt.cpan.org #64585])

Gbp-Pq: Topic debian
Gbp-Pq: Name enc2xs_inc.diff
This commit is contained in:
Brendan O'Dea 2005-03-08 19:30:38 +11:00 committed by openKylinBot
parent 82878211a9
commit f3b88dcbf5
2 changed files with 7 additions and 4 deletions

View File

@ -1013,11 +1013,11 @@ use vars qw(
sub find_e2x{ sub find_e2x{
eval { require File::Find; }; eval { require File::Find; };
my (@inc, %e2x_dir); my (@inc, %e2x_dir);
for my $inc (@INC){ for my $inc (grep -d, @INC){
push @inc, $inc unless $inc eq '.'; #skip current dir push @inc, $inc unless $inc eq '.'; #skip current dir
} }
File::Find::find( File::Find::find(
sub { { wanted => sub {
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks) $atime,$mtime,$ctime,$blksize,$blocks)
= lstat($_) or return; = lstat($_) or return;
@ -1027,7 +1027,7 @@ sub find_e2x{
$e2x_dir{$File::Find::dir} ||= $mtime; $e2x_dir{$File::Find::dir} ||= $mtime;
} }
return; return;
}, @inc); }, follow => 1}, @inc);
warn join("\n", keys %e2x_dir), "\n"; warn join("\n", keys %e2x_dir), "\n";
for my $d (sort {$e2x_dir{$a} <=> $e2x_dir{$b}} keys %e2x_dir){ for my $d (sort {$e2x_dir{$a} <=> $e2x_dir{$b}} keys %e2x_dir){
$_E2X = $d; $_E2X = $d;
@ -1091,7 +1091,7 @@ sub make_configlocal_pm {
$LocalMod{$enc} ||= $mod; $LocalMod{$enc} ||= $mod;
} }
}; };
File::Find::find({wanted => $wanted}, @INC); File::Find::find({wanted => $wanted, follow => 1}, grep -d && !/^\./, @INC);
$_ModLines = ""; $_ModLines = "";
for my $enc ( sort keys %LocalMod ) { for my $enc ( sort keys %LocalMod ) {
$_ModLines .= $_ModLines .=

View File

@ -108,8 +108,11 @@ foreach my $module ( sort keys %Modules ) {
print $data_fh join(' ', $module, $file, $id), "\n"; print $data_fh join(' ', $module, $file, $id), "\n";
next; next;
} }
SKIP: {
skip("$file modified for Debian", 1) if $file eq 'cpan/Encode/bin/enc2xs';
my $should_be = $customised{ $module }->{ $file }; my $should_be = $customised{ $module }->{ $file };
is( $id, $should_be, "SHA for $file matches stashed SHA" ); is( $id, $should_be, "SHA for $file matches stashed SHA" );
}
} }
} }