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