Applied Dan Nicholson's changes to progress_bar.sh and its support code
This commit is contained in:
parent
597d802ff3
commit
d44206f9ea
3 changed files with 7 additions and 9 deletions
|
@ -26,7 +26,7 @@ cat << EOF
|
||||||
|
|
||||||
$i: $PREV
|
$i: $PREV
|
||||||
@\$(call echo_message, Building)
|
@\$(call echo_message, Building)
|
||||||
@./progress_bar.sh \$@ &
|
@./progress_bar.sh \$@ \$\$PPID &
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ cat << EOF
|
||||||
|
|
||||||
$i: $PREV
|
$i: $PREV
|
||||||
@\$(call echo_message, Building)
|
@\$(call echo_message, Building)
|
||||||
@./progress_bar.sh \$@ &
|
@./progress_bar.sh \$@ \$\$PPID &
|
||||||
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >logs/$LOGFILE
|
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >logs/$LOGFILE
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
|
@ -65,7 +65,7 @@ cat << EOF
|
||||||
|
|
||||||
$i: $PREV
|
$i: $PREV
|
||||||
@\$(call echo_message, Building)
|
@\$(call echo_message, Building)
|
||||||
@./progress_bar.sh \$@ &
|
@./progress_bar.sh \$@ \$\$PPID &
|
||||||
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT}\`\n" >logs/$LOGFILE
|
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT}\`\n" >logs/$LOGFILE
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
|
@ -367,7 +367,7 @@ cat << EOF
|
||||||
|
|
||||||
$i: $PREV
|
$i: $PREV
|
||||||
@\$(call echo_message, Building)
|
@\$(call echo_message, Building)
|
||||||
@./progress_bar.sh \$@ &
|
@./progress_bar.sh \$@ \$\$PPID &
|
||||||
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >logs/$LOGFILE
|
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >logs/$LOGFILE
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
|
@ -387,7 +387,7 @@ cat << EOF
|
||||||
|
|
||||||
$i: $PREV
|
$i: $PREV
|
||||||
@\$(call echo_message, Building)
|
@\$(call echo_message, Building)
|
||||||
@./progress_bar.sh \$@ &
|
@./progress_bar.sh \$@ \$\$PPID &
|
||||||
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT}\`\n" >logs/$LOGFILE
|
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT}\`\n" >logs/$LOGFILE
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
|
|
|
@ -7,6 +7,7 @@ set -e
|
||||||
# Be sure that we know the taget name
|
# Be sure that we know the taget name
|
||||||
[[ -z $1 ]] && exit
|
[[ -z $1 ]] && exit
|
||||||
TARGET=$1 # Remember the target build we are looking for
|
TARGET=$1 # Remember the target build we are looking for
|
||||||
|
MAKE_PPID=$2
|
||||||
|
|
||||||
declare -r CSI=$'\e[' # DEC terminology, Control Sequence Introducer
|
declare -r CSI=$'\e[' # DEC terminology, Control Sequence Introducer
|
||||||
declare -r CURSOR_OFF=${CSI}$'?25l'
|
declare -r CURSOR_OFF=${CSI}$'?25l'
|
||||||
|
@ -21,12 +22,9 @@ declare -a GRAPHIC_STR="| / - \\ + "
|
||||||
declare -i SEC=0 # Seconds accumulator
|
declare -i SEC=0 # Seconds accumulator
|
||||||
declare -i PREV_SEC=0
|
declare -i PREV_SEC=0
|
||||||
|
|
||||||
makePID=$(fuser -v . 2>&1 | grep make)
|
|
||||||
makePID=$(echo $makePID | cut -d" " -f2)
|
|
||||||
|
|
||||||
write_or_exit() {
|
write_or_exit() {
|
||||||
# make has been killed or failed or run to completion, leave
|
# make has been killed or failed or run to completion, leave
|
||||||
[[ ! -e /proc/$makePID ]] && echo -n "${CURSOR_ON}" && exit
|
[[ ! -e /proc/${MAKE_PPID} ]] && echo -n "${CURSOR_ON}" && exit
|
||||||
|
|
||||||
# Target build complete, leave.
|
# Target build complete, leave.
|
||||||
[[ -f ${TARGET} ]] && echo -n "${CURSOR_ON}" && exit
|
[[ -f ${TARGET} ]] && echo -n "${CURSOR_ON}" && exit
|
||||||
|
|
Reference in a new issue