Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=c91ceb2cac52d6b7d4a9c93aa115b905218b98f8
commit c91ceb2cac52d6b7d4a9c93aa115b905218b98f8 Author: Michel Hermier <[email protected]> Date: Sun Nov 25 08:45:31 2012 +0100 scripts/makepkg * Move build script estimation time to a function. diff --git a/scripts/makepkg b/scripts/makepkg index 8f244c6..5f0271d 100755 --- a/scripts/makepkg +++ b/scripts/makepkg @@ -813,6 +813,19 @@ buildscript_up2date() { fi } +buildscript_estimation () { + # estimate build time + if grep -i -q "^# Compiling Time: [~0-9\.]\+ SBU$" $BUILDSCRIPT && \ + [ ! -z "$SBU" ] && [ "$SBU" != "1" ]; then + pkgsbu=`grep -i "^# Compiling time: [~0-9\.]\+ SBU$" $BUILDSCRIPT|sed 's/^# Compiling [Tt]ime: ~*\([0-9\.]\+\) SBU$/\1/'` + if find_executable bc 'Cannot calculate the estimated build time!'; then + secs=`$ECHO "$pkgsbu*$SBU"|bc /dev/stdin|sed 's/\.[0-9]*$//'` + [ -z "$secs" ] && secs=0 + msg "Estimated build time:$(seconds_to_human_duration "$secs")" + fi + fi +} + buildscript_create_changelog() { local indir=n @@ -2016,16 +2029,7 @@ cd $startdir buildscript_up2date -# estimate build time -if grep -i -q "^# Compiling Time: [~0-9\.]\+ SBU$" $BUILDSCRIPT && \ - [ ! -z "$SBU" ] && [ "$SBU" != "1" ]; then - pkgsbu=`grep -i "^# Compiling time: [~0-9\.]\+ SBU$" $BUILDSCRIPT|sed 's/^# Compiling [Tt]ime: ~*\([0-9\.]\+\) SBU$/\1/'` - if find_executable bc 'Cannot calculate the estimated build time!'; then - secs=`$ECHO "$pkgsbu*$SBU"|bc /dev/stdin|sed 's/\.[0-9]*$//'` - [ -z "$secs" ] && secs=0 - msg "Estimated build time:$(seconds_to_human_duration "$secs")" - fi -fi +buildscript_estimation makepkg_prepare_sources if [ "$NOBUILD" = "1" ]; then _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
