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