summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-02-23 19:40:50 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-02-23 19:40:50 +0000
commitfac2e70e4020fbd9a545f50e358537a4116c0df1 (patch)
tree2e57d459f5acf2dc8da68a92ebf68faa8df4ec88 /urpm
parentd109605c948a028444901a85cc85a8e67be23e61 (diff)
downloadurpmi-fac2e70e4020fbd9a545f50e358537a4116c0df1.tar
urpmi-fac2e70e4020fbd9a545f50e358537a4116c0df1.tar.gz
urpmi-fac2e70e4020fbd9a545f50e358537a4116c0df1.tar.bz2
urpmi-fac2e70e4020fbd9a545f50e358537a4116c0df1.tar.xz
urpmi-fac2e70e4020fbd9a545f50e358537a4116c0df1.zip
- urpmi.addmedia
o don't fail on remaining statedir files (#36267) (especially useful when using media.d/*.cfg)
Diffstat (limited to 'urpm')
-rw-r--r--urpm/media.pm17
1 files changed, 13 insertions, 4 deletions
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) = @_;