diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-06-29 08:05:03 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-06-29 08:05:03 +0000 |
commit | b68a2d0ae082df920da5ea38c655aeb9fb19ed5a (patch) | |
tree | be728f3c64fce23a54f57315c7f9abd2356b142d /urpm | |
parent | c9e1ae1c9a310d2d1f237646ed381632cf071d4a (diff) | |
download | urpmi-b68a2d0ae082df920da5ea38c655aeb9fb19ed5a.tar urpmi-b68a2d0ae082df920da5ea38c655aeb9fb19ed5a.tar.gz urpmi-b68a2d0ae082df920da5ea38c655aeb9fb19ed5a.tar.bz2 urpmi-b68a2d0ae082df920da5ea38c655aeb9fb19ed5a.tar.xz urpmi-b68a2d0ae082df920da5ea38c655aeb9fb19ed5a.zip |
Fix parsing of proxy.cfg and --proxy options
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/args.pm | 6 | ||||
-rw-r--r-- | urpm/download.pm | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/urpm/args.pm b/urpm/args.pm index c55bf10e..1309bda5 100644 --- a/urpm/args.pm +++ b/urpm/args.pm @@ -83,11 +83,11 @@ my %options_spec = ( 'resume!' => sub { $urpm->{options}{resume} = $_[1] }, 'proxy=s' => sub { my (undef, $value) = @_; - my ($proxy, $port) = $value =~ m,^(?:http://)?([^:]+(:\d+)?)/*$, + my ($proxy, $port) = $value =~ m,^(?:http://)?([^:/]+(:\d+)?)/*$, or die N("bad proxy declaration on command line\n"); $proxy .= ":1080" unless $port; - $urpm->{proxy}{http_proxy} = "http://$proxy"; #- obsolete, for compat - urpm::download::set_cmdline_proxy(http_proxy => "http://$proxy"); + $urpm->{proxy}{http_proxy} = "http://$proxy/"; #- obsolete, for compat + urpm::download::set_cmdline_proxy(http_proxy => "http://$proxy/"); }, 'proxy-user=s' => sub { my (undef, $value) = @_; diff --git a/urpm/download.pm b/urpm/download.pm index 8f46df6d..f94ba20a 100644 --- a/urpm/download.pm +++ b/urpm/download.pm @@ -28,11 +28,11 @@ sub load_proxy_config () { local $_; while (<$f>) { chomp; s/#.*$//; s/^\s*//; s/\s*$//; - if (/^(?:(.*):\s*)(ftp|http_)proxy\s*=\s*(.*)$/) { + if (/^(?:(.*):\s*)?(ftp_proxy|http_proxy)\s*=\s*(.*)$/) { $proxy_config->{$1 || ''}{$2} = $3; next; } - if (/^(?:(.*):\s*)proxy_user\s*=\s*(.*)(?::(.*))?$/) { + if (/^(?:(.*):\s*)?proxy_user\s*=\s*(.*)(?::(.*))?$/) { $proxy_config->{$1 || ''}{user} = $2; $proxy_config->{$1 || ''}{pwd} = $3 if defined $3; next; |