diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-13 14:39:35 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-13 14:39:35 +0000 |
commit | 2891a057f46c7cc0c0df58fa26c8a364f7b5bdeb (patch) | |
tree | 08900aecc859ab134302edcdb73e1fd32a9faf4c | |
parent | fe8a32f8feca0bc27e3009721b3fb1ecbf6cbea6 (diff) | |
download | urpmi-2891a057f46c7cc0c0df58fa26c8a364f7b5bdeb.tar urpmi-2891a057f46c7cc0c0df58fa26c8a364f7b5bdeb.tar.gz urpmi-2891a057f46c7cc0c0df58fa26c8a364f7b5bdeb.tar.bz2 urpmi-2891a057f46c7cc0c0df58fa26c8a364f7b5bdeb.tar.xz urpmi-2891a057f46c7cc0c0df58fa26c8a364f7b5bdeb.zip |
revalidate $medium instead of searching by name twice
-rw-r--r-- | urpm.pm | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -748,16 +748,18 @@ sub add_medium { $urpm->write_config; delete $urpm->{media}; $urpm->read_config(nocheck_access => 1); + + #- need getting the fresh datastructure after read_config + ($medium) = grep { $_->{name} eq $name } @{$urpm->{media}}; + #- 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}}; + $medium->{modified} = 1; $urpm->{modified} = 1; } if ($has_password) { - foreach (grep { $_->{name} eq $name } @{$urpm->{media}}) { - $_->{url} = $url; - } + $medium->{url} = $url; } $options{nolock} or $urpm->unlock_urpmi_db; |