diff options
-rw-r--r-- | urpm.pm | 3 | ||||
-rw-r--r-- | urpm/msg.pm | 10 |
2 files changed, 10 insertions, 3 deletions
@@ -23,9 +23,6 @@ BEGIN { if ($ENV{DEBUG_URPMI}) { require encoding::warnings; encoding::warnings->import; - } else { - require warnings; - warnings->unimport('utf8'); } } diff --git a/urpm/msg.pm b/urpm/msg.pm index 5f60a070..28e3438d 100644 --- a/urpm/msg.pm +++ b/urpm/msg.pm @@ -1,6 +1,7 @@ package urpm::msg; use strict; +no warnings; use Exporter; our @ISA = 'Exporter'; our @EXPORT = qw(N log_it to_utf8 message_input message toMb from_utf8); @@ -27,6 +28,15 @@ sub from_utf8_dummy { $_[0] } *from_utf8 = defined $codeset ? *from_utf8_full : *from_utf8_dummy; +sub import { + urpm::msg->export_to_level(1, @_); + unless ($ENV{DEBUG_URPMI}) { + #- turn off warnings utf8 in caller. Kludge. Find better way later + @_ = qw(utf8); + goto &warnings::unimport; + } +} + sub N { my ($format, @params) = @_; my $s = sprintf( |