mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-06-20 00:03:53 +00:00
Don't start a state restoration if it is not available.
Fortuitly discovered that $SECONDS is inherited from shell to sub-shells. Good!
This commit is contained in:
@ -67,8 +67,7 @@ CT_DoLog() {
|
|||||||
cat -
|
cat -
|
||||||
else
|
else
|
||||||
echo "${1}"
|
echo "${1}"
|
||||||
fi |( offset=$((`CT_DoDate +%s`+(CT_STAR_DATE/(1000*1000*1000))))
|
fi |( IFS="\n" # We want the full lines, even leading spaces
|
||||||
IFS="\n" # We want the full lines, even leading spaces
|
|
||||||
CT_PROG_BAR_CPT=0
|
CT_PROG_BAR_CPT=0
|
||||||
indent=$((2*CT_STEP_COUNT))
|
indent=$((2*CT_STEP_COUNT))
|
||||||
while read line; do
|
while read line; do
|
||||||
@ -86,12 +85,11 @@ CT_DoLog() {
|
|||||||
echo -e "\r${l}" >&6
|
echo -e "\r${l}" >&6
|
||||||
fi
|
fi
|
||||||
if [ "${CT_LOG_PROGRESS_BAR}" = "y" ]; then
|
if [ "${CT_LOG_PROGRESS_BAR}" = "y" ]; then
|
||||||
elapsed=$((SECONDS+OFFSET))
|
|
||||||
[ ${CT_PROG_BAR_CPT} -eq 0 ] && bar="/"
|
[ ${CT_PROG_BAR_CPT} -eq 0 ] && bar="/"
|
||||||
[ ${CT_PROG_BAR_CPT} -eq 10 ] && bar="-"
|
[ ${CT_PROG_BAR_CPT} -eq 10 ] && bar="-"
|
||||||
[ ${CT_PROG_BAR_CPT} -eq 20 ] && bar="\\"
|
[ ${CT_PROG_BAR_CPT} -eq 20 ] && bar="\\"
|
||||||
[ ${CT_PROG_BAR_CPT} -eq 30 ] && bar="|"
|
[ ${CT_PROG_BAR_CPT} -eq 30 ] && bar="|"
|
||||||
printf "\r[%02d:%02d] %s " $((elapsed/60)) $((elapsed%60)) "${bar}" >&6
|
printf "\r[%02d:%02d] %s " $((SECONDS/60)) $((SECONDS%60)) "${bar}" >&6
|
||||||
CT_PROG_BAR_CPT=$(((CT_PROG_BAR_CPT+1)%40))
|
CT_PROG_BAR_CPT=$(((CT_PROG_BAR_CPT+1)%40))
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -548,6 +546,8 @@ CT_DoLoadState(){
|
|||||||
local old_RESTART="${CT_RESTART}"
|
local old_RESTART="${CT_RESTART}"
|
||||||
local old_STOP="${CT_STOP}"
|
local old_STOP="${CT_STOP}"
|
||||||
|
|
||||||
|
CT_TestOrAbort "The previous build did not reach the point where it could be restarted at \"${CT_RESTART}\"" -d "${state_dir}"
|
||||||
|
|
||||||
# We need to do something special with the log file!
|
# We need to do something special with the log file!
|
||||||
if [ "${CT_LOG_TO_FILE}" = "y" ]; then
|
if [ "${CT_LOG_TO_FILE}" = "y" ]; then
|
||||||
exec >"${state_dir}/tail.log"
|
exec >"${state_dir}/tail.log"
|
||||||
|
Reference in New Issue
Block a user