summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl/perl-5.12.3/debian/deprecate-with-apt.diff
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/perl/perl-5.12.3/debian/deprecate-with-apt.diff')
-rw-r--r--meta/recipes-devtools/perl/perl-5.12.3/debian/deprecate-with-apt.diff61
1 files changed, 61 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/perl-5.12.3/debian/deprecate-with-apt.diff b/meta/recipes-devtools/perl/perl-5.12.3/debian/deprecate-with-apt.diff
new file mode 100644
index 0000000000..ad0b0cfb86
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl-5.12.3/debian/deprecate-with-apt.diff
@@ -0,0 +1,61 @@
1Upstream-Status:Inappropriate [debian patch]
2
3From: Niko Tyni <ntyni@debian.org>
4Subject: Point users to Debian packages of deprecated core modules
5Bug-Debian: http://bugs.debian.org/580034
6
7Class::ISA, Switch, Pod::Plainer, and (partially) Shell were
8deprecated from the Perl core in 5.12.0.
9
10To get a clean transition, perl-modules is going to recommend the separate
11Debian packages of these for one release cycle so that they will be
12pulled in by default on upgrades.
13
14However, on systems configured to ignore recommendations the deprecation
15warnings will still be useful, so modify them slightly to point to the
16separate packages instead.
17
18---
19 lib/deprecate.pm | 18 +++++++++++++++++-
20 1 files changed, 17 insertions(+), 1 deletions(-)
21
22diff --git a/lib/deprecate.pm b/lib/deprecate.pm
23index 7b92e0b..9db7330 100644
24--- a/lib/deprecate.pm
25+++ b/lib/deprecate.pm
26@@ -7,6 +7,16 @@ our $VERSION = 0.01;
27 our %Config;
28 unless (%Config) { require Config; *Config = \%Config::Config; }
29
30+# Debian-specific change: recommend the separate Debian packages of
31+# deprecated modules where available
32+
33+my %DEBIAN_PACKAGES = (
34+ "Class::ISA" => "libclass-isa-perl",
35+ "Pod::Plainer" => "libpod-plainer-perl",
36+ "Switch" => "libswitch-perl",
37+ "Shell" => "libshell-perl",
38+);
39+
40 sub import {
41 my ($package, $file, $line) = caller;
42 my $expect_leaf = "$package.pm";
43@@ -44,9 +54,15 @@ EOM
44 if (defined $callers_bitmask
45 && (vec($callers_bitmask, $warnings::Offsets{deprecated}, 1)
46 || vec($callers_bitmask, $warnings::Offsets{all}, 1))) {
47- warn <<"EOM";
48+ if (my $deb = $DEBIAN_PACKAGES{$package}) {
49+ warn <<"EOM";
50+$package will be removed from the Perl core distribution in the next major release. Please install the separate $deb package. It is being used at $call_file, line $call_line.
51+EOM
52+ } else {
53+ warn <<"EOM";
54 $package will be removed from the Perl core distribution in the next major release. Please install it from CPAN. It is being used at $call_file, line $call_line.
55 EOM
56+ }
57 }
58 return;
59 }
60--
61tg: (a508b62..) debian/deprecate-with-apt (depends on: upstream)