From 51eac793bcf872ce65a3fdf517d3fe65b538dc3a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 9 Nov 2006 16:13:38 +0000 Subject: perl_checker compliance, don't import POSIX functions (it helps perl_checker) --- gurpmi.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'gurpmi.pm') diff --git a/gurpmi.pm b/gurpmi.pm index 434ce34d..eda27d0f 100644 --- a/gurpmi.pm +++ b/gurpmi.pm @@ -7,14 +7,14 @@ package gurpmi; #- This is needed because text printed by Gtk2 will always be encoded #- in UTF-8; we first check if LC_ALL is defined, because if it is, #- changing only LC_COLLATE will have no effect. -use POSIX qw(setlocale LC_ALL LC_COLLATE); +use POSIX(); use locale; my $collation_locale = $ENV{LC_ALL}; if ($collation_locale) { - $collation_locale =~ /UTF-8/ or setlocale(LC_ALL, "$collation_locale.UTF-8"); + $collation_locale =~ /UTF-8/ or POSIX::setlocale(POSIX::LC_ALL(), "$collation_locale.UTF-8"); } else { - $collation_locale = setlocale(LC_COLLATE); - $collation_locale =~ /UTF-8/ or setlocale(LC_COLLATE, "$collation_locale.UTF-8"); + $collation_locale = POSIX::setlocale(POSIX::LC_COLLATE()); + $collation_locale =~ /UTF-8/ or POSIX::setlocale(POSIX::LC_COLLATE(), "$collation_locale.UTF-8"); } use urpm; @@ -47,7 +47,7 @@ sub fatal { my $s = $_[0]; print STDERR "$s\n"; exit 1 } #- Parse command line #- puts options in %gurpmi::options #- puts bare names (not rpm filenames) in @gurpmi::names -sub parse_command_line { +sub parse_command_line() { my @all_rpms; our %options; our @names; @@ -77,10 +77,10 @@ sub parse_command_line { /^--?[hv?]/ and usage(); fatal(N("Unknown option %s", $_)); } - if (-f) { - push @all_rpms, $_ + if (-f $_) { + push @all_rpms, $_; } else { - push @names, $_ + push @names, $_; } } -- cgit v1.2.1