blob: cb31457761d4f0413c26e13fd3d5c31bed9918d3 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001From 487a6d6ada0b08e6a7276520ebc61cd851005e7c Mon Sep 17 00:00:00 2001
2From: Niko Tyni <ntyni@debian.org>
3Date: Sun, 3 Oct 2010 21:36:17 +0300
4Subject: Squelch locale warnings in Debian package maintainer scripts
5
6Bug-Debian: http://bugs.debian.org/508764
7
8The system locales are rather frequently out of sync with the C library
9during package upgrades, causing a huge amount of useless Perl locale
10warnings. Squelch them when running package maintainer scripts, detected
11by the DPKG_RUNNING_VERSION environment variable.
12
13Any real locale problem will show up after the system upgrade too, and
14the warning will be triggered normally again at that point.
15
16Patch-Name: debian/squelch-locale-warnings.diff
17---
18 locale.c | 5 ++++-
19 pod/perllocale.pod | 8 ++++++++
20 2 files changed, 12 insertions(+), 1 deletion(-)
21
22diff --git a/locale.c b/locale.c
23index 7a4a418..fdf911d 100644
24--- a/locale.c
25+++ b/locale.c
26@@ -674,7 +674,10 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
27
28 const bool locwarn = (printwarn > 1
29 || (printwarn
30- && (! bad_lang_use_once
31+ &&
32+ /* Debian specific change - see http://bugs.debian.org/508764 */
33+ (!PerlEnv_getenv("DPKG_RUNNING_VERSION")) &&
34+ (! bad_lang_use_once
35 || (
36 /* disallow with "" or "0" */
37 *bad_lang_use_once
38diff --git a/pod/perllocale.pod b/pod/perllocale.pod
39index 701b422..58cabaf 100644
40--- a/pod/perllocale.pod
41+++ b/pod/perllocale.pod
42@@ -1217,6 +1217,14 @@ B<NOTE>: C<PERL_BADLANG> only gives you a way to hide the warning message.
43 The message tells about some problem in your system's locale support,
44 and you should investigate what the problem is.
45
46+=item DPKG_RUNNING_VERSION
47+
48+On Debian systems, if the DPKG_RUNNING_VERSION environment variable is
49+set (to any value), the locale failure warnings will be suppressed just
50+like with a zero PERL_BADLANG setting. This is done to avoid floods
51+of spurious warnings during system upgrades.
52+See L<http://bugs.debian.org/508764>.
53+
54 =back
55
56 The following environment variables are not specific to Perl: They are