Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
packages - allow enabling/disabling a module with comparison flags
rp_module_flags can now contain a variable comparison to enable or disable a scriptmodule.
The comparison should be in the format :$var:cmp:val or !:$var:cmp:val
eg. :$__gcc_version:-lt:7 would be evaluated as [[ $__gcc_version -lt 7 ]]
This would enable a module if the comparison was true or disable if !:$__gcc_version:-lt:7 was used.
Only global variables set before modules are loaded (eg via system.sh) are supported.
$ is escaped so variables are not evaluated when the module is sourced.
It works without, but provides less useful information in the setup menus as the variable name will not be visible.
Convert modules to using variable comparisons in flags
Replace GCC version checks in depends_* functions with variable comparisons in flags.
mysticmine - Disable on Debian versions newer than 10 (buster)
The scriptmodule requires Python2 and python modules that are no longer packaged.
This is a rework of the functionality in the draft PR #3907 but using module flags over a hook function.
It's more compact, and covers most cases we need. It also has the advantage of providing some information for disabled modules in the setup gui.
@cmitu thoughts ?