aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-25 14:06:49 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-25 14:06:49 +0000
commitbd11c18ca4be1db69b01b9fd1c55ece8212d39de (patch)
tree116a4e60e92dc692e4d7ddfa2f5c48e0e94ac09b
parent4a478d8369df2ddc6012970be1ffcd4eccbcd2bd (diff)
downloadrpmdrake-bd11c18ca4be1db69b01b9fd1c55ece8212d39de.tar
rpmdrake-bd11c18ca4be1db69b01b9fd1c55ece8212d39de.tar.gz
rpmdrake-bd11c18ca4be1db69b01b9fd1c55ece8212d39de.tar.bz2
rpmdrake-bd11c18ca4be1db69b01b9fd1c55ece8212d39de.tar.xz
rpmdrake-bd11c18ca4be1db69b01b9fd1c55ece8212d39de.zip
When unignoring a media, if it's not usable as is, ask the user for the
permission to update it. If not, leave it ignored.
-rwxr-xr-xedit-urpm-sources.pl17
1 files changed, 16 insertions, 1 deletions
diff --git a/edit-urpm-sources.pl b/edit-urpm-sources.pl
index ee232d56..55eea35a 100755
--- a/edit-urpm-sources.pl
+++ b/edit-urpm-sources.pl
@@ -882,12 +882,27 @@ sub mainwindow {
$list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Updates?"), my $cu = Gtk2::CellRendererToggle->new, 'active' => 1));
$list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Medium"), Gtk2::CellRendererText->new, 'text' => 2));
+ my $reread_media; #- closure defined later
$tr->signal_connect(
toggled => sub {
my (undef, $path) = @_;
my $iter = $list->get_iter_from_string($path);
$urpm->{media}[$path]{ignore} = !$urpm->{media}[$path]{ignore} || undef;
$list->set($iter, 0, !$urpm->{media}[$path]{ignore});
+ $urpm->write_config;
+ my $ignored = $urpm->{media}[$path]{ignore};
+ $reread_media->();
+ if (!$ignored && $urpm->{media}[$path]{ignore}) {
+ #- Enabling this media failed, force update
+ interactive_msg('rpmdrake',
+ N("This medium needs to be updated to be usable. Update it now ?"),
+ yesno => 1,
+ ) and do {
+ my $wait = wait_msg(N("Please wait, updating medium..."));
+ $reread_media->($urpm->{media}[$path]{name});
+ remove_wait_msg($wait);
+ }
+ }
},
);
@@ -941,7 +956,7 @@ sub mainwindow {
}
);
- my $reread_media = sub {
+ $reread_media = sub {
my ($name) = @_;
$reorder_ok = 0;
$urpm = urpm->new;