Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | From 487a6d6ada0b08e6a7276520ebc61cd851005e7c Mon Sep 17 00:00:00 2001 |
| 2 | From: Niko Tyni <ntyni@debian.org> |
| 3 | Date: Sun, 3 Oct 2010 21:36:17 +0300 |
| 4 | Subject: Squelch locale warnings in Debian package maintainer scripts |
| 5 | |
| 6 | Bug-Debian: http://bugs.debian.org/508764 |
| 7 | |
| 8 | The system locales are rather frequently out of sync with the C library |
| 9 | during package upgrades, causing a huge amount of useless Perl locale |
| 10 | warnings. Squelch them when running package maintainer scripts, detected |
| 11 | by the DPKG_RUNNING_VERSION environment variable. |
| 12 | |
| 13 | Any real locale problem will show up after the system upgrade too, and |
| 14 | the warning will be triggered normally again at that point. |
| 15 | |
| 16 | Patch-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 | |
| 22 | diff --git a/locale.c b/locale.c |
| 23 | index 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 |
| 38 | diff --git a/pod/perllocale.pod b/pod/perllocale.pod |
| 39 | index 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 |