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