diff options
Diffstat (limited to 'meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff')
-rw-r--r-- | meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff b/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff deleted file mode 100644 index c597701cad..0000000000 --- a/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | From d33d46963035ef726144dc66be2ae9c00aec0333 Mon Sep 17 00:00:00 2001 | ||
2 | From: Niko Tyni <ntyni@debian.org> | ||
3 | Date: Tue, 16 Oct 2012 23:07:56 +0300 | ||
4 | Subject: Fix CPAN::FirstTime defaults with nonexisting site dirs if a parent | ||
5 | is writable | ||
6 | |||
7 | The site directories do not exist on a typical Debian system. The build | ||
8 | systems will create them when necessary, so there's no need for a prompt | ||
9 | suggesting local::lib if the first existing parent directory is writable. | ||
10 | |||
11 | Also, writability of the core directories is not interesting as we | ||
12 | explicitly tell CPAN not to touch those with INSTALLDIRS=site. | ||
13 | |||
14 | Bug-Debian: http://bugs.debian.org/688842 | ||
15 | Patch-Name: debian/cpan-missing-site-dirs.diff | ||
16 | Upstream-Status: Pending | ||
17 | --- | ||
18 | cpan/CPAN/lib/CPAN/FirstTime.pm | 31 +++++++++++++++++++++++++++---- | ||
19 | 1 file changed, 27 insertions(+), 4 deletions(-) | ||
20 | |||
21 | diff --git a/cpan/CPAN/lib/CPAN/FirstTime.pm b/cpan/CPAN/lib/CPAN/FirstTime.pm | ||
22 | index 33054cd..7b0becf 100644 | ||
23 | --- a/cpan/CPAN/lib/CPAN/FirstTime.pm | ||
24 | +++ b/cpan/CPAN/lib/CPAN/FirstTime.pm | ||
25 | @@ -2057,11 +2057,34 @@ sub _print_urllist { | ||
26 | }; | ||
27 | } | ||
28 | |||
29 | +# Debian modification: return true if this directory | ||
30 | +# or the first existing one upwards is writable | ||
31 | +sub _can_write_to_this_or_parent { | ||
32 | + my ($dir) = @_; | ||
33 | + my @parts = File::Spec->splitdir($dir); | ||
34 | + while (@parts) { | ||
35 | + my $cur = File::Spec->catdir(@parts); | ||
36 | + return 1 if -w $cur; | ||
37 | + return 0 if -e _; | ||
38 | + pop @parts; | ||
39 | + } | ||
40 | + return 0; | ||
41 | +} | ||
42 | + | ||
43 | +# Debian specific modification: the site directories don't necessarily | ||
44 | +# exist on the system, but the build systems create them when necessary, | ||
45 | +# so return true if the first existing directory upwards is writable | ||
46 | +# | ||
47 | +# Furthermore, on Debian, only test the site directories | ||
48 | +# (installsite*, expanded to /usr/local/{share,lib}/perl), | ||
49 | +# not the core ones | ||
50 | +# (install*lib, expanded to /usr/{share,lib}/perl). | ||
51 | +# We pass INSTALLDIRS=site by default to keep CPAN from touching | ||
52 | +# the core directories. | ||
53 | + | ||
54 | sub _can_write_to_libdirs { | ||
55 | - return -w $Config{installprivlib} | ||
56 | - && -w $Config{installarchlib} | ||
57 | - && -w $Config{installsitelib} | ||
58 | - && -w $Config{installsitearch} | ||
59 | + return _can_write_to_this_or_parent($Config{installsitelib}) | ||
60 | + && _can_write_to_this_or_parent($Config{installsitearch}) | ||
61 | } | ||
62 | |||
63 | sub _using_installbase { | ||