summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2016-06-22 13:49:20 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-06-22 13:49:20 +0200
commit0726abff2a415474933eaf88981d259117969dfe (patch)
tree72d3e5d798afea86e100fdc1ac0d11b51630d128
parent73480a6a3a2b47b70b1ca6ac6c961d3912fa71ad (diff)
downloaddrakx-0726abff2a415474933eaf88981d259117969dfe.tar
drakx-0726abff2a415474933eaf88981d259117969dfe.tar.gz
drakx-0726abff2a415474933eaf88981d259117969dfe.tar.bz2
drakx-0726abff2a415474933eaf88981d259117969dfe.tar.xz
drakx-0726abff2a415474933eaf88981d259117969dfe.zip
sort service categories, putting "Other" at end
Resolves: mga#6286
-rw-r--r--perl-install/install/NEWS3
-rw-r--r--perl-install/services.pm7
2 files changed, 9 insertions, 1 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 1deb906d5..ffd13636e 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,6 @@
+- summary:
+ o sort service categories, putting "Other" at end (mga#6286)
+
Version 17.43 - 22 June 2016
- summary:
diff --git a/perl-install/services.pm b/perl-install/services.pm
index d80c54558..6ea7d5c2e 100644
--- a/perl-install/services.pm
+++ b/perl-install/services.pm
@@ -193,8 +193,13 @@ sub ask_ {
node_state => sub { $services{$_[0]} ? 'selected' : 'unselected' },
build_tree => sub {
my ($add_node, $flat) = @_;
+ # sort existing services by category, putting "Other" at end
+ my @srvs = grep { $services{$_} } map { @{$root_services{$_}} }
+ sort { $a cmp $b } keys %root_services;
+ # put "Others" last:
+ push @srvs, difference2([ keys %services ], \@srvs);
$add_node->($_, !$flat && ($services_root{$_} || N("Other")))
- foreach sort keys %services;
+ foreach @srvs;
},
grep_unselected => sub { grep { !$services{$_} } @_ },
toggle_nodes => sub {