summaryrefslogtreecommitdiffstats
path: root/perl-install/any.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2011-07-27 10:27:02 +0000
committerThierry Vignaud <tv@mageia.org>2011-07-27 10:27:02 +0000
commit7747ee1f6f2a7f21c089b3b1d28c31bdc6bc58f9 (patch)
tree69b47763fbbdab70dcfa3a13d5528cd990a15858 /perl-install/any.pm
parentda65e2b625f7fadc173a6699c2622cc241f08be0 (diff)
downloaddrakx-7747ee1f6f2a7f21c089b3b1d28c31bdc6bc58f9.tar
drakx-7747ee1f6f2a7f21c089b3b1d28c31bdc6bc58f9.tar.gz
drakx-7747ee1f6f2a7f21c089b3b1d28c31bdc6bc58f9.tar.bz2
drakx-7747ee1f6f2a7f21c089b3b1d28c31bdc6bc58f9.tar.xz
drakx-7747ee1f6f2a7f21c089b3b1d28c31bdc6bc58f9.zip
move bootloader::cmp_kernel_versions() from bootloader to any for drakx-net (#1266)
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r--perl-install/any.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index da0a0d37a..4fdcd745d 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -103,6 +103,18 @@ sub add_users {
}
}
+sub cmp_kernel_versions {
+ my ($va, $vb) = @_;
+ my $rel_a = $va =~ s/-(.*)$// && $1;
+ my $rel_b = $vb =~ s/-(.*)$// && $1;
+ ($va, $vb) = map { [ split /[.-]/ ] } $va, $vb;
+ my $r = 0;
+ mapn_ {
+ $r ||= $_[0] <=> $_[1];
+ } $va, $vb;
+ $r || $rel_a <=> $rel_b || $rel_a cmp $rel_b;
+}
+
sub install_bootloader_pkgs {
my ($do_pkgs, $b) = @_;