File: deprecate-with-apt.diff

package info (click to toggle)
perl 5.36.0-7%2Bdeb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 120,064 kB
  • sloc: ansic: 650,199; perl: 478,052; sh: 70,710; pascal: 8,435; xml: 2,428; yacc: 1,230; makefile: 1,175; cpp: 208; lisp: 1
file content (44 lines) | stat: -rw-r--r-- 1,596 bytes parent folder | download | duplicates (4)
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
From: Dominic Hargreaves <dom@earth.li>
Date: Mon, 17 May 2010 13:23:07 +0300
Subject: Point users to Debian packages of deprecated core modules

Bug-Debian: http://bugs.debian.org/747628
---
 lib/deprecate.pm | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/lib/deprecate.pm b/lib/deprecate.pm
index 995322c..771ad24 100644
--- a/lib/deprecate.pm
+++ b/lib/deprecate.pm
@@ -7,6 +7,13 @@ our $VERSION = 0.04;
 our %Config;
 unless (%Config) { require Config; *Config = \%Config::Config; }
 
+# Debian-specific change: recommend the separate Debian packages of
+# deprecated modules where available
+
+our %DEBIAN_PACKAGES = (
+    #'Foo:Bar' => 'libfoo-bar-perl',
+);
+
 # This isn't a public API. It's internal to code maintained by the perl-porters
 # If you would like it to be a public API, please send a patch with
 # documentation and tests. Until then, it may change without warning.
@@ -58,9 +65,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
+		}
 	}
     }
 }