r3466 - in jhalfs/trunk: CLFS HLFS LFS common common/libs

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Fri Aug 17 09:24:47 PDT 2007


Author: manuel
Date: 2007-08-17 10:24:47 -0600 (Fri, 17 Aug 2007)
New Revision: 3466

Modified:
   jhalfs/trunk/CLFS/clfs.xsl
   jhalfs/trunk/HLFS/hlfs.xsl
   jhalfs/trunk/LFS/lfs.xsl
   jhalfs/trunk/common/create-sbu_du-report.sh
   jhalfs/trunk/common/libs/func_wrt_Makefile
Log:
Dump build time using Bash $SECONDS internal variable instead of using date calls + Perl-based calculations.

Modified: jhalfs/trunk/CLFS/clfs.xsl
===================================================================
--- jhalfs/trunk/CLFS/clfs.xsl	2007-08-15 17:04:38 UTC (rev 3465)
+++ jhalfs/trunk/CLFS/clfs.xsl	2007-08-17 16:24:47 UTC (rev 3466)
@@ -112,6 +112,9 @@
               </xsl:if>
             </xsl:if>
             <xsl:apply-templates select=".//para/userinput | .//screen"/>
+            <xsl:if test="not(@id='ch-chroot-chroot')">
+              <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"&#xA;</xsl:text>
+            </xsl:if>
             <xsl:text>exit</xsl:text>
           </exsl:document>
         </xsl:if>

Modified: jhalfs/trunk/HLFS/hlfs.xsl
===================================================================
--- jhalfs/trunk/HLFS/hlfs.xsl	2007-08-15 17:04:38 UTC (rev 3465)
+++ jhalfs/trunk/HLFS/hlfs.xsl	2007-08-17 16:24:47 UTC (rev 3466)
@@ -111,13 +111,13 @@
              <xsl:text>pushd ../; tar -xvf gettext-&gettext-version;.*; popd; &#xA;</xsl:text>
           </xsl:if>
           <!-- SVN toolchain format, from inside ./sources dir unpack binutils and gcc -->
-	  <xsl:if test="@id='ch-tools-embryo-toolchain' or
+          <xsl:if test="@id='ch-tools-embryo-toolchain' or
                         @id='ch-tools-cocoon-toolchain' or
                         @id='ch-system-butterfly-toolchain'">
              <xsl:text>tar -xvf gcc-core-&gcc-version;.*; &#xA;</xsl:text>
              <xsl:text>tar -xvf binutils-&binutils-version;.*; &#xA;</xsl:text>
           </xsl:if>
-	  <xsl:if test="@id='ch-tools-cocoon-toolchain' or
+          <xsl:if test="@id='ch-tools-cocoon-toolchain' or
                         @id='ch-system-butterfly-toolchain'">
              <xsl:text>tar -xvf gcc-g++-&gcc-version;.*; &#xA;</xsl:text>
           </xsl:if>
@@ -128,6 +128,10 @@
           <!-- END SVN toolchain format -->
         </xsl:if>
         <xsl:apply-templates select=".//para/userinput | .//screen"/>
+        <xsl:if test="not(@id='ch-system-chroot') and
+                      not(@id='ch-system-revisedchroot')">
+          <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"&#xA;</xsl:text>
+        </xsl:if>
         <xsl:text>exit</xsl:text>
       </exsl:document>
     </xsl:if>

Modified: jhalfs/trunk/LFS/lfs.xsl
===================================================================
--- jhalfs/trunk/LFS/lfs.xsl	2007-08-15 17:04:38 UTC (rev 3465)
+++ jhalfs/trunk/LFS/lfs.xsl	2007-08-17 16:24:47 UTC (rev 3466)
@@ -105,7 +105,11 @@
           <xsl:copy-of select="//sect1[@id='ch-system-glibc']/sect2[2]/screen[@role='nodump']"/>
           <xsl:text>&#xA;</xsl:text>
         </xsl:if>
-        <xsl:text>exit</xsl:text>
+        <xsl:if test="not(@id='ch-system-chroot') and
+                      not(@id='ch-system-revisedchroot')">
+          <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"&#xA;</xsl:text>
+        </xsl:if>
+        <xsl:text>exit&#xA;</xsl:text>
       </exsl:document>
     </xsl:if>
   </xsl:template>

Modified: jhalfs/trunk/common/create-sbu_du-report.sh
===================================================================
--- jhalfs/trunk/common/create-sbu_du-report.sh	2007-08-15 17:04:38 UTC (rev 3465)
+++ jhalfs/trunk/common/create-sbu_du-report.sh	2007-08-17 16:24:47 UTC (rev 3466)
@@ -53,7 +53,7 @@
 # Match the first timed log to extract the SBU unit value from it
 BASELOG=`grep -l "^Totalseconds:" $LOGSDIR/* | head -n1`
 echo -e "\nUsing ${BASELOG#*[[:digit:]]-} to obtain the SBU unit value."
-SBU_UNIT=`sed -n 's/^Totalseconds:\s\([[:digit:]]*.[[:digit:]]*\)$/\1/p' $BASELOG`
+SBU_UNIT=`sed -n 's/^Totalseconds:\s\([[:digit:]]*\)$/\1/p' $BASELOG`
 echo -e "\nThe SBU unit value is equal to $SBU_UNIT seconds.\n"
 echo -e "\n\n$LINE\n\nThe SBU unit value is equal to $SBU_UNIT seconds.\n" >> "$REPORT"
 
@@ -70,13 +70,13 @@
 
 # Start SBU calculation
 # Build time
-  TIME=`sed -n 's/^Totalseconds:\s\([[:digit:]]*.[[:digit:]]*\)$/\1/p' $log`
+  TIME=`sed -n 's/^Totalseconds:\s\([[:digit:]]*\)$/\1/p' $log`
   SECS=`perl -e 'print ('$TIME' % '60')';`
   MINUTES=`perl -e 'printf "%.0f" , (('$TIME' - '$SECS') / '60')';`
-  SBU=`perl -e 'printf "%.3f" , ('$TIME' / '$SBU_UNIT')';`
+  SBU=`perl -e 'printf "%.1f" , ('$TIME' / '$SBU_UNIT')';`
 
 # Append SBU value to SBU2 for grand total
-  SBU2=`perl -e 'printf "%.3f" , ('$SBU2' + '$SBU')';`
+  SBU2=`perl -e 'printf "%.1f" , ('$SBU2' + '$SBU')';`
 
 # Start disk usage calculation
 # Disk usage before unpacking the package

Modified: jhalfs/trunk/common/libs/func_wrt_Makefile
===================================================================
--- jhalfs/trunk/common/libs/func_wrt_Makefile	2007-08-15 17:04:38 UTC (rev 3465)
+++ jhalfs/trunk/common/libs/func_wrt_Makefile	2007-08-17 16:24:47 UTC (rev 3466)
@@ -40,8 +40,6 @@
 LUSER_HOME     = \$(LHOME)/\$(LUSER)
 PRT_DU         = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found \$(MOUNT_PT) \`\n"
 PRT_DU_CR      = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found / \`\n"
-TIME_MARK      = \`date +%s.%N\`
-BUILD_TIME     = perl -e "printf \"\nTotalseconds: %.3f\", ('\$\$end' - '\$\$start')"
 
 ADD_REPORT       = $REPORT
 ADD_CUSTOM_TOOLS = $CUSTOM_TOOLS
@@ -234,10 +232,8 @@
 
 (
 cat << EOF
-	@start=\$(TIME_MARK) && \\
-	export ${MOUNT_ENV}=\$(MOUNT_PT) && \\
+	@export ${MOUNT_ENV}=\$(MOUNT_PT) && \\
 	${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 && \\
-	end=\$(TIME_MARK) && \$(BUILD_TIME) >>logs/\$@ && \\
 	\$(PRT_DU) >>logs/\$@
 EOF
 ) >> $MKFILE.tmp
@@ -250,10 +246,8 @@
 
 (
 cat << EOF
-	@start=\$(TIME_MARK) && \\
-	source ~/.bashrc && \\
+	@source ~/.bashrc && \\
 	\$(CMDSDIR)/`dirname $file`/\$@ >> logs/\$@ 2>&1 && \\
-	end=\$(TIME_MARK) && \$(BUILD_TIME) >>logs/\$@ && \\
 	\$(PRT_DU) >>logs/\$@
 EOF
 ) >> $MKFILE.tmp
@@ -265,10 +259,8 @@
   local file=$1
 (
 cat << EOF
-	@start=\$(TIME_MARK) && \\
-	source envars && \\
+	@source envars && \\
 	\$(crCMDSDIR)/`dirname $file`/\$@ >>logs/\$@ 2>&1 && \\
-	end=\$(TIME_MARK) && \$(BUILD_TIME) >>logs/\$@ && \\
 	\$(PRT_DU_CR) >>logs/\$@
 EOF
 ) >> $MKFILE.tmp
@@ -285,9 +277,7 @@
 #----------------------------------#
 (
 cat << EOF
-	@start=\$(TIME_MARK) && \\
-	cp -v \$(MOUNT_PT)/sources/fstab \$(MOUNT_PT)/etc/fstab >>logs/\$@ 2>&1 && \\
-	end=\$(TIME_MARK) && \$(BUILD_TIME) >>logs/\$@ && \\
+	@cp -v \$(MOUNT_PT)/sources/fstab \$(MOUNT_PT)/etc/fstab >>logs/\$@ 2>&1 && \\
 	\$(PRT_DU) >>logs/\$@
 EOF
 ) >> $MKFILE.tmp
@@ -298,9 +288,7 @@
 #----------------------------------#
 (
 cat << EOF
-	@start=\$(TIME_MARK) && \\
-	cp -v /sources/fstab /etc/fstab >>logs/\$@ 2>&1 && \\
-	end=\$(TIME_MARK) && \$(BUILD_TIME) >>logs/\$@ && \\
+	@cp -v /sources/fstab /etc/fstab >>logs/\$@ 2>&1 && \\
 	\$(PRT_DU_CR) >>logs/\$@
 EOF
 ) >> $MKFILE.tmp




More information about the alfs-log mailing list