summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-26 02:05:56 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-26 02:05:56 +0000
commit4876d568b0bcda214c11ff057fa3e3df85a850a4 (patch)
treef21ee49b64ac75191eeda9d5676ae6089e0dc682 /urpm.pm
parent534ea0562e53859bc9ead8fa8e1308e860b6fa17 (diff)
downloadurpmi-4876d568b0bcda214c11ff057fa3e3df85a850a4.tar
urpmi-4876d568b0bcda214c11ff057fa3e3df85a850a4.tar.gz
urpmi-4876d568b0bcda214c11ff057fa3e3df85a850a4.tar.bz2
urpmi-4876d568b0bcda214c11ff057fa3e3df85a850a4.tar.xz
urpmi-4876d568b0bcda214c11ff057fa3e3df85a850a4.zip
Add local media at the beginning, other ones at the end.
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm13
1 files changed, 9 insertions, 4 deletions
diff --git a/urpm.pm b/urpm.pm
index 618942da..dc5a161f 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -593,7 +593,6 @@ sub add_medium {
my ($urpm, $name, $url, $with_hdlist, %options) = @_;
#- make sure configuration has been read.
- # (Olivier Thauvin) Yes but Why ??? Is this a workaround ?
$urpm->{media} or $urpm->read_config;
#- if a medium with that name has already been found
@@ -617,7 +616,7 @@ sub add_medium {
$medium and $urpm->{fatal}(5, N("medium \"%s\" already exists", $medium->{name}));
#- clear URLs for trailing /es.
- $url =~ s|(.*?)/*$|$1|;
+ $url =~ s{/*$}{};
#- creating the medium info.
if ($options{virtual}) {
@@ -642,10 +641,16 @@ sub add_medium {
$url =~ m!^(removable[^:]*|file):/(.*)! and $urpm->probe_removable_device($medium);
}
- #- check if a password is visible, if not set clear_url.
+ #- local media have priority, other are added at the end.
+ if ($url =~ m!^file:/!) {
+ $medium->{priority} = 0.5;
+ } else {
+ $medium->{priority} = 1 + @{$urpm->{media}};
+ }
+
+ #- check whether a password is visible, if not set clear_url.
$url =~ m|([^:]*://[^/:\@]*:)[^/:\@]*(\@.*)| or $medium->{clear_url} = $url;
- #- all flags once everything has been computed.
$with_hdlist and $medium->{with_hdlist} = $with_hdlist;
#- create an entry in media list.