Applied Dan Nicholson's changes to progress_bar.sh and its support code

This commit is contained in:
George Boudreau 2006-09-13 20:30:00 +00:00
parent 597d802ff3
commit d44206f9ea
3 changed files with 7 additions and 9 deletions

View file

@ -26,7 +26,7 @@ cat << EOF
$i: $PREV
@\$(call echo_message, Building)
@./progress_bar.sh \$@ &
@./progress_bar.sh \$@ \$\$PPID &
EOF
) >> $MKFILE.tmp
}

View file

@ -44,7 +44,7 @@ cat << EOF
$i: $PREV
@\$(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
EOF
) >> $MKFILE.tmp
@ -65,7 +65,7 @@ cat << EOF
$i: $PREV
@\$(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
EOF
) >> $MKFILE.tmp
@ -367,7 +367,7 @@ cat << EOF
$i: $PREV
@\$(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
EOF
) >> $MKFILE.tmp
@ -387,7 +387,7 @@ cat << EOF
$i: $PREV
@\$(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
EOF
) >> $MKFILE.tmp

View file

@ -7,6 +7,7 @@ set -e
# Be sure that we know the taget name
[[ -z $1 ]] && exit
TARGET=$1 # Remember the target build we are looking for
MAKE_PPID=$2
declare -r CSI=$'\e[' # DEC terminology, Control Sequence Introducer
declare -r CURSOR_OFF=${CSI}$'?25l'
@ -21,12 +22,9 @@ declare -a GRAPHIC_STR="| / - \\ + "
declare -i SEC=0 # Seconds accumulator
declare -i PREV_SEC=0
makePID=$(fuser -v . 2>&1 | grep make)
makePID=$(echo $makePID | cut -d" " -f2)
write_or_exit() {
# 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.
[[ -f ${TARGET} ]] && echo -n "${CURSOR_ON}" && exit