summaryrefslogtreecommitdiffstats
path: root/FUNCTIONS
diff options
context:
space:
mode:
authorVlad Glagolev2011-06-20 21:11:28 +0400
committerVlad Glagolev2011-06-20 21:11:28 +0400
commit181c033d1a6c28cf7ccebf4265ef37d184857152 (patch)
tree89397d8f5e6575d4bc1b3fa21462af005ff0434d /FUNCTIONS
parenta8b0d07f2ccffb7c6e3eb6752e59d002597663f1 (diff)
added first draft for function is_version_less() to compare two versions
Diffstat (limited to 'FUNCTIONS')
-rwxr-xr-xFUNCTIONS7
1 files changed, 7 insertions, 0 deletions
diff --git a/FUNCTIONS b/FUNCTIONS
index 00cab135ff..2b2bedccda 100755
--- a/FUNCTIONS
+++ b/FUNCTIONS
@@ -703,6 +703,13 @@ function default_build_make(){
}
#---
+## Compare if one version is less than another (uses sort from coreutils)
+#---
+function is_version_less() {
+ [ ! $(echo -e "$1\n$2" | sort --version-sort | head -1) = "$2" ]
+}
+
+#---
## Simple version check with force depends
## @params $1 - the spell to check the version of
## @params $2 - the simple version to check against