Changeset 2758d94 for LFS/lfs.xsl
- Timestamp:
- 04/11/2019 07:40:50 AM (5 years ago)
- Branches:
- ablfs-more, legacy, trunk
- Children:
- 0e4ddfa
- Parents:
- adbd09b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LFS/lfs.xsl
radbd09b r2758d94 84 84 <xsl:param name='local' select="'n'"/> 85 85 <xsl:param name='log-level' select="'4'"/> 86 87 <!-- The scripts root is needed for printing disk usage --> 88 <xsl:param name='script-root' select="'jhalfs'"/> 86 89 87 90 <!-- End parameters --> … … 170 173 <xsl:text>
</xsl:text> 171 174 <xsl:if test="sect2[@role='installation']"> 172 <xsl:text>cd $PKGDIR
</xsl:text> 175 <xsl:call-template name="start-script"> 176 <xsl:with-param name="order" select="$order"/> 177 </xsl:call-template> 173 178 </xsl:if> 174 179 <xsl:apply-templates select="sect2[not(@revision) or … … 193 198 </xsl:if> 194 199 <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"
</xsl:text> 200 <xsl:if test="sect2[@role='installation']"> 201 <xsl:call-template name="end-script"/> 202 </xsl:if> 195 203 <xsl:text>exit
</xsl:text> 196 204 </exsl:document> … … 226 234 <xsl:text>mkdir -pv $PKG_DEST/{bin,boot,etc,lib,sbin} 227 235 mkdir -pv $PKG_DEST/usr/{bin,include,lib/pkgconfig,sbin} 228 mkdir -pv $PKG_DEST/usr/share/{doc,info, man}236 mkdir -pv $PKG_DEST/usr/share/{doc,info,bash-completion/completions} 229 237 mkdir -pv $PKG_DEST/usr/share/man/man{1..8} 230 238 case $(uname -m) in … … 296 304 <!-- remove empty directories --> 297 305 <xsl:text>for dir in $PKG_DEST/usr/share/man/man{1..8} \ 298 $PKG_DEST/usr/share/{doc,info,man} \ 306 $PKG_DEST/usr/share/bash-completion{/completions,} \ 307 $PKG_DEST/usr/share/{doc,info,man,} \ 299 308 $PKG_DEST/usr/lib/pkgconfig \ 300 309 $PKG_DEST/usr/{lib,bin,sbin,include} \ … … 356 365 357 366 <xsl:template match="sect1" mode="pkgmngt"> 358 <xsl:param name="dirname" select=" chapter05"/>367 <xsl:param name="dirname" select="'chapter05'"/> 359 368 <!-- The build order --> 360 <xsl:param name="order" select=" 062"/>369 <xsl:param name="order" select="'062'"/> 361 370 <!-- The file names --> 362 371 <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/> … … 372 381 set +h 373 382 set -e 374 375 cd $PKGDIR 376 </xsl:text> 383 </xsl:text> 384 <xsl:call-template name="start-script"> 385 <xsl:with-param name="order" select="concat($order,'-',position())"/> 386 </xsl:call-template> 377 387 <xsl:apply-templates 378 388 select=".//screen[not(@role) or … … 395 405 <xsl:text> 396 406 echo -e "\n\nTotalseconds: $SECONDS\n" 397 exit 407 </xsl:text> 408 <xsl:call-template name="end-script"/> 409 <xsl:text>exit 398 410 </xsl:text> 399 411 </exsl:document> … … 1121 1133 </xsl:template> 1122 1134 1135 <xsl:template name="basename"> 1136 <xsl:param name="path" select="''"/> 1137 <xsl:choose> 1138 <xsl:when test="contains($path,'/') and substring-after($path,'/')!=''"> 1139 <xsl:call-template name="basename"> 1140 <xsl:with-param name="path" select="substring-after($path,'/')"/> 1141 </xsl:call-template> 1142 </xsl:when> 1143 <xsl:when test="contains($path,'/') and substring-after($path,'/')=''"> 1144 <xsl:value-of select="substring-before($path,'/')"/> 1145 </xsl:when> 1146 <xsl:otherwise> 1147 <xsl:value-of select="$path"/> 1148 </xsl:otherwise> 1149 </xsl:choose> 1150 </xsl:template> 1151 1152 <xsl:template name="start-script"> 1153 <xsl:param name="order" select="'073'"/> 1154 <!-- get the location of the system root --> 1155 <xsl:text> 1156 if [ -h /tools ]; then 1157 ROOT=$(dirname $(readlink /tools))/ 1158 else 1159 ROOT=/ 1160 fi 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> 1179 SCRIPT_ROOT=</xsl:text> 1180 <xsl:copy-of select="$script-root"/> 1181 <xsl:text> 1182 </xsl:text> 1183 <xsl:if test = "( ../@id != 'chapter-temporary-tools' or 1184 starts-with(@id,'ch-system') ) and $pkgmngt = 'y'"> 1185 <xsl:text> 1186 source ${ROOT}${SCRIPT_ROOT}/packInstall.sh 1187 export -f packInstall</xsl:text> 1188 <xsl:if test="$wrap-install='y'"> 1189 <xsl:text> 1190 export -f wrapInstall 1191 </xsl:text> 1192 </xsl:if> 1193 </xsl:if> 1194 <!-- Get the build directory name and clean remnants of previous attempts --> 1195 <xsl:text> 1196 cd $SRC_DIR 1197 PKGDIR=$(tar -tf $PACKAGE | head -n1 | sed 's@^./@@;s@/.*@@') 1198 export PKGDIR VERSION PKG_DEST 1199 1200 if [ -d "$PKGDIR" ]; then rm -rf $PKGDIR; fi 1201 if [ -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)" 1204 <!-- At last unpack and change directory --> 1205 tar -xf $PACKAGE 1206 cd $PKGDIR 1207 SECONDS=${PREV_SEC} 1208 1209 # Start of LFS book script 1210 </xsl:text> 1211 </xsl:template> 1212 1213 <xsl:template name="end-script"> 1214 <xsl:text> 1215 # End of LFS book script 1216 1217 echo "KB: $(du -skx --exclude=lost+found --exclude=/var/lib --exclude=$SCRIPT_ROOT $ROOT)" 1218 cd $SRC_DIR 1219 rm -rf $PKGDIR 1220 if [ -d "${PKGDIR%-*}-build" ]; then rm -rf ${PKGDIR%-*}-build; fi 1221 </xsl:text> 1222 </xsl:template> 1223 1123 1224 </xsl:stylesheet>
Note:
See TracChangeset
for help on using the changeset viewer.