- Timestamp:
- 08/24/2016 03:15:14 PM (8 years ago)
- Branches:
- new_features
- Children:
- 013a0bc
- Parents:
- df42c7c
- Location:
- BLFS/xsl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
BLFS/xsl/gen_config.xsl
rdf42c7c re234d23 59 59 Select if sudo will be used (you build as a normal user) 60 60 otherwise sudo is not needed (you build as root) 61 62 63 config WRAP_INSTALL 64 bool "Use `porg style' package management" 65 default n 66 help 67 Select if you want the installation commands to be wrapped 68 between "wrapInstall '" and "' ; packInstall" functions, 69 where wrapInstall is used to set up a LD_PRELOAD library (for 70 example using porg), and packInstall makes the package tarball 61 71 </xsl:text> 62 72 </xsl:template> -
BLFS/xsl/scripts.xsl
rdf42c7c re234d23 9 9 10 10 <!-- XSLT stylesheet to create shell scripts from "linear build" BLFS books. --> 11 12 <!-- Wrap "root" commands inside a wrapper function, allowing 13 "porg style" package management --> 14 <xsl:param name="wrap-install" select="'n'"/> 11 15 12 16 <!-- Build as user (y) or as root (n)? --> … … 58 62 <!-- Package page --> 59 63 <xsl:when test="sect2[@role='package']"> 60 <!-- We build in a subdirectory --> 61 <xsl:text>PKG_DIR=</xsl:text> 64 <!-- We build in a subdirectory, whose name may be needed 65 if using package management (see envars.conf), so 66 "export" it --> 67 <xsl:text>export PKG_DIR=</xsl:text> 62 68 <xsl:value-of select="$filename"/> 63 69 <xsl:text>
</xsl:text> … … 125 131 ;; 126 132 esac 133 export UNPACKDIR 127 134 cd $UNPACKDIR
 128 135 </xsl:text> … … 381 388 <xsl:choose> 382 389 <xsl:when test="@role = 'root'"> 383 <xsl:if test="$sudo = 'y'"> 384 <xsl:text>sudo -E sh << ROOT_EOF
</xsl:text> 390 <xsl:if test="not(preceding-sibling::screen[@role='root'])"> 391 <xsl:if test="$sudo = 'y'"> 392 <xsl:text>sudo -E sh << ROOT_EOF
</xsl:text> 393 </xsl:if> 394 <xsl:if test="$wrap-install = 'y' and 395 ancestor::sect2[@role='installation']"> 396 <xsl:text>if [ -r "$PACK_INSTALL" ]; then 397 source $PACK_INSTALL 398 export -f wrapInstall 399 export -f packInstall 400 fi 401 wrapInstall ' 402 </xsl:text> 403 </xsl:if> 385 404 </xsl:if> 386 405 <xsl:apply-templates mode="root"/> 387 <xsl:if test="$sudo = 'y'"> 388 <xsl:text>
ROOT_EOF</xsl:text> 406 <xsl:if test="not(following-sibling::screen[@role='root'])"> 407 <xsl:if test="$wrap-install = 'y' and 408 ancestor::sect2[@role='installation']"> 409 <xsl:text>'
packInstall</xsl:text> 410 </xsl:if> 411 <xsl:if test="$sudo = 'y'"> 412 <xsl:text>
ROOT_EOF</xsl:text> 413 </xsl:if> 389 414 </xsl:if> 390 415 </xsl:when> … … 463 488 </xsl:template> 464 489 490 <xsl:variable name="APOS">'</xsl:variable> 491 465 492 <xsl:template name="output-root"> 466 493 <xsl:param name="out-string" select="''"/> … … 510 537 </xsl:call-template> 511 538 </xsl:when> 539 <xsl:when test="contains($out-string,string($APOS)) 540 and $wrap-install = 'y'"> 541 <xsl:call-template name="output-root"> 542 <xsl:with-param name="out-string" 543 select="substring-before($out-string,string($APOS))"/> 544 </xsl:call-template> 545 <xsl:text>'\''</xsl:text> 546 <xsl:call-template name="output-root"> 547 <xsl:with-param name="out-string" 548 select="substring-after($out-string,string($APOS))"/> 549 </xsl:call-template> 550 </xsl:when> 512 551 <xsl:otherwise> 513 552 <xsl:value-of select="$out-string"/>
Note:
See TracChangeset
for help on using the changeset viewer.