Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Ismael Luceno (a518eba5bf40239f3ab4ed5d5518770039c64cc9)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Ismael Luceno (a518eba5bf40239f3ab4ed5d5518770039c64cc9)
  • Date: Sat, 13 Feb 2021 18:36:37 +0000

GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:

FUNCTIONS | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit a518eba5bf40239f3ab4ed5d5518770039c64cc9
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

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.

diff --git a/FUNCTIONS b/FUNCTIONS
index 1928748..d770aa0 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" ]
}

#---



  • [SM-Commit] GIT changes to master grimoire by Ismael Luceno (a518eba5bf40239f3ab4ed5d5518770039c64cc9), Ismael Luceno, 02/13/2021

Archive powered by MHonArc 2.6.24.

Top of Page