diff options
| author | Leah Rowe <leah@libreboot.org> | 2025-05-19 18:53:22 +0100 | 
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2025-05-19 18:53:22 +0100 | 
| commit | b25a4876434d371dc4278d71365574158c77d47d (patch) | |
| tree | 29df67f19841d4227a2253c11b9fe7b4025f3dc8 /include | |
| parent | 769a97aed5a712c80141fee8da60868c437fbf36 (diff) | |
init.sh: looser XBMK_THREADS validation
on child processes, we can simply correct it.
we currently provide an error message, but this is silly.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/init.sh | 15 | 
1 files changed, 9 insertions, 6 deletions
| diff --git a/include/init.sh b/include/init.sh index cd4acf43..38eb1c81 100644 --- a/include/init.sh +++ b/include/init.sh @@ -30,7 +30,7 @@ xbmk_init()  	id -u 1>/dev/null 2>/dev/null || err "suid check failed (id -u)"  	[ "$(id -u)" != "0" ] || err "this command as root is not permitted" -	for init_cmd in get_version set_env git_init child_exec; do +	for init_cmd in get_version set_env set_threads git_init child_exec; do  		xbmk_$init_cmd "$@" || break  	done  } @@ -76,7 +76,7 @@ xbmk_set_env()  	if [ "$is_child" = "y" ]; then  		[ -z "${XBMK_CACHE+x}" ] && err "XBMK_CACHE unset on child" -		[ -z "${XBMK_THREADS+x}" ] && err "XBMK_THREADS unset on child" +		[ -z "${XBMK_THREADS+x}" ] && xbmk_set_threads  		e "lock" f missing && err "lock file absent on child"  		return 1  	fi @@ -104,10 +104,6 @@ xbmk_set_env()  	[ "$XBMK_RELEASE" = "Y" ] && export XBMK_RELEASE="y"  	[ "$XBMK_RELEASE" = "y" ] || export XBMK_RELEASE="n" -	[ -z "${XBMK_THREADS+x}" ] && export XBMK_THREADS=1 -	expr "X$XBMK_THREADS" : "X-\{0,1\}[0123456789][0123456789]*$" \ -	    1>/dev/null 2>/dev/null || export XBMK_THREADS=1 -  	xbmk_set_version  	export LOCALVERSION="-$projectname-${version%%-*}" @@ -117,6 +113,13 @@ xbmk_set_env()  	xbmk_set_pyver  } +xbmk_set_threads() +{ +	[ -z "${XBMK_THREADS+x}" ] && export XBMK_THREADS=1 +	expr "X$XBMK_THREADS" : "X-\{0,1\}[0123456789][0123456789]*$" \ +	    1>/dev/null 2>/dev/null || export XBMK_THREADS=1 +} +  xbmk_set_version()  {  	version_="$version" | 
