From 5668430f2dfc8512118e734c1263087b7f50856c Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 2 Mar 2001 14:58:39 +0000 Subject: (choosePackagesTree): in the tree, "Other" must be after the "best" packages --- perl-install/install_steps_gtk.pm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm index 590c83760..9bdecce34 100644 --- a/perl-install/install_steps_gtk.pm +++ b/perl-install/install_steps_gtk.pm @@ -324,11 +324,21 @@ sub choosePackagesTree { $add_node->($_, undef) foreach sort grep { my $pkg = pkgs::packageByName($packages, $_); pkgs::packageMedium($pkg)->{selected} } keys %{$packages->{names}}; } else { + my (@others, $old_root); foreach (sort @$compss) { ($root, $leaf) = m|(.*)/(.+)|o or ($root, $leaf) = ('', $_); + if ($root ne $old_root) { + $add_node->($_, $old_root . '/' . _("Other")) foreach @others; + @others = (); + $old_root = $root + } my $pkg = pkgs::packageByName($packages, $leaf); - $root .= '/' . _("Other") if pkgs::packageRate($pkg) < 4; - $add_node->($leaf, $root) if pkgs::packageMedium($pkg)->{selected}; + pkgs::packageMedium($pkg)->{selected} or next; + if (pkgs::packageRate($pkg) < 4) { + push @others, $leaf; + } else { + $add_node->($leaf, $root); + } } } $tree->thaw; -- cgit v1.2.1