sbotools2

Maintenance fork of the original sbotools version 2
Log | Files | Refs | README

commit 702615ed036e25b419b70539588eae8b2c1eeb72
parent fe22fa1ff4c2108613e5403d6f8b9f6dc2cc61aa
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date:   Mon,  5 Dec 2016 01:20:17 +0200

SBO::Lib::Util: update documentation for version_cmp. This closes #45.

Diffstat:
MSBO-Lib/lib/SBO/Lib/Util.pm | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/SBO-Lib/lib/SBO/Lib/Util.pm b/SBO-Lib/lib/SBO/Lib/Util.pm @@ -506,17 +506,18 @@ sub usage_error { C<version_cmp()> will compare C<$ver1> with C<$ver2> to try to determine which is bigger than the other, and returns 1 if C<$ver1> is bigger, -1 if C<$ver2> is bigger, and 0 if they are just as big. Before making the comparison, it will -strip off the version of your running kernel if it happens to be appended to -the version string being compared. +strip off the version of your running kernel as well as any locale information +if it happens to be appended to the version string being compared. =cut # wrapper around versioncmp for checking if versions have kernel version -# appended to them +# or locale info appended to them sub version_cmp { my ($v1, $v2) = @_; my $kv = get_kernel_version(); + # strip off kernel version if ($v1 =~ /(.+)_\Q$kv\E$/) { $v1 = $1 } if ($v2 =~ /(.+)_\Q$kv\E$/) { $v2 = $1 }