summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm')
-rw-r--r--urpm/args.pm10
-rw-r--r--urpm/cfg.pm6
-rw-r--r--urpm/download.pm6
-rw-r--r--urpm/ldap.pm2
-rw-r--r--urpm/msg.pm18
-rw-r--r--urpm/prompt.pm2
-rw-r--r--urpm/sys.pm8
-rw-r--r--urpm/util.pm2
8 files changed, 27 insertions, 27 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index 4c24a803..c81942d3 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -9,7 +9,7 @@ use Getopt::Long;# 2.33;
use urpm::download;
use urpm::msg;
-(our $VERSION) = q$Revision$ =~ /(\d+)/;
+(our $VERSION) = q($Revision$) =~ /(\d+)/;
# The program that invokes us
(my $tool = $0) =~ s!.*/!!;
@@ -38,7 +38,7 @@ sub import {
# used by urpmf
sub add_param_closure {
my (@tags) = @_;
- return sub { $::qf .= join $::separator, '', map "%$_", @tags };
+ return sub { $::qf .= join $::separator, '', map { "%$_" } @tags };
}
# options specifications for Getopt::Long
@@ -305,7 +305,7 @@ my %options_spec = (
'force-key' => \$options{forcekey},
'limit-rate=s' => \$options{limit_rate},
'no-md5sum' => \$options{nomd5sum},
- 'noa|d' => \my $dummy, #- default, kept for compatibility
+ 'noa|d' => \my $_dummy, #- default, kept for compatibility
'q|quiet' => sub { --$options{verbose} },
'v|verbose' => sub { ++$options{verbose} },
'norebuild!' => sub { $urpm->{options}{norebuild} = $_[1]; $options{force} = 0 },
@@ -414,7 +414,7 @@ foreach my $k ("help|h", "version") {
sub parse_cmdline {
my %args = @_;
$urpm = $args{urpm};
- for my $k (keys %{$args{defaults} || {}}) {
+ foreach my $k (keys %{$args{defaults} || {}}) {
$options{$k} = $args{defaults}{$k};
}
my $ret = GetOptions(%{$options_spec{$tool}});
@@ -433,7 +433,7 @@ sub parse_cmdline {
die N("Too many arguments\n");
}
}
- $ret
+ $ret;
}
1;
diff --git a/urpm/cfg.pm b/urpm/cfg.pm
index f39679e1..30d9cc8b 100644
--- a/urpm/cfg.pm
+++ b/urpm/cfg.pm
@@ -7,7 +7,7 @@ use warnings;
use urpm::util;
use urpm::msg 'N';
-(our $VERSION) = q$Revision$ =~ /(\d+)/;
+(our $VERSION) = q($Revision$) =~ /(\d+)/;
=head1 NAME
@@ -104,7 +104,7 @@ sub expand_line {
}
sub load_config ($;$) {
- my ($file, $norewrite) = @_;
+ my ($file, $b_norewrite) = @_;
my %config;
my $priority = 0;
my $medium;
@@ -115,7 +115,7 @@ sub load_config ($;$) {
chomp;
next if /^\s*#/; #- comments
s/^\s+//; s/\s+$//;
- $_ = expand_line($_) unless $norewrite;
+ $_ = expand_line($_) unless $b_norewrite;
if ($_ eq '}') { #-{
if (!defined $medium) {
_syntax_error();
diff --git a/urpm/download.pm b/urpm/download.pm
index 0363f683..1eba2504 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -7,7 +7,7 @@ use urpm::msg;
use urpm::cfg;
use Cwd;
-(our $VERSION) = q$Revision$ =~ /(\d+)/;
+(our $VERSION) = q($Revision$) =~ /(\d+)/;
#- proxy config file.
our $PROXY_CFG = '/etc/urpmi/proxy.cfg';
@@ -480,7 +480,7 @@ sub sync_rsync {
}
our $SSH_PATH;
-sub _init_ssh_path {
+sub _init_ssh_path() {
for (qw(/usr/bin/ssh /bin/ssh)) {
-x $_ and $SSH_PATH = $_;
next;
@@ -557,7 +557,7 @@ END {
for my $socket (glob "$SSH_CONTROL_DIR/ssh-urpmi-$$-*") {
$socket =~ /ssh-urpmi-\d+-([^_]+)_\d+_(.*)$/;
my $server = $1 or next;
- my $login = $2 or next;
+ my $_login = $2 or next;
system("$SSH_PATH -q -f -N -o 'ControlPath $socket' -O exit $2\@$server");
}
}
diff --git a/urpm/ldap.pm b/urpm/ldap.pm
index e734c883..b65fc0c2 100644
--- a/urpm/ldap.pm
+++ b/urpm/ldap.pm
@@ -8,7 +8,7 @@ use urpm;
use urpm::msg 'N';
use Net::LDAP;
-(our $VERSION) = q$Revision$ =~ /(\d+)/;
+(our $VERSION) = q($Revision$) =~ /(\d+)/;
our $LDAP_CONFIG_FILE = '/etc/ldap.conf';
my @per_media_opt = (@urpm::PER_MEDIA_OPT, qw(ftp-proxy http-proxy));
diff --git a/urpm/msg.pm b/urpm/msg.pm
index e3986abe..2944f85c 100644
--- a/urpm/msg.pm
+++ b/urpm/msg.pm
@@ -6,7 +6,7 @@ use strict;
no warnings;
use Exporter;
-(our $VERSION) = q$Revision$ =~ /(\d+)/;
+(our $VERSION) = q($Revision$) =~ /(\d+)/;
our @ISA = 'Exporter';
our @EXPORT = qw(N bug_log to_utf8 message_input toMb from_utf8 sys_log);
@@ -33,7 +33,7 @@ sub from_utf8_dummy { $_[0] }
our $use_utf8_full = defined $codeset && $codeset eq 'UTF-8';
-*from_utf8 = $use_utf8_full ? *from_utf8_full : *from_utf8_dummy;
+sub from_utf8 { $use_utf8_full ? &from_utf8_full : &from_utf8_dummy }
sub N {
my ($format, @params) = @_;
@@ -71,23 +71,23 @@ sub bug_log {
sub to_utf8 { Locale::gettext::iconv($_[0], undef, "UTF-8") }
sub message_input {
- my ($msg, $default_input, %opts) = @_;
+ my ($msg, $o_default_input, %o_opts) = @_;
my $input;
while (1) {
print $msg;
- if ($default_input) {
- $urpm::args::options{bug} and bug_log($default_input);
- return $default_input;
+ if ($o_default_input) {
+ $urpm::args::options{bug} and bug_log($o_default_input);
+ return $o_default_input;
}
$input = <STDIN>;
defined $input or return undef;
chomp $input;
$urpm::args::options{bug} and bug_log($input);
- if ($opts{boolean}) {
+ if ($o_opts{boolean}) {
$input =~ /^[$noexpr$yesexpr]?$/ and last;
- } elsif ($opts{range}) {
+ } elsif ($o_opts{range}) {
$input eq "" and $input = 1; #- defaults to first choice
- (defined $opts{range_min} ? $opts{range_min} : 1) <= $input && $input <= $opts{range} and last;
+ (defined $o_opts{range_min} ? $o_opts{range_min} : 1) <= $input && $input <= $o_opts{range} and last;
} else {
last;
}
diff --git a/urpm/prompt.pm b/urpm/prompt.pm
index 6d7147d0..ec34db10 100644
--- a/urpm/prompt.pm
+++ b/urpm/prompt.pm
@@ -4,7 +4,7 @@ package urpm::prompt;
use strict;
-(our $VERSION) = q$Revision$ =~ /(\d+)/;
+(our $VERSION) = q($Revision$) =~ /(\d+)/;
sub new {
my ($class, $title, $prompts, $defaults, $hidden) = @_;
diff --git a/urpm/sys.pm b/urpm/sys.pm
index 0b191265..9defc2f5 100644
--- a/urpm/sys.pm
+++ b/urpm/sys.pm
@@ -6,7 +6,7 @@ use strict;
use warnings;
use POSIX ();
-(our $VERSION) = q$Revision$ =~ /(\d+)/;
+(our $VERSION) = q($Revision$) =~ /(\d+)/;
#- find used mount point from a pathname, use a optional mode to allow
#- filtering according the next operation (mount or umount).
@@ -110,7 +110,7 @@ sub first_free_loopdev () {
sub trim_until_d {
my ($dir) = @_;
open my $mounts, '/proc/mounts' or do { warn "Can't read /proc/mounts: $!\n"; return $dir };
- local *_;
+ local $_;
while (<$mounts>) {
#- fail if an iso is already mounted
m!^/dev/loop! and return $dir;
@@ -171,14 +171,14 @@ sub mktempdir {
}
# temporary hack used by urpmi when restarting itself.
-sub fix_fd_leak {
+sub fix_fd_leak() {
opendir my $dirh, "/proc/$$/fd" or return undef;
my @fds = grep { /^(\d+)$/ && $1 > 2 } readdir $dirh;
closedir $dirh;
for (@fds) {
my $link = readlink("/proc/$$/fd/$_");
$link or next;
- next if $link =~ m(^/(usr|dev)/) || $link !~ m(^/);
+ next if $link =~ m!^/(usr|dev)/! || $link !~ m!^/!;
POSIX::close($_);
}
}
diff --git a/urpm/util.pm b/urpm/util.pm
index d112005a..fafc5c2e 100644
--- a/urpm/util.pm
+++ b/urpm/util.pm
@@ -12,7 +12,7 @@ our @EXPORT = qw(quotespace unquotespace
difference2
);
-(our $VERSION) = q$Revision$ =~ /(\d+)/;
+(our $VERSION) = q($Revision$) =~ /(\d+)/;
#- quoting/unquoting a string that may be containing space chars.
sub quotespace { my $x = $_[0] || ''; $x =~ s/(\s)/\\$1/g; $x }