summaryrefslogtreecommitdiffstats
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
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)
-rw-r--r--NEWS3
-rw-r--r--urpm/media.pm17
2 files changed, 16 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 9c0794b7..ed5a3afd 100644
--- a/NEWS
+++ b/NEWS
@@ -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) = @_;