Changeset 5451eae for LFS


Ignore:
Timestamp:
07/15/2019 08:06:35 PM (5 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
ablfs-more, legacy, trunk
Children:
7933ed7
Parents:
3b14992
Message:

Fix generation of the SBU-DU stats:
The "create-sbu_du.sh" script expects all the logs containing
"Totalseconds" also contains two lines starting with "KB:" with disk usage
stats. Generates those lines for all the logs. Hopefully, the stats are
fairly accurate now...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LFS/lfs.xsl

    r3b14992 r5451eae  
    172172      </xsl:if>
    173173      <xsl:text>&#xA;</xsl:text>
    174       <xsl:if test="sect2[@role='installation']">
    175         <xsl:call-template name="start-script">
    176           <xsl:with-param name="order" select="$order"/>
    177         </xsl:call-template>
    178       </xsl:if>
     174      <xsl:call-template name="start-script">
     175        <xsl:with-param name="order" select="$order"/>
     176      </xsl:call-template>
    179177      <xsl:apply-templates select="sect2[not(@revision) or
    180178                                         @revision=$revision] |
     
    198196      </xsl:if>
    199197      <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"&#xA;</xsl:text>
    200       <xsl:if test="sect2[@role='installation']">
    201         <xsl:call-template name="end-script"/>
    202       </xsl:if>
     198      <xsl:call-template name="end-script"/>
    203199      <xsl:text>exit&#xA;</xsl:text>
    204200    </exsl:document>
     
    11521148  <xsl:template name="start-script">
    11531149    <xsl:param name="order" select="'073'"/>
    1154 <!-- get the location of the system root -->
    11551150    <xsl:text>
     1151<!-- save the timer, so that unpacking, and du is not counted -->
     1152PREV_SEC=${SECONDS}
     1153      <!-- get the location of the system root -->
    11561154if [ -h /tools ]; then
    11571155  ROOT=$(dirname $(readlink /tools))/
     
    11591157  ROOT=/
    11601158fi
    1161 SRC_DIR=${ROOT}sources
    1162 <!-- save the timer, so that unpacking, and du is not counted -->
    1163 PREV_SEC=${SECONDS}
    1164 <!-- Set variables, for use by the Makefile and package manager -->
    1165 VERSION=</xsl:text><!-- needed for Makefile, and may be used in PackInstall-->
    1166     <xsl:copy-of select=".//sect1info/productnumber/text()"/>
    1167     <xsl:text>
    1168 PKG_DEST=${SRC_DIR}/</xsl:text>
    1169     <xsl:copy-of select="$order"/>
    1170     <xsl:text>-</xsl:text>
    1171     <xsl:copy-of select=".//sect1info/productname/text()"/>
    1172     <xsl:text>
    1173     <!-- Get the tarball name from sect1info -->
    1174 PACKAGE=</xsl:text>
    1175     <xsl:call-template name="basename">
    1176       <xsl:with-param name="path" select=".//sect1info/address/text()"/>
    1177     </xsl:call-template>
    1178     <xsl:text>
    11791159SCRIPT_ROOT=</xsl:text>
    11801160    <xsl:copy-of select="$script-root"/>
    11811161    <xsl:text>
    11821162</xsl:text>
    1183     <xsl:if test = "( ../@id != 'chapter-temporary-tools' or
     1163    <xsl:if test="sect2[@role='installation']">
     1164      <xsl:text>
     1165SRC_DIR=${ROOT}sources
     1166<!-- Set variables, for use by the Makefile and package manager -->
     1167VERSION=</xsl:text><!-- needed for Makefile, and may be used in PackInstall-->
     1168      <xsl:copy-of select=".//sect1info/productnumber/text()"/>
     1169      <xsl:text>
     1170PKG_DEST=${SRC_DIR}/</xsl:text>
     1171      <xsl:copy-of select="$order"/>
     1172      <xsl:text>-</xsl:text>
     1173      <xsl:copy-of select=".//sect1info/productname/text()"/>
     1174      <xsl:text>
     1175<!-- Get the tarball name from sect1info -->
     1176PACKAGE=</xsl:text>
     1177      <xsl:call-template name="basename">
     1178        <xsl:with-param name="path" select=".//sect1info/address/text()"/>
     1179      </xsl:call-template>
     1180      <xsl:if test = "( ../@id != 'chapter-temporary-tools' or
    11841181                      starts-with(@id,'ch-system') ) and $pkgmngt = 'y'">
    1185       <xsl:text>
     1182        <xsl:text>
    11861183source ${ROOT}${SCRIPT_ROOT}/packInstall.sh
    11871184export -f packInstall</xsl:text>
    1188       <xsl:if test="$wrap-install='y'">
    1189         <xsl:text>
     1185        <xsl:if test="$wrap-install='y'">
     1186          <xsl:text>
    11901187export -f wrapInstall
    11911188</xsl:text>
     1189        </xsl:if>
    11921190      </xsl:if>
    1193     </xsl:if>
    11941191<!-- Get the build directory name and clean remnants of previous attempts -->
    1195     <xsl:text>
     1192      <xsl:text>
    11961193cd $SRC_DIR
    11971194PKGDIR=$(tar -tf $PACKAGE | head -n1 | sed 's@^./@@;s@/.*@@')
     
    12001197if [ -d "$PKGDIR" ]; then rm -rf $PKGDIR; fi
    12011198if [ -d "${PKGDIR%-*}-build" ]; then  rm -rf ${PKGDIR%-*}-build; fi
    1202 
    1203 echo "KB: $(du -skx --exclude=lost+found --exclude=/var/lib --exclude=$SCRIPT_ROOT $ROOT)"
     1199</xsl:text>
     1200    </xsl:if>
     1201    <xsl:text>
     1202echo "KB: $(du -skx --exclude=lost+found --exclude=var/lib --exclude=$SCRIPT_ROOT $ROOT)"
     1203</xsl:text>
     1204    <xsl:if test="sect2[@role='installation']">
     1205      <xsl:text>
    12041206<!-- At last unpack and change directory -->
    12051207tar -xf $PACKAGE
    12061208cd $PKGDIR
    1207 SECONDS=${PREV_SEC}
     1209</xsl:text>
     1210    </xsl:if>
     1211    <xsl:text>SECONDS=${PREV_SEC}
    12081212
    12091213# Start of LFS book script
     
    12151219# End of LFS book script
    12161220
    1217 echo "KB: $(du -skx --exclude=lost+found --exclude=/var/lib --exclude=$SCRIPT_ROOT $ROOT)"
    1218 cd $SRC_DIR
     1221echo "KB: $(du -skx --exclude=lost+found --exclude=var/lib --exclude=$SCRIPT_ROOT $ROOT)"
     1222</xsl:text>
     1223    <xsl:if test="sect2[@role='installation']">
     1224      <xsl:text>cd $SRC_DIR
    12191225rm -rf $PKGDIR
    12201226if [ -d "${PKGDIR%-*}-build" ]; then  rm -rf ${PKGDIR%-*}-build; fi
    12211227</xsl:text>
     1228    </xsl:if>
    12221229  </xsl:template>
    12231230
Note: See TracChangeset for help on using the changeset viewer.