summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-03-08 11:12:37 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-03-08 11:12:37 +0000
commita61523abb8b2349273dc97916a2737d63aa83a81 (patch)
treec4e977703090a0add2b0941e777a35204c624229
parent26b7eea498c9c7da53ceea261957e3544a69cac7 (diff)
downloadurpmi-a61523abb8b2349273dc97916a2737d63aa83a81.tar
urpmi-a61523abb8b2349273dc97916a2737d63aa83a81.tar.gz
urpmi-a61523abb8b2349273dc97916a2737d63aa83a81.tar.bz2
urpmi-a61523abb8b2349273dc97916a2737d63aa83a81.tar.xz
urpmi-a61523abb8b2349273dc97916a2737d63aa83a81.zip
Fix addition of media with passwords
-rw-r--r--urpm.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/urpm.pm b/urpm.pm
index 7f2cfc32..8fb716bc 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -676,7 +676,8 @@ sub add_medium {
}
#- check whether a password is visible, if not, set clear_url.
- $url =~ m|([^:]*://[^/:\@]*:)[^/:\@]*(\@.*)| or $medium->{clear_url} = $url;
+ my $has_password = $url =~ m|([^:]*://[^/:\@]*:)[^/:\@]*(\@.*)|;
+ $medium->{clear_url} = $url unless $has_password;
$with_hdlist and $medium->{with_hdlist} = $with_hdlist;
@@ -695,6 +696,11 @@ sub add_medium {
$_->{name} eq $name and $_->{modified} = 1 foreach @{$urpm->{media}};
$urpm->{modified} = 1;
}
+ if ($has_password) {
+ foreach (grep { $_->{name} eq $name } @{$urpm->{media}}) {
+ $_->{url} = $url;
+ }
+ }
$name;
}