Changeset 39dc04a for BLFS/xsl


Ignore:
Timestamp:
03/15/2017 09:06:17 PM (7 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
2.4, ablfs-more, legacy, trunk
Children:
8dc4646
Parents:
e5d44f5
Message:

Merge new_features rev 3918

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/xsl/scripts.xsl

    re5d44f5 r39dc04a  
    7373            <xsl:text>PKG_DIR=</xsl:text>
    7474            <xsl:value-of select="$filename"/>
    75             <xsl:text>&#xA;</xsl:text>
     75            <xsl:text>
     76SRC_DIR=${SRC_ARCHIVE}${SRC_SUBDIRS:+/${PKG_DIR}}
     77BUILD_DIR=${BUILD_ROOT}${BUILD_SUBDIRS:+/${PKG_DIR}}
     78mkdir -p $SRC_DIR
     79mkdir -p $BUILD_DIR
     80
     81</xsl:text>
    7682            <!-- Download code and build commands -->
    7783            <xsl:apply-templates select="sect2"/>
    7884            <!-- Clean-up -->
    79             <xsl:text>cd $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
     85            <xsl:text>cd $BUILD_DIR
     86[[ -n "$KEEP_FILES" ]] || </xsl:text>
    8087            <!-- In some case, some files in the build tree are owned
    8188                 by root -->
     
    100107    <xsl:choose>
    101108      <xsl:when test="@role = 'package'">
    102         <xsl:text>mkdir -p $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
    103         <xsl:text>cd $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
     109        <xsl:text>cd $SRC_DIR
     110</xsl:text>
    104111        <!-- Download information is in bridgehead tags -->
    105112        <xsl:apply-templates select="bridgehead[@renderas='sect3']"/>
     
    111118      <xsl:when test="@role = 'installation'">
    112119        <xsl:text>
     120cd $BUILD_DIR
    113121find . -maxdepth 1 -mindepth 1 -type d | xargs </xsl:text>
    114122        <xsl:if test="$sudo='y'">
     
    118126case $PACKAGE in
    119127  *.tar.gz|*.tar.bz2|*.tar.xz|*.tgz|*.tar.lzma)
    120      tar -xvf $PACKAGE &gt; unpacked
     128     tar -xvf $SRC_DIR/$PACKAGE &gt; unpacked
    121129     UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^\./@@;s@/.*@@'`
    122130     ;;
    123131  *.tar.lz)
    124      bsdtar -xvf $PACKAGE 2&gt; unpacked
     132     bsdtar -xvf $SRC_DIR/$PACKAGE 2&gt; unpacked
    125133     UNPACKDIR=`head -n1 unpacked | cut  -d" " -f2 | sed 's@^\./@@;s@/.*@@'`
    126134     ;;
    127135  *.zip)
    128      zipinfo -1 $PACKAGE &gt; unpacked
     136     zipinfo -1 $SRC_DIR/$PACKAGE &gt; unpacked
    129137     UNPACKDIR="$(sed 's@/.*@@' unpacked | uniq )"
    130138     if test $(wc -w &lt;&lt;&lt; $UNPACKDIR) -eq 1; then
    131        unzip $PACKAGE
     139       unzip $SRC_DIR/$PACKAGE
    132140     else
    133141       UNPACKDIR=${PACKAGE%.zip}
    134        unzip -d $UNPACKDIR $PACKAGE
     142       unzip -d $UNPACKDIR $SRC_DIR/$PACKAGE
    135143     fi
    136144     ;;
     
    215223    <xsl:value-of select="$varname"/>
    216224    <xsl:text> ]] ; then&#xA;</xsl:text>
    217     <!-- SRC_ARCHIVE may have subdirectories or not -->
     225    <!-- This whole code becomes obsolete because now, it is there or we
     226         download; keeping for now, and we may want to grab it from
     227         SRC_ARCHIVE when SRC_SUBDIRS is set...
    218228    <xsl:text>  if [[ -f $SRC_ARCHIVE/$PKG_DIR/$</xsl:text>
    219229    <xsl:value-of select="$varname"/>
     
    231241    <xsl:text> $</xsl:text>
    232242    <xsl:value-of select="$varname"/>
    233     <xsl:text>&#xA;  else&#xA;</xsl:text>
     243    <xsl:text>&#xA;  else&#xA;</xsl:text> -->
    234244    <!-- Download from upstream http -->
    235245    <xsl:if test="string-length($httpurl) &gt; 10">
    236       <xsl:text>    wget -T 30 -t 5 </xsl:text>
     246      <xsl:text>  wget -T 30 -t 5 </xsl:text>
    237247      <xsl:value-of select="$httpurl"/>
    238248      <xsl:text> ||&#xA;</xsl:text>
     
    240250    <!-- Download from upstream ftp -->
    241251    <xsl:if test="string-length($ftpurl) &gt; 10">
    242       <xsl:text>    wget -T 30 -t 5 </xsl:text>
     252      <xsl:text>  wget -T 30 -t 5 </xsl:text>
    243253      <xsl:value-of select="$ftpurl"/>
    244254      <xsl:text> ||&#xA;</xsl:text>
    245255    </xsl:if>
    246256    <!-- The FTP_SERVER mirror as a last resort -->
    247     <xsl:text>    wget -T 30 -t 5 ${FTP_SERVER}svn/</xsl:text>
     257    <xsl:text>  wget -T 30 -t 5 ${FTP_SERVER}svn/</xsl:text>
    248258    <xsl:value-of select="$first_letter"/>
    249259    <xsl:text>/$</xsl:text>
    250260    <xsl:value-of select="$varname"/>
    251261    <xsl:text>
    252     cp $</xsl:text>
     262<!--    cp $</xsl:text>
    253263    <xsl:value-of select="$varname"/>
    254264    <xsl:text> $SRC_ARCHIVE
    255   fi
     265  fi-->
    256266fi
    257267</xsl:text>
     
    262272      <xsl:value-of select="$varname"/>
    263273      <xsl:text>" | md5sum -c -
     274</xsl:text>
     275    </xsl:if>
     276<!-- link additional packages into $BUILD_DIR, because they are supposed to
     277     be there-->
     278    <xsl:if test="string($varname) != 'PACKAGE'">
     279      <xsl:text>
     280[[ "$SRC_DIR" != "$BUILD_DIR" ]] &amp;&amp; ln -sf $SRC_DIR/$</xsl:text>
     281      <xsl:value-of select="$varname"/>
     282      <xsl:text> $BUILD_DIR
    264283</xsl:text>
    265284    </xsl:if>
Note: See TracChangeset for help on using the changeset viewer.