summaryrefslogtreecommitdiffstats
path: root/perl-install/common.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r--perl-install/common.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index adaa07a0d..7aea9bc17 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -488,4 +488,16 @@ sub update_gnomekderc_no_create {
}
}
+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;
+}
+
1;