mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-27 18:13:08 +02:00
build-system: use_flags in YAML config file
This commit is contained in:
@@ -328,7 +328,7 @@ readonly -f pbuild::version_eq
|
|||||||
#..............................................................................
|
#..............................................................................
|
||||||
#
|
#
|
||||||
pbuild::use_flag() {
|
pbuild::use_flag() {
|
||||||
[[ "${USE_FLAGS}" == *:${1}:* ]]
|
[[ "${ModuleConfig['use_flags']}" =~ " ${1} " ]]
|
||||||
}
|
}
|
||||||
readonly -f pbuild::use_flag
|
readonly -f pbuild::use_flag
|
||||||
|
|
||||||
|
|||||||
+9
-10
@@ -243,14 +243,6 @@ parse_args() {
|
|||||||
--check-mode )
|
--check-mode )
|
||||||
opt_check_mode='yes'
|
opt_check_mode='yes'
|
||||||
;;
|
;;
|
||||||
--use-flags | --use-flags=* )
|
|
||||||
if [[ $1 == *=* ]]; then
|
|
||||||
USE_FLAGS=":${1#--*=}:"
|
|
||||||
else
|
|
||||||
USE_FLAGS=":$2:"
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
--with | --with=*/* )
|
--with | --with=*/* )
|
||||||
if [[ $1 == *=* ]]; then
|
if [[ $1 == *=* ]]; then
|
||||||
opt_with_modules+=( "${1#--*=}" )
|
opt_with_modules+=( "${1#--*=}" )
|
||||||
@@ -457,13 +449,13 @@ init_module_environment(){
|
|||||||
parse_version() {
|
parse_version() {
|
||||||
local v="$1"
|
local v="$1"
|
||||||
V="$1"
|
V="$1"
|
||||||
USE_FLAGS=${USE_FLAGS:-''}
|
|
||||||
|
|
||||||
local tmp=''
|
local tmp=''
|
||||||
|
SUFFIX=''
|
||||||
|
|
||||||
if [[ "$v" =~ "_" ]]; then
|
if [[ "$v" =~ "_" ]]; then
|
||||||
tmp="${v#*_}"
|
tmp="${v#*_}"
|
||||||
USE_FLAGS+=":${tmp//_/:}:"
|
SUFFIX+=":${tmp//_/:}:"
|
||||||
v="${v%%_*}"
|
v="${v%%_*}"
|
||||||
fi
|
fi
|
||||||
V_PKG="${v%%-*}" # version without the release number
|
V_PKG="${v%%-*}" # version without the release number
|
||||||
@@ -545,6 +537,7 @@ declare -A Yaml_default_config=(
|
|||||||
['sub_packages']='' # !!map
|
['sub_packages']='' # !!map
|
||||||
['target_cpus']='' # !!seq of strings
|
['target_cpus']='' # !!seq of strings
|
||||||
['urls']='' # !!map
|
['urls']='' # !!map
|
||||||
|
['use_flags']='' # !!seq
|
||||||
['use_overlays']='' # !!seq
|
['use_overlays']='' # !!seq
|
||||||
['variant']='' # !!str
|
['variant']='' # !!str
|
||||||
)
|
)
|
||||||
@@ -773,6 +766,12 @@ build_modules_yaml_v1(){
|
|||||||
pm::get_value "${yaml_input}" value "${key}" '!!map'
|
pm::get_value "${yaml_input}" value "${key}" '!!map'
|
||||||
cfg[${key,,}]="${value}"
|
cfg[${key,,}]="${value}"
|
||||||
;;
|
;;
|
||||||
|
use_flags )
|
||||||
|
pm::get_seq "${yaml_input}" value "${key}"
|
||||||
|
local -a tmp=()
|
||||||
|
readarray -t tmp <<<"${value}"
|
||||||
|
cfg[${key,,}]=" ${tmp[*]} "
|
||||||
|
;;
|
||||||
relstage )
|
relstage )
|
||||||
pm::get_value "${yaml_input}" value "${key}" '!!str'
|
pm::get_value "${yaml_input}" value "${key}" '!!str'
|
||||||
case ${value,,} in
|
case ${value,,} in
|
||||||
|
|||||||
Reference in New Issue
Block a user