aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-02-17 17:22:46 +0000
committerThierry Vignaud <tv@mageia.org>2012-02-17 17:22:46 +0000
commit5aa5a10d9bfce29570d4765cf646da8762efc418 (patch)
tree30c2a70ca22ab4bc1592034effcd1778df7a033e
parent248c4c50f3b8aa2bab0b04bd3e27c6121e9af3fc (diff)
downloadrpmdrake-5aa5a10d9bfce29570d4765cf646da8762efc418.tar
rpmdrake-5aa5a10d9bfce29570d4765cf646da8762efc418.tar.gz
rpmdrake-5aa5a10d9bfce29570d4765cf646da8762efc418.tar.bz2
rpmdrake-5aa5a10d9bfce29570d4765cf646da8762efc418.tar.xz
rpmdrake-5aa5a10d9bfce29570d4765cf646da8762efc418.zip
(sort_packages_biarch) better packages sorting (x86_64 first)
-rw-r--r--NEWS2
-rw-r--r--Rpmdrake/pkg.pm7
2 files changed, 7 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index cb81d2c1..f10a1847 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- even better packages sorting in searches (x86_64 first)
+
Version 5.28 - 15 January 2012, Thierry Vignaud
- fix french translation (mga#1523)
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index ff37d59d..98470f6a 100644
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -66,8 +66,11 @@ use ugtk2 qw(:all);
our $priority_up_alread_warned;
sub sort_packages_biarch {
- my ($x64, $other) = partition { !/86$/ } @_;
- (sort { uc($a) cmp uc($b) } @$x64), sort { uc($a) cmp uc($b) } @$other;
+ sort {
+ my ($na, $aa) = $a =~ /^(.*-[^-]+-[^-]+)\.([^.-]+)$/;
+ my ($nb, $ab) = $b =~ /^(.*-[^-]+-[^-]+)\.([^.-]+)$/;
+ $na cmp $nb || ($ab =~ /64$/) <=> ($aa =~ /64$/);
+ } @_;
}
sub sort_packages_monoarch {