Changeset 945ccaa for BLFS


Ignore:
Timestamp:
04/09/2017 10:29:32 AM (7 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
ablfs-more, legacy, trunk
Children:
cee84ad
Parents:
909ee37
Message:

Merge the new_features branch (manully, thanks to svn)

Location:
BLFS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • BLFS/gen_pkg_book.sh

    r909ee37 r945ccaa  
    2727declare DEP_LEVEL
    2828declare SUDO
     29declare WRAP_INSTALL
    2930
    3031#--------------------------#
     
    4546      optDependency=* | \
    4647      MAIL_SERVER=*   | \
     48      WRAP_INSTALL=*  | \
    4749      SUDO=*  )  eval ${REPLY} # Define/set a global variable..
    4850                      continue ;;
     
    6365  DEP_LEVEL=$optDependency
    6466  SUDO=${SUDO:-n}
     67  WRAP_INSTALL=${WRAP_INSTALL:-n}
    6568}
    6669
     
    6972#--------------------------#
    7073  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"
    7275  local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}'
    7376  local config_param
     
    180183xsltproc --xinclude --nonet \
    181184         --stringparam sudo $SUDO \
     185         --stringparam wrap-install $WRAP_INSTALL \
    182186         -o ./scripts/ ${MakeScripts} \
    183187         ${BookXml}
  • BLFS/xsl/gen_config.xsl

    r909ee37 r945ccaa  
    5959                Select if sudo will be used (you build as a normal user)
    6060                        otherwise sudo is not needed (you build as root)
     61
     62
     63config  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
    6171</xsl:text>
    6272  </xsl:template>
  • BLFS/xsl/scripts.xsl

    r909ee37 r945ccaa  
    2121    </xsl:choose>
    2222  </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'"/>
    2327
    2428  <!-- Build as user (y) or as root (n)? -->
     
    7074          <!-- Package page -->
    7175          <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>
    7480            <xsl:value-of select="$filename"/>
    7581            <xsl:text>
     
    150156     ;;
    151157esac
     158export UNPACKDIR
    152159cd $UNPACKDIR&#xA;
    153160</xsl:text>
     
    408415      <xsl:choose>
    409416        <xsl:when test="@role = 'root'">
    410           <xsl:if test="$sudo = 'y'">
    411             <xsl:text>sudo -E sh &lt;&lt; ROOT_EOF&#xA;</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 &lt;&lt; ROOT_EOF&#xA;</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
     427fi
     428wrapInstall '
     429</xsl:text>
     430            </xsl:if>
    412431          </xsl:if>
    413432          <xsl:apply-templates mode="root"/>
    414           <xsl:if test="$sudo = 'y'">
    415             <xsl:text>&#xA;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>'&#xA;packInstall</xsl:text>
     437            </xsl:if>
     438            <xsl:if test="$sudo = 'y'">
     439              <xsl:text>&#xA;ROOT_EOF</xsl:text>
     440            </xsl:if>
    416441          </xsl:if>
    417442        </xsl:when>
     
    515540  </xsl:template>
    516541
     542  <xsl:variable name="APOS">'</xsl:variable>
     543
    517544  <xsl:template name="output-root">
    518545    <xsl:param name="out-string" select="''"/>
     
    562589        </xsl:call-template>
    563590      </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>
    564604      <xsl:otherwise>
    565605        <xsl:value-of select="$out-string"/>
Note: See TracChangeset for help on using the changeset viewer.