summaryrefslogtreecommitdiffstats
path: root/urpmi.addmedia
diff options
context:
space:
mode:
Diffstat (limited to 'urpmi.addmedia')
-rwxr-xr-xurpmi.addmedia10
1 files changed, 6 insertions, 4 deletions
diff --git a/urpmi.addmedia b/urpmi.addmedia
index 083b34f3..ba98bbdd 100755
--- a/urpmi.addmedia
+++ b/urpmi.addmedia
@@ -61,13 +61,15 @@ and [options] are from
urpm::sync_webfetch($options, @_) }, next;
/^--curl/ and $urpm->{sync} = \&urpm::sync_webfetch, next;
/^--proxy$/ and do {
- ($_ = shift @_) =~ m,^http://([^:]+)(:([\d]+)|[^:])$, or die $usage;
- $_ .= ":1080" if /[^\d]/;
- $urpm->{proxy}->{http_proxy} = $_;
+ 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;
next;
};
/^--proxy-user$/ and do {
- ($_ = shift @_) =~ /(.+):(.+)/, or die $usage;
+ ($_ = shift @_) =~ /(.+):(.+)/, or
+ die _("bad proxy declaration on command line\n");
$urpm->{proxy}->{user} = $1;
$urpm->{proxy}->{pwd} = $2;
next;