diff options
-rwxr-xr-x | urpmi | 4 | ||||
-rwxr-xr-x | urpmi.addmedia | 2 | ||||
-rw-r--r-- | urpmi.spec | 6 | ||||
-rwxr-xr-x | urpmi.update | 2 | ||||
-rwxr-xr-x | urpmq | 22 |
5 files changed, 21 insertions, 15 deletions
@@ -142,10 +142,10 @@ while (defined($_ = shift @ARGV)) { urpm::sync_webfetch($options, @_) }; next }; /^--curl$/ and do { $sync = \&urpm::sync_webfetch; next }; /^--proxy$/ and do { - my ($proxy, $port) = ($_ = shift @ARGV) =~ m,^(http://[^:]+(:\d+)?)/*$, or + 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} = $proxy; + $urpm->{proxy}{http_proxy} = "http://$proxy"; next; }; /^--proxy-user$/ and do { diff --git a/urpmi.addmedia b/urpmi.addmedia index ed4682f5..ceb77ff2 100755 --- a/urpmi.addmedia +++ b/urpmi.addmedia @@ -65,7 +65,7 @@ and [options] are from urpm::sync_webfetch($options, @_) }, next; /^--curl/ and $urpm->{sync} = \&urpm::sync_webfetch, next; /^--proxy$/ and do { - my ($proxy, $port) = ($_ = shift @_) =~ m,^(http://[^:]+(:\d+)?)/*$, or + my ($proxy, $port) = ($_ = shift @_) =~ m,^(?:http://)?([^:]+(:\d+)?)/*$, or die _("bad proxy declaration on command line\n"); $proxy .= ":1080" unless $port; $urpm->{proxy}{http_proxy} = $proxy; @@ -2,7 +2,7 @@ Name: urpmi Version: 4.0 -Release: 12mdk +Release: 13mdk License: GPL Source0: %{name}.tar.bz2 Source1: %{name}.logrotate @@ -202,6 +202,10 @@ fi %changelog +* Thu Sep 5 2002 François Pons <fpons@mandrakesoft.com> 4.0-13mdk +- simplified --proxy usage (http:// leading now optional). +- fixed --proxy and --proxy-user or urpmq. + * Thu Sep 5 2002 François Pons <fpons@mandrakesoft.com> 4.0-12mdk - fixed bad englist message. - updated translation. diff --git a/urpmi.update b/urpmi.update index 4a516824..e9c5a32d 100755 --- a/urpmi.update +++ b/urpmi.update @@ -41,7 +41,7 @@ sub main { urpm::sync_webfetch($options, @_) }, next; /^--curl/ and $urpm->{sync} = \&urpm::sync_webfetch, next; /^--proxy$/ and do { - my ($proxy, $port) = ($_ = shift @_) =~ m,^(http://[^:]+(:\d+)?)/*$, or + my ($proxy, $port) = ($_ = shift @_) =~ m,^(?:http://)?([^:]+(:\d+)?)/*$, or die _("bad proxy declaration on command line\n"); $proxy .= ":1080" unless $port; $urpm->{proxy}{http_proxy} = $proxy; @@ -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 }; |