diff options
Diffstat (limited to 'meta/recipes-devtools/perl/perl-5.12.3/debian/mod_paths.diff')
-rw-r--r-- | meta/recipes-devtools/perl/perl-5.12.3/debian/mod_paths.diff | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/perl-5.12.3/debian/mod_paths.diff b/meta/recipes-devtools/perl/perl-5.12.3/debian/mod_paths.diff new file mode 100644 index 0000000000..26d8ed03a2 --- /dev/null +++ b/meta/recipes-devtools/perl/perl-5.12.3/debian/mod_paths.diff | |||
@@ -0,0 +1,100 @@ | |||
1 | Upstream-Status:Inappropriate [debian patch] | ||
2 | |||
3 | Subject: Tweak @INC ordering for Debian | ||
4 | |||
5 | Our order is: | ||
6 | |||
7 | etc (for config files) | ||
8 | site (5.8.1) | ||
9 | vendor (all) | ||
10 | core (5.8.1) | ||
11 | site (version-indep) | ||
12 | site (pre-5.8.1) | ||
13 | |||
14 | The rationale being that an admin (via site), or module packager | ||
15 | (vendor) can chose to shadow core modules when there is a newer | ||
16 | version than is included in core. | ||
17 | |||
18 | |||
19 | --- | ||
20 | perl.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
21 | 1 files changed, 58 insertions(+), 0 deletions(-) | ||
22 | |||
23 | diff --git a/perl.c b/perl.c | ||
24 | index 05cea40..023d6a0 100644 | ||
25 | --- a/perl.c | ||
26 | +++ b/perl.c | ||
27 | @@ -4125,6 +4125,11 @@ S_init_perllib(pTHX) | ||
28 | INCPUSH_ADD_SUB_DIRS|INCPUSH_CAN_RELOCATE); | ||
29 | #endif | ||
30 | |||
31 | +#ifdef DEBIAN | ||
32 | + /* for configuration where /usr is mounted ro (CPAN::Config, Net::Config) */ | ||
33 | + S_incpush_use_sep(aTHX_ STR_WITH_LEN("/etc/perl"), 0x0); | ||
34 | +#endif | ||
35 | + | ||
36 | #ifdef SITEARCH_EXP | ||
37 | /* sitearch is always relative to sitelib on Windows for | ||
38 | * DLL-based path intuition to work correctly */ | ||
39 | @@ -4242,6 +4247,59 @@ S_init_perllib(pTHX) | ||
40 | INCPUSH_ADD_OLD_VERS|INCPUSH_CAN_RELOCATE); | ||
41 | #endif | ||
42 | |||
43 | +#ifdef DEBIAN | ||
44 | + /* Non-versioned site directory for local modules and for | ||
45 | + compatability with the previous packages' site dirs */ | ||
46 | + S_incpush_use_sep(aTHX_ STR_WITH_LEN("/usr/local/lib/site_perl"), | ||
47 | + INCPUSH_ADD_SUB_DIRS); | ||
48 | + | ||
49 | +#ifdef PERL_INC_VERSION_LIST | ||
50 | + { | ||
51 | + struct stat s; | ||
52 | + | ||
53 | + /* add small buffer in case old versions are longer than the | ||
54 | + current version */ | ||
55 | + char sitearch[sizeof(SITEARCH_EXP)+16] = SITEARCH_EXP; | ||
56 | + char sitelib[sizeof(SITELIB_EXP)+16] = SITELIB_EXP; | ||
57 | + char const *vers[] = { PERL_INC_VERSION_LIST }; | ||
58 | + char const **p; | ||
59 | + | ||
60 | + char *arch_vers = strrchr(sitearch, '/'); | ||
61 | + char *lib_vers = strrchr(sitelib, '/'); | ||
62 | + | ||
63 | + if (arch_vers && isdigit(*++arch_vers)) | ||
64 | + *arch_vers = 0; | ||
65 | + else | ||
66 | + arch_vers = 0; | ||
67 | + | ||
68 | + if (lib_vers && isdigit(*++lib_vers)) | ||
69 | + *lib_vers = 0; | ||
70 | + else | ||
71 | + lib_vers = 0; | ||
72 | + | ||
73 | + /* there is some duplication here as incpush does something | ||
74 | + similar internally, but required as sitearch is not a | ||
75 | + subdirectory of sitelib */ | ||
76 | + for (p = vers; *p; p++) | ||
77 | + { | ||
78 | + if (arch_vers) | ||
79 | + { | ||
80 | + strcpy(arch_vers, *p); | ||
81 | + if (PerlLIO_stat(sitearch, &s) >= 0 && S_ISDIR(s.st_mode)) | ||
82 | + S_incpush_use_sep(aTHX_ sitearch, strlen(sitearch), 0x0); | ||
83 | + } | ||
84 | + | ||
85 | + if (lib_vers) | ||
86 | + { | ||
87 | + strcpy(lib_vers, *p); | ||
88 | + if (PerlLIO_stat(sitelib, &s) >= 0 && S_ISDIR(s.st_mode)) | ||
89 | + S_incpush_use_sep(aTHX_ sitelib, strlen(sitelib), 0x0); | ||
90 | + } | ||
91 | + } | ||
92 | + } | ||
93 | +#endif | ||
94 | +#endif | ||
95 | + | ||
96 | #ifdef PERL_OTHERLIBDIRS | ||
97 | S_incpush_use_sep(aTHX_ STR_WITH_LEN(PERL_OTHERLIBDIRS), | ||
98 | INCPUSH_ADD_OLD_VERS|INCPUSH_ADD_ARCHONLY_SUB_DIRS | ||
99 | -- | ||
100 | tg: (a508b62..) debian/mod_paths (depends on: upstream) | ||