From 9bc390516a520c7588787a95e15426110372b7ad Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Tue, 21 Jan 2003 10:58:56 +0000 Subject: fix "update sources" dialog which didn't update the asked mediums --- rpmdrake.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'rpmdrake.pm') diff --git a/rpmdrake.pm b/rpmdrake.pm index aa4dbca8..b99c24f9 100644 --- a/rpmdrake.pm +++ b/rpmdrake.pm @@ -337,7 +337,7 @@ by Mandrake Linux Official Updates.")), return ''; sub update_sources { my ($urpm, %opts) = @_; my $w = ugtk2->new(N("Update source(s)"), grab => 1, center => 1, %opts); - my (@buttons, @sources_to_update); + my @buttons; gtkadd($w->{window}, gtkpack__(Gtk2::VBox->new(0,5), Gtk2::Label->new(N("Select the source(s) you wish to update:")), @@ -345,13 +345,12 @@ sub update_sources { Gtk2::HSeparator->new, gtkpack(create_hbox(), gtksignal_connect(Gtk2::Button->new(N("Update")), clicked => sub { - $w->{retval} = 1; - @sources_to_update = grep { $_->get_active } @buttons; + $w->{retval} = any { $_->get_active } @buttons; + each_index { $_->get_active and $urpm->select_media($urpm->{media}[$::i]{name}) } @buttons; Gtk2->main_quit; }), gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => sub { $w->{retval} = 0; Gtk2->main_quit })))); - if ($w->main && @sources_to_update) { - each_index { $urpm->select_media($urpm->{media}[$::i]{name}) } @sources_to_update; + if ($w->main) { foreach (@{$urpm->{media}}) { #- force ignored media to be returned alive (forked from urpmi.updatemedia...) $_->{modified} and delete $_->{ignore}; } -- cgit v1.2.1