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