From 0e15730b36718634d4ed8fb646e964544e4e4876 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Wed, 31 Aug 2005 12:33:55 +0000 Subject: Turn off utf8 warnings in the caller each time we use urpm::msg. --- urpm.pm | 3 --- urpm/msg.pm | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/urpm.pm b/urpm.pm index 5cfd24b8..95bc53d5 100644 --- a/urpm.pm +++ b/urpm.pm @@ -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( -- cgit v1.2.1