From a858a7823cdd5afdd610a081dce77b58849e783b Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Wed, 31 May 2006 20:43:41 +0000 Subject: [PATCH] POC for progress bar. --- CLFS/master.sh | 1 + HLFS/master.sh | 3 ++- LFS/master.sh | 5 +++-- common/common-functions | 1 + common/progress_bar.sh | 13 +++++++++++++ master.sh | 2 +- 6 files changed, 21 insertions(+), 4 deletions(-) create mode 100755 common/progress_bar.sh diff --git a/CLFS/master.sh b/CLFS/master.sh index 4e5a258..7d35997 100755 --- a/CLFS/master.sh +++ b/CLFS/master.sh @@ -991,6 +991,7 @@ $HEADER SRC= /sources MOUNT_PT= $BUILDDIR +MAKE_PID=\`pidof make | cut -d " " -f1\` include makefile-functions diff --git a/HLFS/master.sh b/HLFS/master.sh index 55021fb..8fef6df 100755 --- a/HLFS/master.sh +++ b/HLFS/master.sh @@ -478,6 +478,7 @@ $HEADER SRC= /sources MOUNT_PT= $BUILDDIR +MAKE_PID=\`pidof make | cut -d " " -f1\` include makefile-functions @@ -571,7 +572,7 @@ do-housekeeping: userdel lfs; \\ rm -rf /home/lfs; \\ fi; - + EOF ) >> $MKFILE diff --git a/LFS/master.sh b/LFS/master.sh index f41c0fc..c58dffb 100755 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -355,6 +355,7 @@ $HEADER SRC= /sources MOUNT_PT= $BUILDDIR +MAKE_PID=\`pidof make | cut -d " " -f1\` include makefile-functions @@ -431,7 +432,7 @@ restore-lfs-env: fi; @chown lfs:lfs /home/lfs/.bash* && \\ touch \$@ - + do_housekeeping: -umount \$(MOUNT_PT)/sys -umount \$(MOUNT_PT)/proc @@ -442,7 +443,7 @@ do_housekeeping: userdel lfs; \\ rm -rf /home/lfs; \\ fi; - + EOF ) >> $MKFILE diff --git a/common/common-functions b/common/common-functions index 9680b00..fb4737a 100644 --- a/common/common-functions +++ b/common/common-functions @@ -201,6 +201,7 @@ cat << EOF $i: $PREV @\$(call echo_message, Building) + @./progress_bar.sh \$@ \$(MAKE_PID) & @echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >logs/$LOGFILE EOF ) >> $MKFILE.tmp diff --git a/common/progress_bar.sh b/common/progress_bar.sh new file mode 100755 index 0000000..ec264e5 --- /dev/null +++ b/common/progress_bar.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# $Id$ + +set -e + +if [ ! -f $1 ] ; then + echo -n "." + sleep 1 + if [ -d /proc/$2 ] ; then + ./$0 $1 $2 + fi +fi diff --git a/master.sh b/master.sh index 015e57b..7eb1f5a 100755 --- a/master.sh +++ b/master.sh @@ -481,7 +481,7 @@ fi # # if [[ "$PWD" != "$JHALFSDIR" ]]; then - cp $COMMON_DIR/makefile-functions $JHALFSDIR/ + cp $COMMON_DIR/{makefile-functions,progress_bar.sh} $JHALFSDIR/ [[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/ if [[ "$COMPARE" != "0" ]] ; then mkdir -p $JHALFSDIR/extras