aboutsummaryrefslogtreecommitdiff
path: root/SBO-Lib/lib/SBO/Lib/Util.pm
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-12-05 01:20:17 +0200
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-12-05 01:20:17 +0200
commit702615ed036e25b419b70539588eae8b2c1eeb72 (patch)
tree9de564d7ae22a7df393edc6018e789442a9cf8dc /SBO-Lib/lib/SBO/Lib/Util.pm
parentfe22fa1ff4c2108613e5403d6f8b9f6dc2cc61aa (diff)
downloadsbotools-702615ed036e25b419b70539588eae8b2c1eeb72.tar.xz
SBO::Lib::Util: update documentation for version_cmp. This closes #45.
Diffstat (limited to 'SBO-Lib/lib/SBO/Lib/Util.pm')
-rw-r--r--SBO-Lib/lib/SBO/Lib/Util.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/SBO-Lib/lib/SBO/Lib/Util.pm b/SBO-Lib/lib/SBO/Lib/Util.pm
index 3c98780..6c38382 100644
--- 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 }