diff options
author | Francois Pons <fpons@mandriva.com> | 2002-09-05 15:01:21 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2002-09-05 15:01:21 +0000 |
commit | e8476e9888b10dc4d2a6e2c7cbef605352f8f62c (patch) | |
tree | bc6c0296ee19f2837e4b887afa95bbaa0a4055f6 /urpmq | |
parent | eb0e7578ddf22a08597d54c7cc5fe6336445a8db (diff) | |
download | urpmi-e8476e9888b10dc4d2a6e2c7cbef605352f8f62c.tar urpmi-e8476e9888b10dc4d2a6e2c7cbef605352f8f62c.tar.gz urpmi-e8476e9888b10dc4d2a6e2c7cbef605352f8f62c.tar.bz2 urpmi-e8476e9888b10dc4d2a6e2c7cbef605352f8f62c.tar.xz urpmi-e8476e9888b10dc4d2a6e2c7cbef605352f8f62c.zip |
4.0-13mdk
Diffstat (limited to 'urpmq')
-rwxr-xr-x | urpmq | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -101,17 +101,19 @@ for (@ARGV) { urpm::sync_webfetch($options, @_) }; next }; /^--curl$/ and do { $urpm->{sync} = \&urpm::sync_webfetch; next }; /^--proxy$/ and do { - ($_ = shift @_) =~ m,^http://([^:]+)(:([\d]+)|[^:])$, or usage; - $_ .= ":1080" if /[^\d]/; - $urpm->{proxy}->{http_proxy} = $_; - next; - }; + my ($proxy, $port) = ($_ = shift @ARGV) =~ m,^(?:http://)?([^:]+(:\d+)?)/*$, or + die _("bad proxy declaration on command line\n"); + $proxy .= ":1080" unless $port; + $urpm->{proxy}{http_proxy} = "http://$proxy"; + next; + }; /^--proxy-user$/ and do { - ($_ = shift @_) =~ /(.+):(.+)/, or usage; - $urpm->{proxy}->{user} = $1; - $urpm->{proxy}->{pwd} = $2; - next; - }; + ($_ = shift @ARGV) =~ /(.+):(.+)/, or + die _("bad proxy declaration on command line\n"); + $urpm->{proxy}{user} = $1; + $urpm->{proxy}{pwd} = $2; + next; + }; /^-(.*)$/ and do { foreach (split //, $1) { /[\?h]/ and do { usage; next }; /d/ and do { $query->{deps} = 1; next }; |