summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl/perl-5.12.2/debian/deprecate-with-apt.diff
blob: e580466cca5eb14340c469c4d0805983f4716cc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Upstream-Status:Inappropriate [debian patch]

From: Niko Tyni <ntyni@debian.org>
Subject: Point users to Debian packages of deprecated core modules
Bug-Debian: http://bugs.debian.org/580034

Class::ISA, Switch, Pod::Plainer, and (partially) Shell were
deprecated from the Perl core in 5.12.0.

To get a clean transition, perl-modules is going to recommend the separate
Debian packages of these for one release cycle so that they will be
pulled in by default on upgrades.

However, on systems configured to ignore recommendations the deprecation
warnings will still be useful, so modify them slightly to point to the
separate packages instead.

---
 lib/deprecate.pm |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/lib/deprecate.pm b/lib/deprecate.pm
index 7b92e0b..9db7330 100644
--- a/lib/deprecate.pm
+++ b/lib/deprecate.pm
@@ -7,6 +7,16 @@ our $VERSION = 0.01;
 our %Config;
 unless (%Config) { require Config; *Config = \%Config::Config; }
 
+# Debian-specific change: recommend the separate Debian packages of
+# deprecated modules where available
+
+my %DEBIAN_PACKAGES = (
+    "Class::ISA"	=> "libclass-isa-perl",
+    "Pod::Plainer"	=> "libpod-plainer-perl",
+    "Switch"		=> "libswitch-perl",
+    "Shell"		=> "libshell-perl",
+);
+
 sub import {
     my ($package, $file, $line) = caller;
     my $expect_leaf = "$package.pm";
@@ -44,9 +54,15 @@ EOM
 	    if (defined $callers_bitmask
             	&& (vec($callers_bitmask, $warnings::Offsets{deprecated}, 1)
 		    || vec($callers_bitmask, $warnings::Offsets{all}, 1))) {
-		warn <<"EOM";
+		if (my $deb = $DEBIAN_PACKAGES{$package}) {
+		    warn <<"EOM";
+$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.
+EOM
+		} else {
+		    warn <<"EOM";
 $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.
 EOM
+		}
 	    }
 	    return;
 	}
-- 
tg: (c823880..) debian/deprecate-with-apt (depends on: upstream)