diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | urpm/media.pm | 17 |
2 files changed, 16 insertions, 4 deletions
@@ -7,6 +7,9 @@ (a better name would be "auto-update") (a la yum) o do not parse synthesis (relying on MD5SUM for corruption detection) o drop /var/lib/urpmi/names.<medium> (was used by bash-completion) +- urpmi.addmedia + o don't fail on remaining statedir files (#36267) + (especially useful when using media.d/*.cfg) Version 5.4 - 5 February 2008, by Pascal "Pixel" Rigaux diff --git a/urpm/media.pm b/urpm/media.pm index 4ac3db81..2e91fdd5 100644 --- a/urpm/media.pm +++ b/urpm/media.pm @@ -674,6 +674,9 @@ sub add_medium { $medium->{$_} = $options{$_} if exists $options{$_}; } + #- those files must not be there (cf mdvbz#36267) + _clean_statedir_medium_files($urpm, $medium); + if ($options{virtual}) { $medium->{virtual} = 1; } else { @@ -876,10 +879,7 @@ sub remove_media { #- mark to re-write configuration. $urpm->{modified} = 1; - #- remove files associated with this medium. - unlink grep { $_ } map { $_->($urpm, $medium) } \&statedir_synthesis, \&statedir_descriptions, \&statedir_names, \&statedir_MD5SUM, \&statedir_hdlist; - unlink statedir_xml_info($urpm, $medium, $_) foreach @xml_media_info; - remove_user_media_info_files($urpm, $medium); + _clean_statedir_medium_files($urpm, $medium); #- remove proxy settings for this media urpm::download::remove_proxy_media($medium->{name}); @@ -888,6 +888,15 @@ sub remove_media { $urpm->{media} = [ difference2($urpm->{media}, $to_remove) ]; } +sub _clean_statedir_medium_files { + my ($urpm, $medium) = @_; + + #- remove files associated with this medium. + unlink grep { $_ } map { $_->($urpm, $medium) } \&statedir_synthesis, \&statedir_descriptions, \&statedir_names, \&statedir_MD5SUM, \&statedir_hdlist; + unlink statedir_xml_info($urpm, $medium, $_) foreach @xml_media_info; + remove_user_media_info_files($urpm, $medium); +} + sub _probe_with_try_list { my ($urpm, $medium, $f) = @_; |