pveversion: sort kernel packages by version

instead of lexically by package name

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2018-02-16 10:49:27 +01:00 committed by Thomas Lamprecht
parent 373d7ea44e
commit 0459599d1a

View File

@ -24,8 +24,8 @@ use JSON;
use PVE::JSONSchema qw(get_standard_option);
use AptPkg::Cache;
use AptPkg::Version;
use AptPkg::PkgRecords;
use Dpkg::Version;
my $get_apt_cache = sub {
@ -521,7 +521,8 @@ __PACKAGE__->register_method({
# order most important things first
my @list = qw(proxmox-ve pve-manager);
push @list, grep { /^pve-kernel-/ && $cache->{$_}->{CurrentState} eq 'Installed' } sort keys %$cache;
my $byver = sub { version_compare($cache->{$b}->{CurrentVer}->{VerStr}, $cache->{$a}->{CurrentVer}->{VerStr}) };
push @list, sort $byver grep { /^pve-kernel-/ && $cache->{$_}->{CurrentState} eq 'Installed' } keys %$cache;
my @opt_pack = qw(
ceph