#!/bin/sh # $Header: /home/cvsd/magellan-cvs/magellan-src/installer/include/bootstrap-wrapper.sh,v 1.1 2008-09-24 10:54:00 niro Exp $ # boostrap-wrapper # # run_bootstrap() # { # local line # # while read line # do # echo $line # sleep 0.01 # done < ~/boostrap.log # # # bootstrap-default-system # } convert_to_percent() { # never get 100% here, we define it our self or the dialogbox closes unwilingly echo "$@" | sed 's/.*(\(.*\)).*/\1/;s/\//\ /g' | awk '{print ($1 / $2 * 100) - 1}' } wrapper() { local action="$1" local line ${action} | while read line do case $line in *fetching*:*|*!fetch*|*fetch\ complete*) convert_to_percent ${line};; *unpacking*:*|*!unpack*) convert_to_percent ${line};; *installing*:*) convert_to_percent ${line};; *) [[ ${DEBUG} = true ]] && echo "${line}" ;; esac done # 100% here, close the dialog echo "100" } # download_stage1() # { # NOCOLORS=true MROOT=/mnt/magellan mage download toolchain # } # # download_stage2() # { # NOCOLORS=true MROOT=/mnt/magellan mage download basesystem26 # } # # install_stage1() # { # NOCOLORS=true MROOT=/mnt/magellan mage install toolchain # } install_stage2() { NOCOLORS=true bootstrap-default-system } ## runme #wrapper "$1" wrapper install_stage2