From: Niko Tyni Date: Thu, 15 May 2014 20:35:52 +0000 (+0300) Subject: Recommend $Config{vendorarch} et al. over hardcoding @INC locations X-Git-Url: https://git.donarmstrong.com/?p=debian%2Fdebian-policy.git;a=commitdiff_plain;h=40b04e9fdc32136c52ee6ef3a053e0b01375d2fd Recommend $Config{vendorarch} et al. over hardcoding @INC locations The most pressing need for this is for including the multiarch triplet in vendorarch, but it is also a logical continuation for the $Config{debian_abi} concept introduced earlier. If we ever have to make a binary incompatible change without a major version bump, we'll probably have to change @INC too, at least for locally installed binary modules (sitearch). --- diff --git a/perl-policy.sgml b/perl-policy.sgml index 54e97d3..c23f7c3 100644 --- a/perl-policy.sgml +++ b/perl-policy.sgml @@ -146,21 +146,42 @@ Modules installed by the local administrator for the current version of Perl (see ). -/usr/local/lib/perl/version -/usr/local/share/perl/version +$Config{sitearch} (currently /usr/local/lib/perl/version) +$Config{sitelib} (currently /usr/local/share/perl/version) Where version indicates the current Perl version ($Config{version}).

+

+ These locations, particularly $Config{sitearch}, + may change if the binary interface between the + Perl interpreter and compiled modules has to be + changed in an incompatible way without a change in + version. While this will only be done as a + last resort, packages should use $Config{sitelib} + and $Config{sitearch}, not hardcode the current + locations.Build systems based on + ExtUtils::MakeMaker and Module::Build + do this automatically. +

vendor

Packaged modules (see ). -/usr/lib/perl5 -/usr/share/perl5 +$Config{vendorarch} (currently /usr/lib/perl5) +$Config{vendorlib} (currently /usr/share/perl5) + These locations, particularly + $Config{vendorarch}, may change if + necessaryFor example, to include + the multiarch triplet. Packages + should use $Config{vendorlib} and + $Config{vendorarch}, not hardcode the current + locations.Build systems based on + ExtUtils::MakeMaker and Module::Build + do this automatically.

core @@ -168,12 +189,20 @@

Modules included in the core Perl distribution. -/usr/lib/perl/shortversion -/usr/share/perl/shortversion +$Config{archlib} (currently /usr/lib/perl/shortversion) +$Config{privlib} (currently /usr/share/perl/shortversion) Where shortversion indicates the current Perl major version (for example 5.18).

+

+ These locations should be considered internal to the + perl source package. If necessary, packages should use + $Config{archlib} and $Config{privlib} instead of + hardcoding the current locations.Build systems based on + ExtUtils::MakeMaker and Module::Build + do this automatically. +

site (old)