From 4f58927bc12ca560f83fc2247c7dcbe17171e7f1 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Fri, 23 Aug 2002 09:43:39 +0000 Subject: callback_choices: when a choice has to be made involving locales, autochoose the package requiring the locales already installed on the machine, or the package requiring an already selected locale --- rpmdrake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rpmdrake b/rpmdrake index e16c25ed..689d72e4 100755 --- a/rpmdrake +++ b/rpmdrake @@ -197,6 +197,18 @@ sub run_treeview_dialog { my $formatlistpkg = sub { myformatList(sort { uc($a) cmp uc($b) } @_) }; my $callback_choices = sub { my ($urpm, $db, $state, $choices) = @_; + foreach my $pkg (@$choices) { + foreach ($pkg->requires_nosense) { + /locales-/ or next; + foreach (keys %{$urpm->{provides}{$_} || {}}) { + $urpm->{depslist}[$_]->flag_selected or next; + return $pkg; + } + my $autochoice; + db->traverse_tag('name', [ $_ ], sub { $autochoice ||= $pkg }); + $autochoice and return $autochoice; + } + } $choices->[interactive_list(_("Please choose"), _("One of the following packages is needed:"), map { my_fullname($_) } @$choices)]; }; my $choices_auto; -- cgit v1.2.1