aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-10-09 16:08:56 +0000
committerThierry Vignaud <tv@mandriva.org>2009-10-09 16:08:56 +0000
commita42fc2873be9b3ceb4ff0c52289036859b9519ae (patch)
tree2853760fe97923cc553eaa1b9d99d93b6df630e6
parent355584205c27cf22959b3b29107bfe2a9e3e5dbc (diff)
downloadrpmdrake-a42fc2873be9b3ceb4ff0c52289036859b9519ae.tar
rpmdrake-a42fc2873be9b3ceb4ff0c52289036859b9519ae.tar.gz
rpmdrake-a42fc2873be9b3ceb4ff0c52289036859b9519ae.tar.bz2
rpmdrake-a42fc2873be9b3ceb4ff0c52289036859b9519ae.tar.xz
rpmdrake-a42fc2873be9b3ceb4ff0c52289036859b9519ae.zip
fix enabling for the first time a medium that never was enabled before
(#47110, #52636) (side effect of urpmi changes) (mainwindow:toggled signal) reread_media() failed to un-ignore an ignored medium probably because urpm::media::check_existing_medium() complains about missing synthesis when the medium never was enabled before; thus it restored the ignore bit (reread_media) read back configuration after and not before updating media else ignore bit will be restored by urpm::media::check_existing_medium() when trying to update a never enabled yet medium
-rw-r--r--NEWS2
-rw-r--r--Rpmdrake/edit_urpm_sources.pm10
2 files changed, 11 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 7d18e52a..805b89a7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
- edit-urpm-sources:
+ o fix enabling for the first time a medium that never was enabled
+ before (#52636)
o ignore rpmdrake's option regarding ignoring debug media
o prevent crashing if one click on a media checkbox while another
one is being processed (gtk+ was reentering the callback when we
diff --git a/Rpmdrake/edit_urpm_sources.pm b/Rpmdrake/edit_urpm_sources.pm
index 8e6a3973..3c602189 100644
--- a/Rpmdrake/edit_urpm_sources.pm
+++ b/Rpmdrake/edit_urpm_sources.pm
@@ -1068,6 +1068,12 @@ sub mainwindow() {
my $ignored = $urpm->{media}[$path]{ignore};
$reread_media->();
if (!$ignored && $urpm->{media}[$path]{ignore}) {
+ # reread media failed to un-ignore an ignored medium
+ # probably because urpm::media::check_existing_medium() complains
+ # about missing synthesis when the medium never was enabled before;
+ # thus it restored the ignore bit
+ $urpm->{media}[$path]{ignore} = !$urpm->{media}[$path]{ignore} || undef;
+ urpm::media::write_config($urpm);
#- Enabling this media failed, force update
interactive_msg('rpmdrake',
N("This medium needs to be updated to be usable. Update it now ?"),
@@ -1091,7 +1097,6 @@ sub mainwindow() {
my ($name) = @_;
$reorder_ok = 0;
$something_changed = 1;
- $urpm = fast_open_urpmi_db();
if (defined $name) {
urpm::media::select_media($urpm, $name);
update_sources_check(
@@ -1101,6 +1106,9 @@ sub mainwindow() {
$name,
);
}
+ # reread configuration after updating media else ignore bit will be restored
+ # by urpm::media::check_existing_medium():
+ $urpm = fast_open_urpmi_db();
$list->clear;
foreach (grep { ! $_->{external} } @{$urpm->{media}}) {
my $name = $_->{name};