summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-25 09:56:36 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-25 09:56:36 +0000
commit08d570db383c266a7ccbfab1272e38b72dc371e4 (patch)
tree0589f2d8f1fda49e561e7659d852538e98b1ba5b /urpm.pm
parent589958227f02d711c5cb1c1844b75edb50d7e4f4 (diff)
downloadurpmi-08d570db383c266a7ccbfab1272e38b72dc371e4.tar
urpmi-08d570db383c266a7ccbfab1272e38b72dc371e4.tar.gz
urpmi-08d570db383c266a7ccbfab1272e38b72dc371e4.tar.bz2
urpmi-08d570db383c266a7ccbfab1272e38b72dc371e4.tar.xz
urpmi-08d570db383c266a7ccbfab1272e38b72dc371e4.zip
urpmi.addmedia --raw should add medium as ignored, since the new medium is just
a config entry and wasn't initialised
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/urpm.pm b/urpm.pm
index 28b43f2f..371cf006 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -673,7 +673,7 @@ sub add_medium {
$urpm->{media} or $urpm->read_config;
#- if a medium with that name has already been found, we have to exit now
- my ($medium);
+ my $medium;
if (defined $options{index_name}) {
my $i = $options{index_name};
do {
@@ -694,7 +694,7 @@ sub add_medium {
$url =~ s,/*$,,; #- clear URLs for trailing /es.
#- creating the medium info.
- $medium = { name => $name, url => $url, update => $options{update}, modified => 1 };
+ $medium = { name => $name, url => $url, update => $options{update}, modified => 1, ignore => $options{ignore} };
if ($options{virtual}) {
$url =~ m!^(?:file:)?/! or $urpm->{fatal}(1, N("virtual medium needs to be local"));
$medium->{virtual} = 1;
@@ -721,8 +721,6 @@ sub add_medium {
#- create an entry in media list.
push @{$urpm->{media}}, $medium;
- #- keep in mind the database has been modified and base files need to be updated.
- #- this will be done automatically by transfering modified flag from medium to global.
$urpm->{log}(N("added medium %s", $name));
#- we need to reload the config, since some string substitutions may have occured
@@ -730,6 +728,9 @@ sub add_medium {
$urpm->write_config;
delete $urpm->{media};
$urpm->read_config(nocheck_access => 1);
+ #- Remember that the database has been modified and base files need to
+ #- be updated. This will be done automatically by transferring the
+ #- "modified" flag from medium to global.
$_->{name} eq $name and $_->{modified} = 1 foreach @{$urpm->{media}};
$urpm->{modified} = 1;
}