summaryrefslogtreecommitdiffstats
path: root/FUNCTIONS
diff options
context:
space:
mode:
authorIsmael Luceno2021-02-13 19:33:47 +0100
committerIsmael Luceno2021-02-13 19:42:02 +0100
commita518eba5bf40239f3ab4ed5d5518770039c64cc9 (patch)
tree88c47e1be4a7405a3a41df45a981de503b8dd877 /FUNCTIONS
parente688ec7a7882cd079b308c2034b5ad422da9e530 (diff)
FUNCTIONS: Fix and simplify the is_version_less function
The function wrongly compared for "less than or equal to", this fixes that by inverting the order of the arguments plus simplifies it a bit by just comparing the input to the output.
Diffstat (limited to 'FUNCTIONS')
-rwxr-xr-xFUNCTIONS6
1 files changed, 4 insertions, 2 deletions
diff --git a/FUNCTIONS b/FUNCTIONS
index 1928748da8..d770aa010a 100755
--- a/FUNCTIONS
+++ b/FUNCTIONS
@@ -882,8 +882,10 @@ 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" ]
+is_version_less() {
+ local v="$2
+$1"
+ ! [ "$(sort -V <<< "$v")" = "$v" ]
}
#---