diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2002-08-23 09:43:39 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2002-08-23 09:43:39 +0000 |
commit | 4f58927bc12ca560f83fc2247c7dcbe17171e7f1 (patch) | |
tree | 917e4d6018462c7b505c200f49107610ee71401a | |
parent | c6b160b42e2afe9ab00e2b7a53f75a8700edbfc2 (diff) | |
download | rpmdrake-4f58927bc12ca560f83fc2247c7dcbe17171e7f1.tar rpmdrake-4f58927bc12ca560f83fc2247c7dcbe17171e7f1.tar.gz rpmdrake-4f58927bc12ca560f83fc2247c7dcbe17171e7f1.tar.bz2 rpmdrake-4f58927bc12ca560f83fc2247c7dcbe17171e7f1.tar.xz rpmdrake-4f58927bc12ca560f83fc2247c7dcbe17171e7f1.zip |
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
-rwxr-xr-x | rpmdrake | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; |