summaryrefslogtreecommitdiffstats
path: root/FUNCTIONS
diff options
context:
space:
mode:
authorIsmael Luceno2021-02-13 18:35:48 +0100
committerIsmael Luceno2021-02-13 19:02:43 +0100
commit217f1108f14e135085ccaa9a85fe3596514e85b5 (patch)
treeab44e7be8fd5b53d6668263de149f00245b5d045 /FUNCTIONS
parentd523cfc301c17731bde576b86a0cea5f30dcade2 (diff)
Add improved vdepends implementation
Example: LANGS="ADA,FORTRAN" LANGFLAGS="--enable-ada --enable-fortran" vdepends << EOF gcc[$LANGS] >= 6.0 < 7.0 flags: $LANGFLAGS binutils[LIBERTY] >= 2.35 flags: --with-liberty EOF This changes the format and adds support for: - chained comparisons - sub-dependencies - comment lines Now the check is done against the grimoire version of the spell too, to avoid casting a spell that can't satisfy the dependency.
Diffstat (limited to 'FUNCTIONS')
-rwxr-xr-xFUNCTIONS28
1 files changed, 0 insertions, 28 deletions
diff --git a/FUNCTIONS b/FUNCTIONS
index b93b30c605..1928748da8 100755
--- a/FUNCTIONS
+++ b/FUNCTIONS
@@ -934,34 +934,6 @@ function check_tmp_noexec() {
}
#---
-## Versioned dependency list from stdin.
-## Takes one dependency per line. Format:
-## <dependency> <comparison operator> <version> <flags>
-#---
-vdepends(){
- while read dep op depver flags; do
- case "$op" in
- '>'|'>='|'<'|'<='|'='|'!='|'') ;;
- *)
- message "${PROBLEM_COLOR}Unsupported operator \"$op\".$DEFAULT_COLOR"
- return 1
- ;;
- esac
- depends "$dep" "$flags" || return
- spell_ok "$dep" || continue
- local iver="$(installed_version "$dep")"
- case "$op" in
- '>') ! is_version_less "$iver" "$depver" && [ "x$iver" != "x$depver" ] ;;
- '>=') ! is_version_less "$iver" "$depver" ;;
- '<') is_version_less "$iver" "$depver" ;;
- '<=') is_version_less "$iver" "$depver" || [ "x$iver" = "x$depver" ] ;;
- '=') [ "x$iver" = "x$depver" ] ;;
- '!=') [ "x$iver" != "x$depver" ] ;;
- esac || force_depends "$dep"
- done
-}
-
-#---
## Find a file matching some pattern(s) as installed by the chosen
## provider, e.g. /usr/bin/python3 for python3 providing PYTHON.
## @params $1 - spell at hand