mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-27 20:56:55 +00:00
config/functions: remove non-mt support in update_dashboard()
This commit is contained in:
parent
b272bcb999
commit
c3913ab9ae
@ -1312,11 +1312,13 @@ pkg_lock_status() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
update_dashboard() {
|
update_dashboard() {
|
||||||
|
[ "${MTWITHLOCKS}" != "yes" ] && return 0
|
||||||
|
|
||||||
local status="$1" pkg="$2" task="$3" msg="$4"
|
local status="$1" pkg="$2" task="$3" msg="$4"
|
||||||
local line sedline preamble num elapsed projdevarch
|
local line sedline preamble num elapsed projdevarch
|
||||||
local boldred boldgreen boldyellow endcolor
|
local boldred boldgreen boldyellow endcolor
|
||||||
|
|
||||||
[ -n "${MTJOBID}" ] && sedline=$((MTJOBID + 2)) || sedline=1
|
sedline=$((MTJOBID + 2))
|
||||||
|
|
||||||
num=$(cat "${THREAD_CONTROL}/status" | wc -l)
|
num=$(cat "${THREAD_CONTROL}/status" | wc -l)
|
||||||
while [ ${num} -lt ${sedline} ]; do echo "" >>"${THREAD_CONTROL}/status"; num=$((num + 1)); done
|
while [ ${num} -lt ${sedline} ]; do echo "" >>"${THREAD_CONTROL}/status"; num=$((num + 1)); done
|
||||||
@ -1329,30 +1331,26 @@ update_dashboard() {
|
|||||||
printf -v preamble "%s Dashboard (%s) - %d of %d jobs completed, %s elapsed" "${DISTRONAME}" "${projdevarch}" ${num} ${MTMAXJOBS} "${elapsed}"
|
printf -v preamble "%s Dashboard (%s) - %d of %d jobs completed, %s elapsed" "${DISTRONAME}" "${projdevarch}" ${num} ${MTMAXJOBS} "${elapsed}"
|
||||||
printf -v preamble "%b%-105s %s" "\e[2J\e[0;0H" "${preamble//\//\\/}" "$(date "+%Y-%m-%d %H:%M:%S")"
|
printf -v preamble "%b%-105s %s" "\e[2J\e[0;0H" "${preamble//\//\\/}" "$(date "+%Y-%m-%d %H:%M:%S")"
|
||||||
|
|
||||||
# Only update the header when caller is not a worker thread
|
if [ "${DISABLE_COLORS}" != "yes" ]; then
|
||||||
if [ -z "${MTJOBID}" ]; then
|
boldred="\e[1;31m"
|
||||||
sed -e "1s/.*/${preamble}/" -i "${THREAD_CONTROL}/status"
|
boldgreen="\e[1;32m"
|
||||||
else
|
boldyellow="\e[1;33m"
|
||||||
if [ "${DISABLE_COLORS}" != "yes" ]; then
|
white="\e[0;37m"
|
||||||
boldred="\e[1;31m"
|
endcolor="\e[0m"
|
||||||
boldgreen="\e[1;32m"
|
|
||||||
boldyellow="\e[1;33m"
|
|
||||||
white="\e[0;37m"
|
|
||||||
endcolor="\e[0m"
|
|
||||||
|
|
||||||
case "${status}" in
|
case "${status}" in
|
||||||
IDLE) color="${white}";;
|
IDLE) color="${white}";;
|
||||||
STALLED) color="${boldyellow}";;
|
STALLED) color="${boldyellow}";;
|
||||||
MUTEX/W) color="${boldyellow}";;
|
MUTEX/W) color="${boldyellow}";;
|
||||||
FAILED ) color="${boldred}";;
|
FAILED ) color="${boldred}";;
|
||||||
*) color="${boldgreen}";;
|
*) color="${boldgreen}";;
|
||||||
esac
|
esac
|
||||||
fi
|
|
||||||
|
|
||||||
printf -v line "[%02d\/%0*d] %b%-7s%b %-7s %-35s" ${MTJOBID} ${#MTMAXJOBS} ${PARALLEL_SEQ:-0} "${color}" "${status//\//\\/}" "${endcolor}" "${task}" "${pkg}"
|
|
||||||
[ -n "${msg}" ] && line+=" ${msg//\//\\/}"
|
|
||||||
sed -e "1s/.*/${preamble}/;${sedline}s/.*/${line}/" -i "${THREAD_CONTROL}/status"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
printf -v line "[%02d\/%0*d] %b%-7s%b %-7s %-35s" ${MTJOBID} ${#MTMAXJOBS} ${PARALLEL_SEQ:-0} "${color}" "${status//\//\\/}" "${endcolor}" "${task}" "${pkg}"
|
||||||
|
[ -n "${msg}" ] && line+=" ${msg//\//\\/}"
|
||||||
|
|
||||||
|
sed -e "1s/.*/${preamble}/;${sedline}s/.*/${line}/" -i "${THREAD_CONTROL}/status"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Thread concurrency helpers to avoid concurrency issues with some code,
|
# Thread concurrency helpers to avoid concurrency issues with some code,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user