mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-01-29 15:44:03 +00:00
Hop, a somewhat more efficient progress bar, less CPU consuming, if that was a problem :-)
(a litlle recreation while toochains are building...)
This commit is contained in:
parent
9bed636293
commit
823a283d19
@ -45,12 +45,13 @@ if [ "${CT_LOG_PROGRESS_BAR}" = "y" ]; then
|
||||
printf "[%02d:%02d]" $((elapsed/60)) $((elapsed%60))
|
||||
}
|
||||
_CT_PROG_BAR() {
|
||||
[ $((cpt/10)) -eq 0 ] && echo -en "\r`_CT_PROG_BAR_DATE` /"
|
||||
[ $((cpt/10)) -eq 1 ] && echo -en "\r`_CT_PROG_BAR_DATE` -"
|
||||
[ $((cpt/10)) -eq 2 ] && echo -en "\r`_CT_PROG_BAR_DATE` \\"
|
||||
[ $((cpt/10)) -eq 3 ] && echo -en "\r`_CT_PROG_BAR_DATE` |"
|
||||
cpt=$(((cpt+1)%40))
|
||||
[ ${CT_PROG_BAR_CPT} -eq 0 ] && echo -en "\r`_CT_PROG_BAR_DATE` /"
|
||||
[ ${CT_PROG_BAR_CPT} -eq 10 ] && echo -en "\r`_CT_PROG_BAR_DATE` -"
|
||||
[ ${CT_PROG_BAR_CPT} -eq 20 ] && echo -en "\r`_CT_PROG_BAR_DATE` \\"
|
||||
[ ${CT_PROG_BAR_CPT} -eq 30 ] && echo -en "\r`_CT_PROG_BAR_DATE` |"
|
||||
CT_PROG_BAR_CPT=$(((CT_PROG_BAR_CPT+1)%40))
|
||||
}
|
||||
CT_PROG_BAR_CPT=0
|
||||
CT_PROG_BAR=_CT_PROG_BAR
|
||||
export -f _CT_PROG_BAR
|
||||
else
|
||||
|
@ -91,6 +91,7 @@ CT_DoLog() {
|
||||
normal="CT_NORMAL_COLOR"
|
||||
if [ ${cur_l} -le ${max_level} ]; then
|
||||
echo -e "\r${!color}${l}${!normal}"
|
||||
CT_PROG_BAR_CPT=0 # Force redrawing progress bar on next 'unlogged' line
|
||||
else
|
||||
${CT_PROG_BAR}
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user