mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-27 10:03:08 +02:00
modbuild: fix for issue #1371 (select variant to build on cmd line)
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
GroupDepths($group) was undefined in the function get\_load\_hints().
|
||||
(#1368)
|
||||
|
||||
### Build system
|
||||
* Bugfix: Selecting the variant to build on the cmd-line did not work.
|
||||
(#1371)
|
||||
|
||||
## Version 2.0.5
|
||||
### modulecmd
|
||||
|
||||
|
||||
+17
-6
@@ -1272,15 +1272,26 @@ build_modules_yaml_v1(){
|
||||
|
||||
}
|
||||
|
||||
# build this variant?
|
||||
local -- build_variant="${opt_variant:-${config['default_variant']}}"
|
||||
if [[ ":${config['variant']}:" != *:${build_variant}:* ]]; then
|
||||
debug "don't build this variant: ${config['variant']} != *:${build_variant}:*"
|
||||
return 0
|
||||
fi
|
||||
check_variant(){
|
||||
local -- build_variant="${opt_variant:-${config['default_variant']}}"
|
||||
# don't build if a variant has be specified on the command line or
|
||||
# a default variant has been set in the config file, but no
|
||||
# variant name is defined here
|
||||
[[ -n ${build_variant} && -z ${config['variant']} ]] && return 1
|
||||
[[ -z ${config['variant']} ]] && return 1
|
||||
set -o noglob
|
||||
local -a items=( "${config['variant'],,}" )
|
||||
set +o noglob
|
||||
local item=''
|
||||
for item in "${items[@]}"; do
|
||||
[[ "${opt_variant}" == "${item}" ]] && return 0
|
||||
done
|
||||
}
|
||||
|
||||
check_kernel module_config || return 1
|
||||
check_target_cpu module_config || return 1
|
||||
check_system module_config || return 1
|
||||
check_variant module_config || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user