Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=32ecec342eb6901a0ab5b9c85e79328663272726
commit 32ecec342eb6901a0ab5b9c85e79328663272726 Author: Michel Hermier <[email protected]> Date: Thu Nov 22 08:41:59 2012 +0100 scripts/makepkg * Move build call (with elapsed build time printing) to a function. diff --git a/scripts/makepkg b/scripts/makepkg index efd7b48..25d43ce 100755 --- a/scripts/makepkg +++ b/scripts/makepkg @@ -1007,6 +1007,54 @@ buildenv_depends_validate() { fi } +buildenv_build() { + local totaltime hours minutes seconds pkgsbu + + msg "Starting build()..." + stime=`date +%s` + build + if [ $? -gt 0 ]; then + error "Build Failed. Aborting..." + exit 2 + fi + + if [ -n "`find . -name "*|*"`" ]; then + error "Filenames in a package must not contain pipes!" + exit 2 + fi + + # count sbu + if [ "$SBU" == "1" ]; then + # $SBU not yet set + totaltime="$(( $(date +%s) - $stime ))" + if [ -z "$HRBT" ]; then + msg "Elapsed Time: $totaltime seconds" + else + hours="$(( $totaltime / 3600 ))" + minutes="$(( $totaltime % 3600 / 60 ))" + seconds="$(( $totaltime % 3600 % 60 ))" + totaltime="" + if [ "$hours" -gt 0 ]; then + totaltime="$totaltime ${hours}h" + fi + if [ "$minutes" -gt 0 ]; then + totaltime="$totaltime ${minutes}m" + fi + if [ "$seconds" -gt 0 ]; then + totaltime="$totaltime ${seconds}s" + fi + msg "Elapsed Time:$totaltime" + fi + elif [ ! -z "$SBU" ]; then + if [ `type -p bc` ]; then + pkgsbu=`$ECHO -e "scale=2\n$(($(date +%s)-$stime))/$SBU"|bc /dev/stdin|sed 's/^\./0./'` + msg "Elapsed Time: $pkgsbu SBU" + else + warning "The bc program is missing. Cannot count SBU!" + fi + fi +} + pkg_mkdirs() { local package_name @@ -1702,50 +1750,7 @@ else fi export LDFLAGS -# build -msg "Starting build()..." -stime=`date +%s` -build -if [ $? -gt 0 ]; then - error "Build Failed. Aborting..." - exit 2 -fi - -if [ -n "`find . -name "*|*"`" ]; then - error "Filenames in a package must not contain pipes!" - exit 2 -fi - -# count sbu -if [ "$SBU" == "1" ]; then - # $SBU not yet set - totaltime="$(( $(date +%s) - $stime ))" - if [ -z "$HRBT" ]; then - msg "Elapsed Time: $totaltime seconds" - else - hours="$(( $totaltime / 3600 ))" - minutes="$(( $totaltime % 3600 / 60 ))" - seconds="$(( $totaltime % 3600 % 60 ))" - totaltime="" - if [ "$hours" -gt 0 ]; then - totaltime="$totaltime ${hours}h" - fi - if [ "$minutes" -gt 0 ]; then - totaltime="$totaltime ${minutes}m" - fi - if [ "$seconds" -gt 0 ]; then - totaltime="$totaltime ${seconds}s" - fi - msg "Elapsed Time:$totaltime" - fi -elif [ ! -z "$SBU" ]; then - if [ `type -p bc` ]; then - pkgsbu=`$ECHO -e "scale=2\n$(($(date +%s)-$stime))/$SBU"|bc /dev/stdin|sed 's/^\./0./'` - msg "Elapsed Time: $pkgsbu SBU" - else - warning "The bc program is missing. Cannot count SBU!" - fi -fi +buildenv_build cd $startdir _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
