diff options
author | Ismael Luceno | 2021-02-13 19:33:47 +0100 |
---|---|---|
committer | Ismael Luceno | 2021-02-13 19:42:02 +0100 |
commit | a518eba5bf40239f3ab4ed5d5518770039c64cc9 (patch) | |
tree | 88c47e1be4a7405a3a41df45a981de503b8dd877 /FUNCTIONS | |
parent | e688ec7a7882cd079b308c2034b5ad422da9e530 (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-x | FUNCTIONS | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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" ] } #--- |