mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 05:36:47 +00:00
buildsystem: add is_sequential_build() helper
This commit is contained in:
parent
439f38bcff
commit
96c510394d
@ -775,6 +775,11 @@ do_autoreconf() {
|
||||
fi
|
||||
}
|
||||
|
||||
# True if this is a sequential build, false if multithreaded
|
||||
is_sequential_build() {
|
||||
[ "${MTWITHLOCKS}" != "yes" ] && return 0 || return 1
|
||||
}
|
||||
|
||||
|
||||
### PACKAGE HELPERS ###
|
||||
# get variable ($2) for package ($1).
|
||||
@ -1366,7 +1371,7 @@ enable_service() {
|
||||
|
||||
|
||||
### MULTI-THREADED FUNCTION HELPERS ###
|
||||
# Test MTWITHLOCKS so that these functions are a no-op during non-multithreaded builds.
|
||||
# Test build type so that these functions are a no-op during non-multithreaded builds.
|
||||
|
||||
# Prevent concurrent modifications to a package (unpack) or
|
||||
# package:target (install/build).
|
||||
@ -1374,7 +1379,7 @@ enable_service() {
|
||||
# If a package is already locked and the owner is ourselves
|
||||
# then assume we already have the required lock.
|
||||
pkg_lock() {
|
||||
[ "${MTWITHLOCKS}" != "yes" ] && return 0
|
||||
is_sequential_build && return 0
|
||||
|
||||
local pkg="$1" task="$2" parent_pkg="$3"
|
||||
local this_job="${MTJOBID}"
|
||||
@ -1414,7 +1419,7 @@ EOF
|
||||
|
||||
# Log additional information for a locked package.
|
||||
pkg_lock_status() {
|
||||
[ "${MTWITHLOCKS}" != "yes" ] && return 0
|
||||
is_sequential_build && return 0
|
||||
|
||||
local status="$1" pkg="$2" task="$3" msg="$4"
|
||||
local this_job="${MTJOBID}" line idwidth
|
||||
@ -1453,7 +1458,7 @@ pkg_lock_status() {
|
||||
}
|
||||
|
||||
update_dashboard() {
|
||||
[ "${MTWITHLOCKS}" != "yes" ] && return 0
|
||||
is_sequential_build && return 0
|
||||
|
||||
local status="$1" pkg="$2" task="$3" msg="$4"
|
||||
local line preamble num elapsed projdevarch
|
||||
@ -1503,7 +1508,7 @@ update_dashboard() {
|
||||
# Thread concurrency helpers to avoid concurrency issues with some code,
|
||||
# eg. when Python installs directly into $TOOLCHAIN.
|
||||
acquire_exclusive_lock() {
|
||||
[ "${MTWITHLOCKS}" != "yes" ] && return 0
|
||||
is_sequential_build && return 0
|
||||
|
||||
local pkg="$1" task="$2" lockfile="${3:-global}"
|
||||
local this_job="${MTJOBID}"
|
||||
@ -1528,7 +1533,7 @@ acquire_exclusive_lock() {
|
||||
}
|
||||
|
||||
release_exclusive_lock() {
|
||||
[ "${MTWITHLOCKS}" != "yes" ] && return 0
|
||||
is_sequential_build && return 0
|
||||
|
||||
local pkg="$1" task="$2" lockfile="${3:-global}"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user