Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | From 7fe59a3d0601c6d8634eae4f99dae3024cd02a92 Mon Sep 17 00:00:00 2001 |
| 2 | From: Brendan O'Dea <bod@debian.org> |
| 3 | Date: Tue, 8 Mar 2005 19:30:38 +1100 |
| 4 | Subject: Tweak enc2xs to follow symlinks and ignore missing @INC directories. |
| 5 | |
| 6 | Bug-Debian: http://bugs.debian.org/290336 |
| 7 | |
| 8 | - ignore missing directories, |
| 9 | - follow symlinks (/usr/share/perl/5.8 -> 5.8.4). |
| 10 | - filter "." out when running "enc2xs -C", it's unnecessary and causes |
| 11 | issues with follow => 1 (see #603686 and [rt.cpan.org #64585]) |
| 12 | |
| 13 | Patch-Name: debian/enc2xs_inc.diff |
| 14 | --- |
| 15 | cpan/Encode/bin/enc2xs | 8 ++++---- |
| 16 | t/porting/customized.t | 3 +++ |
| 17 | 2 files changed, 7 insertions(+), 4 deletions(-) |
| 18 | |
| 19 | diff --git a/cpan/Encode/bin/enc2xs b/cpan/Encode/bin/enc2xs |
| 20 | index 19f2b2b..4d64e38 100644 |
| 21 | --- a/cpan/Encode/bin/enc2xs |
| 22 | +++ b/cpan/Encode/bin/enc2xs |
| 23 | @@ -944,11 +944,11 @@ use vars qw( |
| 24 | sub find_e2x{ |
| 25 | eval { require File::Find; }; |
| 26 | my (@inc, %e2x_dir); |
| 27 | - for my $inc (@INC){ |
| 28 | + for my $inc (grep -d, @INC){ |
| 29 | push @inc, $inc unless $inc eq '.'; #skip current dir |
| 30 | } |
| 31 | File::Find::find( |
| 32 | - sub { |
| 33 | + { wanted => sub { |
| 34 | my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, |
| 35 | $atime,$mtime,$ctime,$blksize,$blocks) |
| 36 | = lstat($_) or return; |
| 37 | @@ -958,7 +958,7 @@ sub find_e2x{ |
| 38 | $e2x_dir{$File::Find::dir} ||= $mtime; |
| 39 | } |
| 40 | return; |
| 41 | - }, @inc); |
| 42 | + }, follow => 1}, @inc); |
| 43 | warn join("\n", keys %e2x_dir), "\n"; |
| 44 | for my $d (sort {$e2x_dir{$a} <=> $e2x_dir{$b}} keys %e2x_dir){ |
| 45 | $_E2X = $d; |
| 46 | @@ -1025,7 +1025,7 @@ sub make_configlocal_pm { |
| 47 | $LocalMod{$enc} ||= $mod; |
| 48 | } |
| 49 | }; |
| 50 | - File::Find::find({wanted => $wanted}, @INC); |
| 51 | + File::Find::find({wanted => $wanted, follow => 1}, grep -d && !/^\./, @INC); |
| 52 | $_ModLines = ""; |
| 53 | for my $enc ( sort keys %LocalMod ) { |
| 54 | $_ModLines .= |
| 55 | diff --git a/t/porting/customized.t b/t/porting/customized.t |
| 56 | index 45fcafb..3bd6adb 100644 |
| 57 | --- a/t/porting/customized.t |
| 58 | +++ b/t/porting/customized.t |
| 59 | @@ -101,8 +101,11 @@ foreach my $module ( sort keys %Modules ) { |
| 60 | print $data_fh join(' ', $module, $file, $id), "\n"; |
| 61 | next; |
| 62 | } |
| 63 | +SKIP: { |
| 64 | + skip("$file modified for Debian", 1) if $file eq 'cpan/Encode/bin/enc2xs'; |
| 65 | my $should_be = $customised{ $module }->{ $file }; |
| 66 | is( $id, $should_be, "SHA for $file matches stashed SHA" ); |
| 67 | +} |
| 68 | } |
| 69 | } |
| 70 | |