- Timestamp:
- 04/09/2017 10:29:32 AM (7 years ago)
- Branches:
- ablfs-more, legacy, trunk
- Children:
- cee84ad
- Parents:
- 909ee37
- Location:
- BLFS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
BLFS/gen_pkg_book.sh
r909ee37 r945ccaa 27 27 declare DEP_LEVEL 28 28 declare SUDO 29 declare WRAP_INSTALL 29 30 30 31 #--------------------------# … … 45 46 optDependency=* | \ 46 47 MAIL_SERVER=* | \ 48 WRAP_INSTALL=* | \ 47 49 SUDO=* ) eval ${REPLY} # Define/set a global variable.. 48 50 continue ;; … … 63 65 DEP_LEVEL=$optDependency 64 66 SUDO=${SUDO:-n} 67 WRAP_INSTALL=${WRAP_INSTALL:-n} 65 68 } 66 69 … … 69 72 #--------------------------# 70 73 local -r dotSTR=".................." 71 local -r PARAM_LIST="DEP_LEVEL SUDO MAIL_SERVER "74 local -r PARAM_LIST="DEP_LEVEL SUDO MAIL_SERVER WRAP_INSTALL" 72 75 local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}' 73 76 local config_param … … 180 183 xsltproc --xinclude --nonet \ 181 184 --stringparam sudo $SUDO \ 185 --stringparam wrap-install $WRAP_INSTALL \ 182 186 -o ./scripts/ ${MakeScripts} \ 183 187 ${BookXml} -
BLFS/xsl/gen_config.xsl
r909ee37 r945ccaa 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
r909ee37 r945ccaa 21 21 </xsl:choose> 22 22 </xsl:variable> 23 24 <!-- Wrap "root" commands inside a wrapper function, allowing 25 "porg style" package management --> 26 <xsl:param name="wrap-install" select="'n'"/> 23 27 24 28 <!-- Build as user (y) or as root (n)? --> … … 70 74 <!-- Package page --> 71 75 <xsl:when test="sect2[@role='package']"> 72 <!-- We build in a subdirectory --> 73 <xsl:text>PKG_DIR=</xsl:text> 76 <!-- We build in a subdirectory, whose name may be needed 77 if using package management (see envars.conf), so 78 "export" it --> 79 <xsl:text>export PKG_DIR=</xsl:text> 74 80 <xsl:value-of select="$filename"/> 75 81 <xsl:text> … … 150 156 ;; 151 157 esac 158 export UNPACKDIR 152 159 cd $UNPACKDIR
 153 160 </xsl:text> … … 408 415 <xsl:choose> 409 416 <xsl:when test="@role = 'root'"> 410 <xsl:if test="$sudo = 'y'"> 411 <xsl:text>sudo -E sh << ROOT_EOF
</xsl:text> 417 <xsl:if test="not(preceding-sibling::screen[1][@role='root'])"> 418 <xsl:if test="$sudo = 'y'"> 419 <xsl:text>sudo -E sh << ROOT_EOF
</xsl:text> 420 </xsl:if> 421 <xsl:if test="$wrap-install = 'y' and 422 ancestor::sect2[@role='installation']"> 423 <xsl:text>if [ -r "$PACK_INSTALL" ]; then 424 source $PACK_INSTALL 425 export -f wrapInstall 426 export -f packInstall 427 fi 428 wrapInstall ' 429 </xsl:text> 430 </xsl:if> 412 431 </xsl:if> 413 432 <xsl:apply-templates mode="root"/> 414 <xsl:if test="$sudo = 'y'"> 415 <xsl:text>
ROOT_EOF</xsl:text> 433 <xsl:if test="not(following-sibling::screen[1][@role='root'])"> 434 <xsl:if test="$wrap-install = 'y' and 435 ancestor::sect2[@role='installation']"> 436 <xsl:text>'
packInstall</xsl:text> 437 </xsl:if> 438 <xsl:if test="$sudo = 'y'"> 439 <xsl:text>
ROOT_EOF</xsl:text> 440 </xsl:if> 416 441 </xsl:if> 417 442 </xsl:when> … … 515 540 </xsl:template> 516 541 542 <xsl:variable name="APOS">'</xsl:variable> 543 517 544 <xsl:template name="output-root"> 518 545 <xsl:param name="out-string" select="''"/> … … 562 589 </xsl:call-template> 563 590 </xsl:when> 591 <xsl:when test="contains($out-string,string($APOS)) 592 and $wrap-install = 'y' 593 and ancestor::sect2[@role='installation']"> 594 <xsl:call-template name="output-root"> 595 <xsl:with-param name="out-string" 596 select="substring-before($out-string,string($APOS))"/> 597 </xsl:call-template> 598 <xsl:text>'\''</xsl:text> 599 <xsl:call-template name="output-root"> 600 <xsl:with-param name="out-string" 601 select="substring-after($out-string,string($APOS))"/> 602 </xsl:call-template> 603 </xsl:when> 564 604 <xsl:otherwise> 565 605 <xsl:value-of select="$out-string"/>
Note:
See TracChangeset
for help on using the changeset viewer.