From 5aa5a10d9bfce29570d4765cf646da8762efc418 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 17 Feb 2012 17:22:46 +0000 Subject: (sort_packages_biarch) better packages sorting (x86_64 first) --- Rpmdrake/pkg.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Rpmdrake/pkg.pm') 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 { -- cgit v1.2.1