diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-09 14:42:44 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-09 14:42:44 +0000 |
commit | 64495e8b0d16d2d3a091898c35d4ac86d570b049 (patch) | |
tree | e9badb16c51119f3e7efbc5627e20c6a51c30ebd /urpm/download.pm | |
parent | 63d4924d2f08fc564ea2c7cb5e75bb9a31b183ad (diff) | |
download | urpmi-64495e8b0d16d2d3a091898c35d4ac86d570b049.tar urpmi-64495e8b0d16d2d3a091898c35d4ac86d570b049.tar.gz urpmi-64495e8b0d16d2d3a091898c35d4ac86d570b049.tar.bz2 urpmi-64495e8b0d16d2d3a091898c35d4ac86d570b049.tar.xz urpmi-64495e8b0d16d2d3a091898c35d4ac86d570b049.zip |
perl_checker compliance & simplifications
Diffstat (limited to 'urpm/download.pm')
-rw-r--r-- | urpm/download.pm | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/urpm/download.pm b/urpm/download.pm index 1019120d..3b94168b 100644 --- a/urpm/download.pm +++ b/urpm/download.pm @@ -232,7 +232,7 @@ sub sync_wget { '-P', $options->{dir}, @_ ) . " |"; - my $wget_pid = open my($wget), $wget_command; + my $wget_pid = open(my $wget, $wget_command); local $/ = \1; #- read input by only one char, this is slow but very nice (and it works!). local $_; while (<$wget>) { @@ -290,7 +290,7 @@ sub sync_curl { $nick =~ s/@/%40/; $_ = "$proto://$nick:$rest"; } - if (m|^ftp://.*/([^/]*)$| && -e $1 && -s _ > 8192) { #- manage time stamp for large file only + if (m|^ftp://.*/([^/]*)$| && file_size($1) > 8192) { #- manage time stamp for large file only push @ftp_files, $_; next; } push @other_files, $_; @@ -480,7 +480,7 @@ sub sync_rsync { our $SSH_PATH; sub _init_ssh_path() { - for (qw(/usr/bin/ssh /bin/ssh)) { + foreach (qw(/usr/bin/ssh /bin/ssh)) { -x $_ and $SSH_PATH = $_; next; } @@ -553,11 +553,9 @@ sub check_ssh_master { END { #- remove ssh persistent connections - for my $socket (glob "$SSH_CONTROL_DIR/ssh-urpmi-$$-*") { - $socket =~ /ssh-urpmi-\d+-([^_]+)_\d+_(.*)$/; - my $server = $1 or next; - my $_login = $2 or next; - system("$SSH_PATH -q -f -N -o 'ControlPath $socket' -O exit $2\@$server"); + foreach my $socket (glob "$SSH_CONTROL_DIR/ssh-urpmi-$$-*") { + my ($server, $login) = $socket =~ /ssh-urpmi-\d+-([^_]+)_\d+_(.*)$/ or next; + system($SSH_PATH, '-q', '-f', '-N', '-o', "ControlPath $socket", '-O', 'exit', "$login\@$server"); } } |