On Mon, Oct 27, 2008 at 1:46 PM, Matthew Burgess
<[EMAIL PROTECTED]> wrote:
> On Mon, 27 Oct 2008 15:52:28 -0400, George Boudreau <[EMAIL PROTECTED]> wrote:
>
>> One weak point in jhalfs is the progress bar. It is only a fancy
>> timer and does not display the percent completion. True progress would
>> be based on SBU calcs for each package. This idea ranked at 99 on the
>> todo list and eventually became covered in dust. There may yet be
>> interest in such a mod. (nudge,nudge)
>
> I'd be interested, in a hopefully simple 'feature', of being able to disable
> the progress bar entirely through the config screens. It's been a while
> since I did some tests, but disabling it certainly seemed to speed things up
> a fair bit for me and IIRC several other people confirmed. See the thread at
> http://thread.gmane.org/gmane.linux.lfs.automated/6664/focus=6677 which has
> some interesting discussion on the subject including a suggestion by a
> certain Mr Huntwork that mirrors my own!
FWIW, there could be a much lower overhead implementation of the
progress bar, even in bash. Right now, the progress script is given a
PID, then just polls every 10th of a second to see if it's still
alive. Instead, you could just have the big job be a child of the
progress script and wait for it to finish.
$ cat progress.sh
#!/bin/bash
out=/dev/null
comment=
ret=
progress()
{
[ -n "$1" ] && echo "$1"
while :; do
printf .
sleep 0.1
done
}
while [ -n "$1" ]; do
case "$1" in
-f)
out="$2"
shift 2
;;
-c)
comment="$2"
shift 2
;;
*)
break
;;
esac
done
progress "$comment" &
eval "$@" >"$out" &
wait %2
ret=$?
kill %1 >/dev/null
echo
exit $ret
$ ./progress.sh -c "Unpacking a huge tarball" tar -xf ~/src/gdm-2.24.0.tar.gz
Unpacking a huge tarball
.....
Obviously, the actual progress bar here is a pile of dung, but I think
you can see the mechanism.
--
Dan
--
http://linuxfromscratch.org/mailman/listinfo/alfs-discuss
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page