Changeset 68713c9 for common


Ignore:
Timestamp:
08/17/2007 04:24:47 PM (17 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
2.3, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
e5842d6
Parents:
3abe9d7
Message:

Dump build time using Bash $SECONDS internal variable instead of using date calls + Perl-based calculations.

Location:
common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • common/create-sbu_du-report.sh

    r3abe9d7 r68713c9  
    5454BASELOG=`grep -l "^Totalseconds:" $LOGSDIR/* | head -n1`
    5555echo -e "\nUsing ${BASELOG#*[[:digit:]]-} to obtain the SBU unit value."
    56 SBU_UNIT=`sed -n 's/^Totalseconds:\s\([[:digit:]]*.[[:digit:]]*\)$/\1/p' $BASELOG`
     56SBU_UNIT=`sed -n 's/^Totalseconds:\s\([[:digit:]]*\)$/\1/p' $BASELOG`
    5757echo -e "\nThe SBU unit value is equal to $SBU_UNIT seconds.\n"
    5858echo -e "\n\n$LINE\n\nThe SBU unit value is equal to $SBU_UNIT seconds.\n" >> "$REPORT"
     
    7171# Start SBU calculation
    7272# Build time
    73   TIME=`sed -n 's/^Totalseconds:\s\([[:digit:]]*.[[:digit:]]*\)$/\1/p' $log`
     73  TIME=`sed -n 's/^Totalseconds:\s\([[:digit:]]*\)$/\1/p' $log`
    7474  SECS=`perl -e 'print ('$TIME' % '60')';`
    7575  MINUTES=`perl -e 'printf "%.0f" , (('$TIME' - '$SECS') / '60')';`
    76   SBU=`perl -e 'printf "%.3f" , ('$TIME' / '$SBU_UNIT')';`
     76  SBU=`perl -e 'printf "%.1f" , ('$TIME' / '$SBU_UNIT')';`
    7777
    7878# Append SBU value to SBU2 for grand total
    79   SBU2=`perl -e 'printf "%.3f" , ('$SBU2' + '$SBU')';`
     79  SBU2=`perl -e 'printf "%.1f" , ('$SBU2' + '$SBU')';`
    8080
    8181# Start disk usage calculation
  • common/libs/func_wrt_Makefile

    r3abe9d7 r68713c9  
    4141PRT_DU         = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found \$(MOUNT_PT) \`\n"
    4242PRT_DU_CR      = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found / \`\n"
    43 TIME_MARK      = \`date +%s.%N\`
    44 BUILD_TIME     = perl -e "printf \"\nTotalseconds: %.3f\", ('\$\$end' - '\$\$start')"
    4543
    4644ADD_REPORT       = $REPORT
     
    235233(
    236234cat << EOF
    237         @start=\$(TIME_MARK) && \\
    238         export ${MOUNT_ENV}=\$(MOUNT_PT) && \\
     235        @export ${MOUNT_ENV}=\$(MOUNT_PT) && \\
    239236        ${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 && \\
    240         end=\$(TIME_MARK) && \$(BUILD_TIME) >>logs/\$@ && \\
    241237        \$(PRT_DU) >>logs/\$@
    242238EOF
     
    251247(
    252248cat << EOF
    253         @start=\$(TIME_MARK) && \\
    254         source ~/.bashrc && \\
     249        @source ~/.bashrc && \\
    255250        \$(CMDSDIR)/`dirname $file`/\$@ >> logs/\$@ 2>&1 && \\
    256         end=\$(TIME_MARK) && \$(BUILD_TIME) >>logs/\$@ && \\
    257251        \$(PRT_DU) >>logs/\$@
    258252EOF
     
    266260(
    267261cat << EOF
    268         @start=\$(TIME_MARK) && \\
    269         source envars && \\
     262        @source envars && \\
    270263        \$(crCMDSDIR)/`dirname $file`/\$@ >>logs/\$@ 2>&1 && \\
    271         end=\$(TIME_MARK) && \$(BUILD_TIME) >>logs/\$@ && \\
    272264        \$(PRT_DU_CR) >>logs/\$@
    273265EOF
     
    286278(
    287279cat << EOF
    288         @start=\$(TIME_MARK) && \\
    289         cp -v \$(MOUNT_PT)/sources/fstab \$(MOUNT_PT)/etc/fstab >>logs/\$@ 2>&1 && \\
    290         end=\$(TIME_MARK) && \$(BUILD_TIME) >>logs/\$@ && \\
     280        @cp -v \$(MOUNT_PT)/sources/fstab \$(MOUNT_PT)/etc/fstab >>logs/\$@ 2>&1 && \\
    291281        \$(PRT_DU) >>logs/\$@
    292282EOF
     
    299289(
    300290cat << EOF
    301         @start=\$(TIME_MARK) && \\
    302         cp -v /sources/fstab /etc/fstab >>logs/\$@ 2>&1 && \\
    303         end=\$(TIME_MARK) && \$(BUILD_TIME) >>logs/\$@ && \\
     291        @cp -v /sources/fstab /etc/fstab >>logs/\$@ 2>&1 && \\
    304292        \$(PRT_DU_CR) >>logs/\$@
    305293EOF
Note: See TracChangeset for help on using the changeset viewer.