From e8476e9888b10dc4d2a6e2c7cbef605352f8f62c Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Thu, 5 Sep 2002 15:01:21 +0000 Subject: 4.0-13mdk --- urpmi | 4 ++-- urpmi.addmedia | 2 +- urpmi.spec | 6 +++++- urpmi.update | 2 +- urpmq | 22 ++++++++++++---------- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/urpmi b/urpmi index 5a75b53b..1c9d4274 100755 --- a/urpmi +++ b/urpmi @@ -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; diff --git a/urpmi.spec b/urpmi.spec index 308c09ef..fa8d1795 100644 --- a/urpmi.spec +++ b/urpmi.spec @@ -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 4.0-13mdk +- simplified --proxy usage (http:// leading now optional). +- fixed --proxy and --proxy-user or urpmq. + * Thu Sep 5 2002 François Pons 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; diff --git a/urpmq b/urpmq index 04a486ee..e8438013 100755 --- a/urpmq +++ b/urpmq @@ -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 }; -- cgit v1.2.1