2013-10-29 16:42:03 +01:00
|
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
|
|
|
xmlns:exsl="http://exslt.org/common"
|
|
|
|
|
extension-element-prefixes="exsl"
|
|
|
|
|
version="1.0">
|
|
|
|
|
|
|
|
|
|
<!-- XSLT stylesheet to create shell scripts from "linear build" BLFS books. -->
|
|
|
|
|
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<!-- parameters and global variables -->
|
|
|
|
|
<!-- Check whether the book is sysv or systemd -->
|
2017-03-01 16:54:16 +01:00
|
|
|
|
<xsl:variable name="rev">
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="//bookinfo/title/phrase[@revision='systemd']">
|
|
|
|
|
systemd
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
sysv
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:variable>
|
|
|
|
|
|
2017-04-09 12:29:32 +02:00
|
|
|
|
<!-- Wrap "root" commands inside a wrapper function, allowing
|
|
|
|
|
"porg style" package management -->
|
|
|
|
|
<xsl:param name="wrap-install" select="'n'"/>
|
2021-11-06 15:43:58 +01:00
|
|
|
|
<xsl:param name="pack-install" select="'$HOME/blfs_root/packInstall.sh'"/>
|
2017-04-09 12:29:32 +02:00
|
|
|
|
|
2018-02-05 19:12:17 +01:00
|
|
|
|
<!-- list of packages needing stats -->
|
|
|
|
|
<xsl:param name="list-stat" select="''"/>
|
|
|
|
|
|
2018-01-12 20:04:19 +01:00
|
|
|
|
<!-- Remove libtool .la files -->
|
|
|
|
|
<xsl:param name="del-la-files" select="'y'"/>
|
|
|
|
|
|
2013-10-29 16:42:03 +01:00
|
|
|
|
<!-- Build as user (y) or as root (n)? -->
|
|
|
|
|
<xsl:param name="sudo" select="'y'"/>
|
|
|
|
|
|
2021-11-06 15:43:58 +01:00
|
|
|
|
<!-- Root of sources directory -->
|
|
|
|
|
<xsl:param name="src-archive" select="'/sources'"/>
|
|
|
|
|
|
|
|
|
|
<!-- Download and archive tarballs to subdirs. Can be 'y' or '',
|
|
|
|
|
not 'n' -->
|
|
|
|
|
<xsl:param name="src-subdirs" select="''"/>
|
|
|
|
|
|
|
|
|
|
<!-- Root of build directory -->
|
|
|
|
|
<xsl:param name="build-root" select="'/sources'"/>
|
|
|
|
|
|
|
|
|
|
<!-- extract sources and build into subdirs. Can be 'y' or '',
|
|
|
|
|
not 'n' -->
|
|
|
|
|
<xsl:param name="build-subdirs" select="''"/>
|
|
|
|
|
|
|
|
|
|
<!-- Keep files in the build directory after building. Can be 'y' or '',
|
|
|
|
|
not 'n' -->
|
|
|
|
|
<xsl:param name="keep-files" select="''"/>
|
|
|
|
|
|
|
|
|
|
<!-- Number of parallel jobs; type integer, not string -->
|
|
|
|
|
<xsl:param name="jobs" select="0"/>
|
2018-01-12 20:04:19 +01:00
|
|
|
|
<!-- simple instructions for removing .la files. -->
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<!-- We'll use the rule that any text output begins with a linefeed if needed
|
|
|
|
|
so that we do not need to output one at the end-->
|
2018-01-12 20:04:19 +01:00
|
|
|
|
<xsl:variable name="la-files-instr">
|
|
|
|
|
|
|
|
|
|
for libdir in /lib /usr/lib $(find /opt -name lib); do
|
2018-03-10 15:30:21 +01:00
|
|
|
|
find $libdir -name \*.la \
|
|
|
|
|
! -path \*ImageMagick\* \
|
|
|
|
|
-delete
|
2019-06-15 17:26:23 +02:00
|
|
|
|
done</xsl:variable>
|
2018-02-05 19:12:17 +01:00
|
|
|
|
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<xsl:variable name="list-stat-norm"
|
|
|
|
|
select="concat(' ', normalize-space($list-stat),' ')"/>
|
|
|
|
|
|
|
|
|
|
<!-- To be able to use the single quote in tests -->
|
|
|
|
|
<xsl:variable name="APOS">'</xsl:variable>
|
|
|
|
|
|
|
|
|
|
<!-- end parameters and global variables -->
|
|
|
|
|
|
2019-08-13 17:03:39 +02:00
|
|
|
|
<!-- include the template for processing screen children of
|
|
|
|
|
role="install" sect2 -->
|
|
|
|
|
<xsl:include href="process-install.xsl"/>
|
2019-04-16 09:30:02 +02:00
|
|
|
|
|
2019-08-14 12:32:59 +02:00
|
|
|
|
<!-- include the template for replaceable tags -->
|
|
|
|
|
<xsl:include href="process-replaceable.xsl"/>
|
|
|
|
|
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<!--=================== Begin processing ========================-->
|
2018-02-05 19:12:17 +01:00
|
|
|
|
|
2013-10-29 16:42:03 +01:00
|
|
|
|
<xsl:template match="/">
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<xsl:apply-templates select="//sect1[@id != 'bootscripts' and
|
|
|
|
|
@id != 'systemd-units']"/>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
|
<!--=================== Master chunks code ======================-->
|
|
|
|
|
|
|
|
|
|
<xsl:template match="sect1">
|
|
|
|
|
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<!-- Are stat requested for this page? -->
|
|
|
|
|
<xsl:variable name="want-stats"
|
|
|
|
|
select="contains($list-stat-norm,
|
|
|
|
|
concat(' ',@id,' '))"/>
|
|
|
|
|
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<!-- The file names -->
|
|
|
|
|
<xsl:variable name="filename" select="@id"/>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<!-- The build order -->
|
|
|
|
|
<xsl:variable name="position" select="position()"/>
|
|
|
|
|
<xsl:variable name="order">
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="string-length($position) = 1">
|
|
|
|
|
<xsl:text>00</xsl:text>
|
|
|
|
|
<xsl:value-of select="$position"/>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:when test="string-length($position) = 2">
|
|
|
|
|
<xsl:text>0</xsl:text>
|
|
|
|
|
<xsl:value-of select="$position"/>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:value-of select="$position"/>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:variable>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
|
|
|
|
|
<!-- Depuration code -->
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<xsl:message>
|
|
|
|
|
<xsl:text>SCRIPT is </xsl:text>
|
|
|
|
|
<xsl:value-of select="concat($order,'-z-',$filename)"/>
|
|
|
|
|
<xsl:text>
 FTPDIR is </xsl:text>
|
|
|
|
|
<xsl:value-of select="$filename"/>
|
|
|
|
|
<xsl:text>

</xsl:text>
|
|
|
|
|
</xsl:message>
|
|
|
|
|
|
|
|
|
|
<!-- Creating the scripts -->
|
|
|
|
|
<exsl:document href="{$order}-z-{$filename}" method="text">
|
|
|
|
|
<xsl:text>#!/bin/bash
|
2019-03-26 08:53:17 +01:00
|
|
|
|
set -e
|
2021-11-06 15:43:58 +01:00
|
|
|
|
# Variables coming from configuration
|
|
|
|
|
export JH_PACK_INSTALL="</xsl:text>
|
|
|
|
|
<xsl:copy-of select="$pack-install"/>
|
|
|
|
|
<xsl:text>"
|
|
|
|
|
export JH_SRC_ARCHIVE="</xsl:text>
|
|
|
|
|
<xsl:copy-of select="$src-archive"/>
|
|
|
|
|
<xsl:text>"
|
|
|
|
|
export JH_SRC_SUBDIRS="</xsl:text>
|
|
|
|
|
<xsl:copy-of select="$src-subdirs"/>
|
|
|
|
|
<xsl:text>"
|
|
|
|
|
export JH_BUILD_ROOT="</xsl:text>
|
|
|
|
|
<xsl:copy-of select="$build-root"/>
|
|
|
|
|
<xsl:text>"
|
|
|
|
|
export JH_BUILD_SUBDIRS="</xsl:text>
|
|
|
|
|
<xsl:copy-of select="$build-subdirs"/>
|
|
|
|
|
<xsl:text>"
|
|
|
|
|
export JH_KEEP_FILES="</xsl:text>
|
|
|
|
|
<xsl:copy-of select="$keep-files"/>
|
|
|
|
|
<xsl:text>"
|
|
|
|
|
</xsl:text>
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="$cfg-cflags = 'EMPTY'">
|
|
|
|
|
<xsl:text>unset CFLAGS
|
|
|
|
|
</xsl:text>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:text>export CFLAGS="</xsl:text>
|
|
|
|
|
<xsl:copy-of select="$cfg-cflags"/>
|
|
|
|
|
<xsl:text>"
|
|
|
|
|
</xsl:text>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="$cfg-cxxflags = 'EMPTY'">
|
|
|
|
|
<xsl:text>unset CXXFLAGS
|
|
|
|
|
</xsl:text>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:text>export CXXFLAGS="</xsl:text>
|
|
|
|
|
<xsl:copy-of select="$cfg-cxxflags"/>
|
|
|
|
|
<xsl:text>"
|
|
|
|
|
</xsl:text>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="$cfg-ldflags = 'EMPTY'">
|
|
|
|
|
<xsl:text>unset LDFLAGS
|
2019-03-26 08:53:17 +01:00
|
|
|
|
</xsl:text>
|
2021-11-06 15:43:58 +01:00
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:text>export LDFLAGS="</xsl:text>
|
|
|
|
|
<xsl:copy-of select="$cfg-ldflags"/>
|
|
|
|
|
<xsl:text>"
|
|
|
|
|
</xsl:text>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
<!-- We use MAKEFLAGS and NINJAJOBS for setting the number of
|
|
|
|
|
parallel jobs. This supposes that ninja has been build with
|
|
|
|
|
support for NINJAJOBS in lfs. We'll have to change that code
|
|
|
|
|
if lfs changes its policy for ninja. -->
|
|
|
|
|
<xsl:text>export MAKEFLAGS="-j</xsl:text>
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="$jobs = 0">
|
|
|
|
|
<xsl:text>$(nproc)"
|
|
|
|
|
</xsl:text>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:value-of select="$jobs"/>
|
|
|
|
|
<xsl:text>"
|
|
|
|
|
</xsl:text>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="$jobs = 0">
|
|
|
|
|
<xsl:text>unset NINJAJOBS
|
|
|
|
|
</xsl:text>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:text>export NINJAJOBS="</xsl:text>
|
|
|
|
|
<xsl:value-of select="$jobs"/>
|
|
|
|
|
<xsl:text>"
|
|
|
|
|
</xsl:text>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
2019-08-13 17:28:49 +02:00
|
|
|
|
<!-- Unsetting MAKELEVEL is needed for some packages which assume that
|
2021-11-14 15:18:38 +01:00
|
|
|
|
their top level Makefile is at level zero.
|
|
|
|
|
Some packages (cmake) use MAKE_TERMOUT and MAKE_TERMERR to determine
|
|
|
|
|
whether they are talking to a terminal.
|
|
|
|
|
In our case, stdout/stderr are always redirected, so unset them.-->
|
2021-11-06 15:43:58 +01:00
|
|
|
|
<xsl:text>unset MAKELEVEL
|
2021-11-14 15:18:38 +01:00
|
|
|
|
unset MAKE_TERMOUT
|
|
|
|
|
unset MAKE_TERMERR
|
2021-11-08 09:55:46 +01:00
|
|
|
|
<!-- When installing several packages, and profile or profile.d
|
|
|
|
|
has been modified by a previous package, we need to ensure that
|
|
|
|
|
the updated profile is used.
|
|
|
|
|
-->if [ -r /etc/profile ]; then source /etc/profile; fi
|
2021-11-06 15:43:58 +01:00
|
|
|
|
# End of environment</xsl:text>
|
|
|
|
|
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<xsl:choose>
|
|
|
|
|
<!-- Package page -->
|
|
|
|
|
<xsl:when test="sect2[@role='package']">
|
|
|
|
|
<!-- We build in a subdirectory, whose name may be needed
|
2021-11-06 15:43:58 +01:00
|
|
|
|
if using package management, so
|
2019-04-16 09:30:02 +02:00
|
|
|
|
"export" it -->
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
|
|
|
|
|
export JH_PKG_DIR=</xsl:text>
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<xsl:value-of select="$filename"/>
|
|
|
|
|
<xsl:text>
|
2018-01-30 14:53:34 +01:00
|
|
|
|
SRC_DIR=${JH_SRC_ARCHIVE}${JH_SRC_SUBDIRS:+/${JH_PKG_DIR}}
|
|
|
|
|
BUILD_DIR=${JH_BUILD_ROOT}${JH_BUILD_SUBDIRS:+/${JH_PKG_DIR}}
|
2017-03-15 22:06:17 +01:00
|
|
|
|
mkdir -p $SRC_DIR
|
|
|
|
|
mkdir -p $BUILD_DIR
|
|
|
|
|
</xsl:text>
|
2018-02-05 19:12:17 +01:00
|
|
|
|
|
2021-11-06 15:43:58 +01:00
|
|
|
|
<!-- If stats are requested, include some definitions and initializations -->
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:if test="$want-stats">
|
|
|
|
|
<xsl:text>
|
|
|
|
|
INFOLOG=$(pwd)/info-${JH_PKG_DIR}
|
2018-02-10 22:46:46 +01:00
|
|
|
|
TESTLOG=$(pwd)/test-${JH_PKG_DIR}
|
2021-11-06 15:43:58 +01:00
|
|
|
|
echo MAKEFLAGS: $MAKEFLAGS > $INFOLOG
|
|
|
|
|
echo NINJAJOBS: $NINJAJOBS >> $INFOLOG
|
2019-04-16 09:30:02 +02:00
|
|
|
|
: > $TESTLOG
|
2018-02-05 19:12:17 +01:00
|
|
|
|
PKG_DEST=${BUILD_DIR}/dest
|
|
|
|
|
</xsl:text>
|
2021-11-06 15:43:58 +01:00
|
|
|
|
<!-- in some cases, DESTDIR may have been populated by root -->
|
|
|
|
|
<xsl:if test="$sudo = 'y'">
|
|
|
|
|
<xsl:text>sudo </xsl:text>
|
|
|
|
|
</xsl:if>
|
|
|
|
|
<xsl:text>rm -rf $PKG_DEST
|
|
|
|
|
</xsl:text>
|
|
|
|
|
</xsl:if><!-- want-stats -->
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<!-- Download code and build commands -->
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:apply-templates select="sect2">
|
|
|
|
|
<xsl:with-param name="want-stats" select="$want-stats"/>
|
|
|
|
|
</xsl:apply-templates>
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<!-- Clean-up -->
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
|
|
|
|
|
|
|
|
|
|
cd $BUILD_DIR
|
2018-01-30 14:53:34 +01:00
|
|
|
|
[[ -n "$JH_KEEP_FILES" ]] || </xsl:text>
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<!-- In some case, some files in the build tree are owned
|
|
|
|
|
by root -->
|
|
|
|
|
<xsl:if test="$sudo='y'">
|
|
|
|
|
<xsl:text>sudo </xsl:text>
|
|
|
|
|
</xsl:if>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>rm -rf $JH_UNPACKDIR unpacked
|
|
|
|
|
</xsl:text>
|
2019-04-16 09:30:02 +02:00
|
|
|
|
</xsl:when>
|
|
|
|
|
<!-- Non-package page -->
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:apply-templates select=".//screen" mode="not-pack"/>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
|
|
|
|
|
exit
|
|
|
|
|
</xsl:text><!-- include a \n at the end of document-->
|
2019-04-16 09:30:02 +02:00
|
|
|
|
</exsl:document>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
|
<!--======================= Sub-sections code =======================-->
|
|
|
|
|
|
|
|
|
|
<xsl:template match="sect2">
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:param name="want-stats" select="false"/>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
<xsl:choose>
|
2019-04-16 09:30:02 +02:00
|
|
|
|
|
2013-10-29 16:42:03 +01:00
|
|
|
|
<xsl:when test="@role = 'package'">
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
|
|
|
|
|
cd $SRC_DIR</xsl:text>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<!-- Download information is in bridgehead tags -->
|
2013-10-29 16:42:03 +01:00
|
|
|
|
<xsl:apply-templates select="bridgehead[@renderas='sect3']"/>
|
2019-04-16 09:30:02 +02:00
|
|
|
|
</xsl:when><!-- @role="package" -->
|
|
|
|
|
|
2023-11-18 07:47:29 +01:00
|
|
|
|
<xsl:when test="@role = 'qt5-prefix' or @role = 'qt6-prefix'">
|
2018-09-28 16:35:46 +02:00
|
|
|
|
<xsl:apply-templates select=".//screen[./userinput]"/>
|
2015-09-20 12:18:20 +02:00
|
|
|
|
</xsl:when>
|
2019-04-16 09:30:02 +02:00
|
|
|
|
|
2019-08-17 10:30:36 +02:00
|
|
|
|
<xsl:when test="@role = 'installation' and
|
|
|
|
|
not(preceding-sibling::sect2[@role = 'installation'])">
|
2013-10-29 16:42:03 +01:00
|
|
|
|
<xsl:text>
|
2017-03-15 22:06:17 +01:00
|
|
|
|
cd $BUILD_DIR
|
2015-11-30 22:29:12 +01:00
|
|
|
|
find . -maxdepth 1 -mindepth 1 -type d | xargs </xsl:text>
|
|
|
|
|
<xsl:if test="$sudo='y'">
|
|
|
|
|
<xsl:text>sudo </xsl:text>
|
|
|
|
|
</xsl:if>
|
|
|
|
|
<xsl:text>rm -rf
|
2018-02-05 19:12:17 +01:00
|
|
|
|
</xsl:text>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<!-- If stats are requested, insert the start size -->
|
|
|
|
|
<xsl:if test="$want-stats">
|
|
|
|
|
<xsl:text>
|
2021-11-01 13:12:11 +01:00
|
|
|
|
echo Start Size: $(sudo du -skx --exclude home $BUILD_DIR) >> $INFOLOG
|
2018-02-05 19:12:17 +01:00
|
|
|
|
</xsl:text>
|
|
|
|
|
</xsl:if>
|
|
|
|
|
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
|
|
|
|
|
case $PACKAGE in
|
2016-01-30 09:33:14 +01:00
|
|
|
|
*.tar.gz|*.tar.bz2|*.tar.xz|*.tgz|*.tar.lzma)
|
2017-03-15 22:06:17 +01:00
|
|
|
|
tar -xvf $SRC_DIR/$PACKAGE > unpacked
|
2018-01-30 14:53:34 +01:00
|
|
|
|
JH_UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^\./@@;s@/.*@@'`
|
2017-02-28 13:46:52 +01:00
|
|
|
|
;;
|
|
|
|
|
*.tar.lz)
|
2017-03-15 22:06:17 +01:00
|
|
|
|
bsdtar -xvf $SRC_DIR/$PACKAGE 2> unpacked
|
2018-01-30 14:53:34 +01:00
|
|
|
|
JH_UNPACKDIR=`head -n1 unpacked | cut -d" " -f2 | sed 's@^\./@@;s@/.*@@'`
|
2015-11-20 18:19:08 +01:00
|
|
|
|
;;
|
|
|
|
|
*.zip)
|
2017-03-15 22:06:17 +01:00
|
|
|
|
zipinfo -1 $SRC_DIR/$PACKAGE > unpacked
|
2018-01-30 14:53:34 +01:00
|
|
|
|
JH_UNPACKDIR="$(sed 's@/.*@@' unpacked | uniq )"
|
|
|
|
|
if test $(wc -w <<< $JH_UNPACKDIR) -eq 1; then
|
2017-03-15 22:06:17 +01:00
|
|
|
|
unzip $SRC_DIR/$PACKAGE
|
2015-11-20 18:19:08 +01:00
|
|
|
|
else
|
2018-01-30 14:53:34 +01:00
|
|
|
|
JH_UNPACKDIR=${PACKAGE%.zip}
|
|
|
|
|
unzip -d $JH_UNPACKDIR $SRC_DIR/$PACKAGE
|
2015-11-20 18:19:08 +01:00
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
*)
|
2018-01-30 14:53:34 +01:00
|
|
|
|
JH_UNPACKDIR=$JH_PKG_DIR-build
|
|
|
|
|
mkdir $JH_UNPACKDIR
|
|
|
|
|
cp $SRC_DIR/$PACKAGE $JH_UNPACKDIR
|
2019-06-15 17:26:23 +02:00
|
|
|
|
ADDITIONAL="$(find . -mindepth 1 -maxdepth 1 -type l)"
|
|
|
|
|
if [ -n "$ADDITIONAL" ]; then
|
|
|
|
|
cp $ADDITIONAL $JH_UNPACKDIR
|
|
|
|
|
fi
|
2015-11-20 18:19:08 +01:00
|
|
|
|
;;
|
|
|
|
|
esac
|
2018-01-30 14:53:34 +01:00
|
|
|
|
export JH_UNPACKDIR
|
2019-06-15 17:26:23 +02:00
|
|
|
|
cd $JH_UNPACKDIR
|
2015-11-20 18:19:08 +01:00
|
|
|
|
</xsl:text>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<!-- If stats are requested, insert the start time -->
|
|
|
|
|
<xsl:if test="$want-stats">
|
|
|
|
|
<xsl:text>
|
|
|
|
|
echo Start Time: ${SECONDS} >> $INFOLOG
|
2018-02-05 19:12:17 +01:00
|
|
|
|
</xsl:text>
|
|
|
|
|
</xsl:if>
|
|
|
|
|
|
2019-08-13 17:03:39 +02:00
|
|
|
|
<xsl:call-template name="process-install">
|
|
|
|
|
<xsl:with-param
|
|
|
|
|
name="instruction-tree"
|
2018-09-28 16:35:46 +02:00
|
|
|
|
select=".//screen[not(@role = 'nodump') and ./userinput] |
|
2019-04-16 09:30:02 +02:00
|
|
|
|
.//para/command[contains(text(),'check') or
|
2019-08-13 17:03:39 +02:00
|
|
|
|
contains(text(),'test')]"/>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:with-param name="want-stats" select="$want-stats"/>
|
2019-08-13 17:03:39 +02:00
|
|
|
|
<xsl:with-param name="root-seen" select="boolean(0)"/>
|
|
|
|
|
<xsl:with-param name="install-seen" select="boolean(0)"/>
|
|
|
|
|
<xsl:with-param name="test-seen" select="boolean(0)"/>
|
|
|
|
|
<xsl:with-param name="doc-seen" select="boolean(0)"/>
|
|
|
|
|
</xsl:call-template>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
|
|
|
|
|
</xsl:text>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
<xsl:if test="$sudo = 'y'">
|
|
|
|
|
<xsl:text>sudo /sbin/</xsl:text>
|
|
|
|
|
</xsl:if>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>ldconfig</xsl:text>
|
2019-04-16 09:30:02 +02:00
|
|
|
|
</xsl:when><!-- @role="installation" -->
|
|
|
|
|
|
2013-10-29 16:42:03 +01:00
|
|
|
|
<xsl:when test="@role = 'configuration'">
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
</xsl:text>
|
2018-09-28 16:35:46 +02:00
|
|
|
|
<xsl:apply-templates mode="config"
|
|
|
|
|
select=".//screen[not(@role = 'nodump') and ./userinput]"/>
|
2019-04-16 09:30:02 +02:00
|
|
|
|
</xsl:when><!-- @role="configuration" -->
|
|
|
|
|
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
|
<!--==================== Download code =======================-->
|
|
|
|
|
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<!-- template for extracting the filename from an url in the form:
|
|
|
|
|
proto://internet.name/dir1/.../dirn/filename?condition.
|
|
|
|
|
Needed, because substring-after(...,'/') returns only the
|
|
|
|
|
substring after the first '/'. -->
|
2013-10-29 16:42:03 +01:00
|
|
|
|
<xsl:template name="package_name">
|
|
|
|
|
<xsl:param name="url" select="foo"/>
|
|
|
|
|
<xsl:param name="sub-url" select="substring-after($url,'/')"/>
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="contains($sub-url,'/')">
|
|
|
|
|
<xsl:call-template name="package_name">
|
|
|
|
|
<xsl:with-param name="url" select="$sub-url"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="contains($sub-url,'?')">
|
|
|
|
|
<xsl:value-of select="substring-before($sub-url,'?')"/>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:value-of select="$sub-url"/>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<!-- Generates the code to download a package, an additional package or
|
|
|
|
|
a patch. -->
|
|
|
|
|
<xsl:template name="download-file">
|
|
|
|
|
<xsl:param name="httpurl" select="''"/>
|
|
|
|
|
<xsl:param name="ftpurl" select="''"/>
|
|
|
|
|
<xsl:param name="md5" select="''"/>
|
|
|
|
|
<xsl:param name="varname" select="''"/>
|
|
|
|
|
<xsl:variable name="package">
|
|
|
|
|
<xsl:call-template name="package_name">
|
|
|
|
|
<xsl:with-param name="url">
|
2013-10-29 16:42:03 +01:00
|
|
|
|
<xsl:choose>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<xsl:when test="string-length($httpurl) > 10">
|
|
|
|
|
<xsl:value-of select="$httpurl"/>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<xsl:value-of select="$ftpurl"/>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
</xsl:with-param>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:variable>
|
|
|
|
|
<xsl:variable name="first_letter"
|
|
|
|
|
select="translate(substring($package,1,1),
|
|
|
|
|
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
|
|
|
|
'abcdefghijklmnopqrstuvwxyz')"/>
|
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
|
<xsl:value-of select="$varname"/>
|
|
|
|
|
<xsl:text>=</xsl:text>
|
|
|
|
|
<xsl:value-of select="$package"/>
|
|
|
|
|
<xsl:text>
if [[ ! -f $</xsl:text>
|
|
|
|
|
<xsl:value-of select="$varname"/>
|
2017-03-16 13:49:01 +01:00
|
|
|
|
<xsl:text> ]] ; then
|
2021-11-06 15:43:58 +01:00
|
|
|
|
if [ -f "$JH_SRC_ARCHIVE/$</xsl:text>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<xsl:value-of select="$varname"/>
|
2021-11-06 15:43:58 +01:00
|
|
|
|
<xsl:text>" ] ; then
</xsl:text>
|
|
|
|
|
<xsl:text> cp "$JH_SRC_ARCHIVE/$</xsl:text>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<xsl:value-of select="$varname"/>
|
2021-11-06 15:43:58 +01:00
|
|
|
|
<xsl:text>" "$</xsl:text>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<xsl:value-of select="$varname"/>
|
2021-11-06 15:43:58 +01:00
|
|
|
|
<xsl:text>"
|
2017-03-16 13:49:01 +01:00
|
|
|
|
else
</xsl:text>
|
2017-02-27 15:09:03 +01:00
|
|
|
|
<!-- Download from upstream http -->
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<xsl:if test="string-length($httpurl) > 10">
|
2021-11-06 15:43:58 +01:00
|
|
|
|
<xsl:text> wget -T 30 -t 5 "</xsl:text>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<xsl:value-of select="$httpurl"/>
|
2021-11-06 15:43:58 +01:00
|
|
|
|
<xsl:text>" ||
</xsl:text>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
</xsl:if>
|
2017-02-27 15:09:03 +01:00
|
|
|
|
<!-- Download from upstream ftp -->
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<xsl:if test="string-length($ftpurl) > 10">
|
2021-11-06 15:43:58 +01:00
|
|
|
|
<xsl:text> wget -T 30 -t 5 "</xsl:text>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<xsl:value-of select="$ftpurl"/>
|
2021-11-06 15:43:58 +01:00
|
|
|
|
<xsl:text>" ||
</xsl:text>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
</xsl:if>
|
2017-02-27 15:09:03 +01:00
|
|
|
|
<!-- The FTP_SERVER mirror as a last resort -->
|
2021-11-06 15:43:58 +01:00
|
|
|
|
<xsl:text> wget -T 30 -t 5 "${JH_FTP_SERVER}svn/</xsl:text>
|
2017-02-27 15:09:03 +01:00
|
|
|
|
<xsl:value-of select="$first_letter"/>
|
|
|
|
|
<xsl:text>/$</xsl:text>
|
|
|
|
|
<xsl:value-of select="$varname"/>
|
2021-11-06 15:43:58 +01:00
|
|
|
|
<xsl:text>"
|
2017-03-16 13:49:01 +01:00
|
|
|
|
fi
|
2019-06-15 17:26:23 +02:00
|
|
|
|
fi</xsl:text>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<xsl:if test="string-length($md5) > 10">
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
|
|
|
|
|
echo "</xsl:text>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<xsl:value-of select="$md5"/>
|
|
|
|
|
<xsl:text>  $</xsl:text>
|
|
|
|
|
<xsl:value-of select="$varname"/>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>" | md5sum -c -</xsl:text>
|
2017-03-15 22:06:17 +01:00
|
|
|
|
</xsl:if>
|
|
|
|
|
<!-- link additional packages into $BUILD_DIR, because they are supposed to
|
|
|
|
|
be there-->
|
|
|
|
|
<xsl:if test="string($varname) != 'PACKAGE'">
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
|
2021-11-06 15:43:58 +01:00
|
|
|
|
[ "$SRC_DIR" != "$BUILD_DIR" ] && ln -sf "$SRC_DIR/$</xsl:text>
|
2017-03-15 22:06:17 +01:00
|
|
|
|
<xsl:value-of select="$varname"/>
|
2021-11-06 15:43:58 +01:00
|
|
|
|
<xsl:text>" "$BUILD_DIR"</xsl:text>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
</xsl:if>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
</xsl:text>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
|
<!-- Extract the MD5 sum information -->
|
|
|
|
|
<xsl:template match="para" mode="md5">
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="contains(substring-after(string(),'sum: '),'
')">
|
|
|
|
|
<xsl:value-of select="substring-before(substring-after(string(),'sum: '),'
')"/>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:when>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:value-of select="substring-after(string(),'sum: ')"/>
|
|
|
|
|
</xsl:otherwise>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<!-- We have several templates itemizedlist, depending on whether we
|
|
|
|
|
expect the package information, or additional package(s) or patch(es)
|
|
|
|
|
information. Select the appropriate mode here. -->
|
|
|
|
|
<xsl:template match="bridgehead">
|
2013-10-29 16:42:03 +01:00
|
|
|
|
<xsl:choose>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<!-- Special case for Openjdk -->
|
|
|
|
|
<xsl:when test="contains(string(),'Source Package Information')">
|
|
|
|
|
<xsl:apply-templates
|
|
|
|
|
select="following-sibling::itemizedlist[1]//simplelist">
|
|
|
|
|
<xsl:with-param name="varname" select="'PACKAGE'"/>
|
|
|
|
|
</xsl:apply-templates>
|
|
|
|
|
<xsl:apply-templates select="following-sibling::itemizedlist
|
|
|
|
|
[preceding-sibling::bridgehead[1]=current()
|
|
|
|
|
and position() >1]//simplelist">
|
|
|
|
|
<xsl:with-param name="varname" select="'PACKAGE1'"/>
|
|
|
|
|
</xsl:apply-templates>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:when>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<!-- Package information -->
|
|
|
|
|
<xsl:when test="contains(string(),'Package Information')">
|
|
|
|
|
<xsl:apply-templates select="following-sibling::itemizedlist
|
|
|
|
|
[preceding-sibling::bridgehead[1]=current()]"
|
|
|
|
|
mode="package"/>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:when>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<!-- Additional package information -->
|
2020-09-15 09:36:23 +02:00
|
|
|
|
<!-- special cases for llvm -->
|
2020-09-15 11:09:18 +02:00
|
|
|
|
<xsl:when test="contains(string(),'Recommended Download')">
|
2022-11-18 15:36:07 +01:00
|
|
|
|
<xsl:apply-templates select="following-sibling::itemizedlist
|
|
|
|
|
[preceding-sibling::bridgehead[1]=current()]"
|
2020-09-15 09:36:23 +02:00
|
|
|
|
mode="additional"/>
|
|
|
|
|
</xsl:when>
|
2014-05-20 22:31:22 +02:00
|
|
|
|
<xsl:when test="contains(string(),'Optional Download')">
|
2022-11-18 15:36:07 +01:00
|
|
|
|
<xsl:apply-templates select="following-sibling::itemizedlist
|
|
|
|
|
[preceding-sibling::bridgehead[1]=current()]"
|
2014-05-20 22:31:22 +02:00
|
|
|
|
mode="additional"/>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<!-- All other additional packages have "Additional" -->
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<xsl:when test="contains(string(),'Additional')">
|
2022-11-18 15:36:07 +01:00
|
|
|
|
<xsl:apply-templates select="following-sibling::itemizedlist
|
|
|
|
|
[preceding-sibling::bridgehead[1]=current()]"
|
2014-03-26 09:47:59 +01:00
|
|
|
|
mode="additional"/>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:when>
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<!-- Do not do anything if the dev has created another type of
|
|
|
|
|
bridgehead. -->
|
|
|
|
|
<xsl:otherwise/>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<!-- Call the download code template with appropriate parameters -->
|
|
|
|
|
<xsl:template match="itemizedlist" mode="package">
|
|
|
|
|
<xsl:call-template name="download-file">
|
|
|
|
|
<xsl:with-param name="httpurl">
|
|
|
|
|
<xsl:value-of select="./listitem[1]/para/ulink/@url"/>
|
|
|
|
|
</xsl:with-param>
|
|
|
|
|
<xsl:with-param name="ftpurl">
|
|
|
|
|
<xsl:value-of select="./listitem/para[contains(string(),'FTP')]/ulink/@url"/>
|
|
|
|
|
</xsl:with-param>
|
|
|
|
|
<xsl:with-param name="md5">
|
|
|
|
|
<xsl:apply-templates select="./listitem/para[contains(string(),'MD5')]"
|
|
|
|
|
mode="md5"/>
|
|
|
|
|
</xsl:with-param>
|
|
|
|
|
<xsl:with-param name="varname" select="'PACKAGE'"/>
|
|
|
|
|
</xsl:call-template>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:template>
|
|
|
|
|
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<xsl:template match="itemizedlist" mode="additional">
|
|
|
|
|
<!-- The normal layout is "one listitem"<->"one url", but some devs
|
|
|
|
|
find amusing to have FTP and/or MD5sum listitems, or to
|
|
|
|
|
enclose the download information inside a simplelist tag... -->
|
|
|
|
|
<xsl:for-each select="listitem[.//ulink]">
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<!-- hopefully, there was a HTTP line before -->
|
|
|
|
|
<xsl:when test="contains(string(./para),'FTP')"/>
|
|
|
|
|
<xsl:when test=".//simplelist">
|
|
|
|
|
<xsl:apply-templates select=".//simplelist">
|
|
|
|
|
<xsl:with-param name="varname" select="'PACKAGE1'"/>
|
|
|
|
|
</xsl:apply-templates>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:call-template name="download-file">
|
|
|
|
|
<xsl:with-param name="httpurl">
|
|
|
|
|
<xsl:value-of select="./para/ulink/@url"/>
|
|
|
|
|
</xsl:with-param>
|
|
|
|
|
<xsl:with-param name="ftpurl">
|
|
|
|
|
<xsl:value-of
|
|
|
|
|
select="following-sibling::listitem[1]/
|
|
|
|
|
para[contains(string(),'FTP')]/ulink/@url"/>
|
|
|
|
|
</xsl:with-param>
|
|
|
|
|
<xsl:with-param name="md5">
|
|
|
|
|
<xsl:apply-templates
|
|
|
|
|
select="following-sibling::listitem[position()<3]/
|
|
|
|
|
para[contains(string(),'MD5')]"
|
|
|
|
|
mode="md5"/>
|
|
|
|
|
</xsl:with-param>
|
|
|
|
|
<xsl:with-param name="varname">
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="contains(./para/ulink/@url,'.patch')">
|
|
|
|
|
<xsl:text>PATCH</xsl:text>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:text>PACKAGE1</xsl:text>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:with-param>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:for-each>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:template>
|
|
|
|
|
|
2014-03-26 09:47:59 +01:00
|
|
|
|
<!-- the simplelist case. Hopefully, the layout is one member for
|
|
|
|
|
url, one for md5 and others for various information, that we do not
|
|
|
|
|
use -->
|
|
|
|
|
<xsl:template match="simplelist">
|
|
|
|
|
<xsl:param name="varname" select="'PACKAGE1'"/>
|
|
|
|
|
<xsl:call-template name="download-file">
|
|
|
|
|
<xsl:with-param name="httpurl" select=".//ulink/@url"/>
|
|
|
|
|
<xsl:with-param name="md5">
|
|
|
|
|
<xsl:value-of select="substring-after(member[contains(string(),'MD5')],'sum: ')"/>
|
|
|
|
|
</xsl:with-param>
|
|
|
|
|
<xsl:with-param name="varname" select="$varname"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:template>
|
2018-09-28 16:35:46 +02:00
|
|
|
|
|
|
|
|
|
<!--====================== Non package code =========================-->
|
|
|
|
|
|
|
|
|
|
<xsl:template match="screen" mode="not-pack">
|
|
|
|
|
<xsl:choose>
|
2019-06-19 09:56:39 +02:00
|
|
|
|
<xsl:when test="@role='nodump'"/>
|
2018-09-28 16:35:46 +02:00
|
|
|
|
<xsl:when test="ancestor::sect1[@id='postlfs-config-vimrc']">
|
|
|
|
|
<xsl:text>
|
|
|
|
|
cat > ~/.vimrc <<EOF
|
|
|
|
|
</xsl:text>
|
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
|
<xsl:text>
|
|
|
|
|
EOF
|
|
|
|
|
</xsl:text>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:apply-templates select="." mode="config"/>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:template>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
<!--======================== Commands code ==========================-->
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<!-- Code for installation instructions is in gen-install.xsl -->
|
2013-10-29 16:42:03 +01:00
|
|
|
|
|
|
|
|
|
<xsl:template match="screen">
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<xsl:choose>
|
|
|
|
|
<!-- instructions run as root (configuration mainly) -->
|
|
|
|
|
<xsl:when test="@role = 'root'">
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<!-- templates begin/end-root are in gen-install.xsl -->
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<xsl:if test="not(preceding-sibling::screen[1][@role='root'])">
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:call-template name="begin-root"/>
|
2019-04-16 09:30:02 +02:00
|
|
|
|
</xsl:if>
|
|
|
|
|
<xsl:apply-templates mode="root"/>
|
|
|
|
|
<xsl:if test="not(following-sibling::screen[1][@role='root'])">
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:call-template name="end-root"/>
|
2019-04-16 09:30:02 +02:00
|
|
|
|
</xsl:if>
|
|
|
|
|
</xsl:when>
|
2018-02-05 19:12:17 +01:00
|
|
|
|
<!-- then all the instructions run as user -->
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:apply-templates select="userinput"/>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:template>
|
|
|
|
|
|
2019-08-13 17:28:49 +02:00
|
|
|
|
<!-- Templates for bootscripts/units installation -->
|
2017-03-01 16:54:16 +01:00
|
|
|
|
<xsl:template name="set-bootpkg-dir">
|
|
|
|
|
<xsl:param name="bootpkg" select="'bootscripts'"/>
|
|
|
|
|
<xsl:param name="url" select="''"/>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
|
|
|
|
|
BOOTPKG_DIR=blfs-</xsl:text>
|
2017-03-01 16:54:16 +01:00
|
|
|
|
<xsl:copy-of select="$bootpkg"/>
|
|
|
|
|
<xsl:text>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
|
2018-01-30 14:53:34 +01:00
|
|
|
|
BOOTSRC_DIR=${JH_SRC_ARCHIVE}${JH_SRC_SUBDIRS:+/${BOOTPKG_DIR}}
|
|
|
|
|
BOOTBUILD_DIR=${JH_BUILD_ROOT}${JH_BUILD_SUBDIRS:+/${BOOTPKG_DIR}}
|
2017-06-29 10:25:01 +02:00
|
|
|
|
mkdir -p $BOOTSRC_DIR
|
|
|
|
|
mkdir -p $BOOTBUILD_DIR
|
|
|
|
|
|
|
|
|
|
pushd $BOOTSRC_DIR
|
2013-10-29 16:42:03 +01:00
|
|
|
|
URL=</xsl:text>
|
2017-03-01 16:54:16 +01:00
|
|
|
|
<xsl:value-of select="$url"/>
|
|
|
|
|
<xsl:text>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
BOOTPACKG=$(basename $URL)
|
2013-10-30 16:44:46 +01:00
|
|
|
|
if [[ ! -f $BOOTPACKG ]] ; then
|
2018-01-30 14:53:34 +01:00
|
|
|
|
if [[ -f $JH_SRC_ARCHIVE/$BOOTPACKG ]] ; then
|
|
|
|
|
cp $JH_SRC_ARCHIVE/$BOOTPACKG $BOOTPACKG
|
2013-10-30 16:44:46 +01:00
|
|
|
|
else
|
|
|
|
|
wget -T 30 -t 5 $URL
|
|
|
|
|
fi
|
2017-06-29 10:25:01 +02:00
|
|
|
|
rm -f $BOOTBUILD_DIR/unpacked
|
2013-10-30 16:44:46 +01:00
|
|
|
|
fi
|
|
|
|
|
|
2017-06-29 10:25:01 +02:00
|
|
|
|
cd $BOOTBUILD_DIR
|
2013-10-29 16:42:03 +01:00
|
|
|
|
if [[ -e unpacked ]] ; then
|
2014-09-24 12:10:53 +02:00
|
|
|
|
BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
|
|
|
|
|
if ! [[ -d $BOOTUNPACKDIR ]]; then
|
2017-06-29 10:25:01 +02:00
|
|
|
|
tar -xvf $BOOTSRC_DIR/$BOOTPACKG > unpacked
|
2014-09-24 12:10:53 +02:00
|
|
|
|
BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
|
2013-10-29 16:42:03 +01:00
|
|
|
|
fi
|
|
|
|
|
else
|
2017-06-29 10:25:01 +02:00
|
|
|
|
tar -xvf $BOOTSRC_DIR/$BOOTPACKG > unpacked
|
2014-09-24 12:10:53 +02:00
|
|
|
|
BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
|
2013-10-29 16:42:03 +01:00
|
|
|
|
fi
|
2019-06-15 17:26:23 +02:00
|
|
|
|
cd $BOOTUNPACKDIR</xsl:text>
|
2017-03-01 16:54:16 +01:00
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
|
<xsl:template match="screen" mode="config">
|
|
|
|
|
<xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<!-- if the preceding "screen" tag is role="root", and we are role="root"
|
2023-03-18 22:44:03 +01:00
|
|
|
|
the end-root has not been called, except if the preceding "screen"
|
|
|
|
|
tag is itself preceded by a <para> containing and <xref> to
|
|
|
|
|
bootscripts. So close it only if needed -->
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:if
|
2023-03-18 22:44:03 +01:00
|
|
|
|
test="preceding-sibling::screen[1][@role='root'] and
|
|
|
|
|
@role='root' and
|
|
|
|
|
not(preceding-sibling::screen[1]/preceding-sibling::para[1]/xref[@linkend='bootscripts'])">
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:call-template name="end-root"/>
|
|
|
|
|
</xsl:if>
|
2017-03-01 16:54:16 +01:00
|
|
|
|
<xsl:call-template name="set-bootpkg-dir">
|
|
|
|
|
<xsl:with-param name="bootpkg" select="'bootscripts'"/>
|
|
|
|
|
<xsl:with-param name="url"
|
|
|
|
|
select="id('bootscripts')//itemizedlist//ulink/@url"/>
|
|
|
|
|
</xsl:call-template>
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<!-- if the preceding "screen" tag is role="root", and we are role="root"
|
2023-03-18 22:44:03 +01:00
|
|
|
|
the begin-root will not be called. So do it.-->
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:if
|
2023-03-18 22:44:03 +01:00
|
|
|
|
test="preceding-sibling::screen[1][@role='root'] and
|
|
|
|
|
@role='root'">
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:call-template name="begin-root"/>
|
|
|
|
|
</xsl:if>
|
2017-03-01 16:54:16 +01:00
|
|
|
|
</xsl:if>
|
|
|
|
|
<xsl:if test="preceding-sibling::para[1]/xref[@linkend='systemd-units']">
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<!-- if the preceding "screen" tag is role="root", and we are role="root"
|
2023-03-18 22:44:03 +01:00
|
|
|
|
the end-root has not been called. So do it, except if it was already a
|
|
|
|
|
unit install -->
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:if
|
2023-03-18 22:44:03 +01:00
|
|
|
|
test="preceding-sibling::screen[1][@role='root'] and
|
|
|
|
|
@role='root' and
|
|
|
|
|
not(preceding-sibling::screen[1]/preceding-sibling::para[1]/xref[@linkend='systemd-units'])">
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:call-template name="end-root"/>
|
|
|
|
|
</xsl:if>
|
2017-03-01 16:54:16 +01:00
|
|
|
|
<xsl:call-template name="set-bootpkg-dir">
|
|
|
|
|
<xsl:with-param name="bootpkg" select="'systemd-units'"/>
|
|
|
|
|
<xsl:with-param name="url"
|
|
|
|
|
select="id('systemd-units')//itemizedlist//ulink/@url"/>
|
|
|
|
|
</xsl:call-template>
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<!-- if the preceding "screen" tag is role="root", and we are role="root"
|
2023-03-18 22:44:03 +01:00
|
|
|
|
the begin-root will not be called. So do it. -->
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:if
|
2023-03-18 22:44:03 +01:00
|
|
|
|
test="preceding-sibling::screen[1][@role='root'] and
|
|
|
|
|
@role='root'">
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:call-template name="begin-root"/>
|
|
|
|
|
</xsl:if>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:if>
|
|
|
|
|
<xsl:apply-templates select='.'/>
|
2017-03-01 16:54:16 +01:00
|
|
|
|
<xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts' or
|
|
|
|
|
@linkend='systemd-units']">
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<!-- if the next "screen" tag is role="root", and we are role="root"
|
2023-03-18 22:44:03 +01:00
|
|
|
|
the end-root has not been called. -->
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:if
|
|
|
|
|
test="following-sibling::screen[1][@role='root'] and @role='root'">
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:call-template name="end-root"/>
|
|
|
|
|
</xsl:if>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
|
|
|
|
|
popd</xsl:text>
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<!-- if the next "screen" tag is role="root", and we are role="root"
|
2023-03-18 22:44:03 +01:00
|
|
|
|
the begin-root will not be called. So do it, except if the next
|
|
|
|
|
<screen> is itself a unit or bootscript install -->
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:if
|
2023-03-18 22:44:03 +01:00
|
|
|
|
test="following-sibling::screen[1][@role='root'] and
|
|
|
|
|
@role='root' and
|
|
|
|
|
not(following-sibling::screen[1]/preceding-sibling::para[1]/xref[@linkend='bootscripts' or @linkend='systemd-units'])">
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:call-template name="begin-root"/>
|
|
|
|
|
</xsl:if>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:if>
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<xsl:template match="command" mode="installation">
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:param name="want-stats" select="false"/>
|
2014-09-28 10:06:23 +02:00
|
|
|
|
<xsl:variable name="ns" select="normalize-space(string())"/>
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<xsl:variable name="first"
|
|
|
|
|
select="not(
|
|
|
|
|
boolean(
|
|
|
|
|
preceding-sibling::command[contains(text(),'check') or
|
|
|
|
|
contains(text(),'test')]))"/>
|
|
|
|
|
<xsl:variable name="last"
|
|
|
|
|
select="not(
|
|
|
|
|
boolean(
|
|
|
|
|
following-sibling::command[contains(text(),'check') or
|
|
|
|
|
contains(text(),'test')]))"/>
|
|
|
|
|
<xsl:choose>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:when test="$want-stats">
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<xsl:if test="$first">
|
2018-02-05 19:12:17 +01:00
|
|
|
|
<xsl:text>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
|
2018-02-05 19:12:17 +01:00
|
|
|
|
echo Time after make: ${SECONDS} >> $INFOLOG
|
2021-11-01 13:12:11 +01:00
|
|
|
|
echo Size after make: $(sudo du -skx --exclude home $BUILD_DIR) >> $INFOLOG
|
2018-02-05 19:12:17 +01:00
|
|
|
|
echo Time before test: ${SECONDS} >> $INFOLOG
|
2019-04-16 09:30:02 +02:00
|
|
|
|
|
2018-02-05 19:12:17 +01:00
|
|
|
|
</xsl:text>
|
2019-04-16 09:30:02 +02:00
|
|
|
|
</xsl:if>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
|
|
|
|
|
#</xsl:text>
|
2019-04-16 09:30:02 +02:00
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="contains($ns,'make')">
|
|
|
|
|
<xsl:value-of select="substring-before($ns,'make ')"/>
|
|
|
|
|
<xsl:text>make </xsl:text>
|
|
|
|
|
<xsl:if test="not(contains($ns,'-k'))">
|
|
|
|
|
<xsl:text>-k </xsl:text>
|
|
|
|
|
</xsl:if>
|
|
|
|
|
<xsl:value-of select="substring-after($ns,'make ')"/>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:copy-of select="$ns"/>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:if test="$want-stats">
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<xsl:text> >> $TESTLOG 2>&1</xsl:text>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:if>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text> || true</xsl:text>
|
|
|
|
|
<xsl:if test="$want-stats">
|
2019-04-16 09:30:02 +02:00
|
|
|
|
<xsl:text>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
|
2019-04-16 09:30:02 +02:00
|
|
|
|
echo Time after test: ${SECONDS} >> $INFOLOG
|
2021-11-01 13:12:11 +01:00
|
|
|
|
echo Size after test: $(sudo du -skx --exclude home $BUILD_DIR) >> $INFOLOG
|
2019-04-16 09:30:02 +02:00
|
|
|
|
echo Time before install: ${SECONDS} >> $INFOLOG
|
|
|
|
|
</xsl:text>
|
|
|
|
|
</xsl:if>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:template>
|
|
|
|
|
|
2019-08-13 17:28:49 +02:00
|
|
|
|
<xsl:template match="userinput|command">
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
|
|
|
|
|
</xsl:text>
|
2013-10-29 16:42:03 +01:00
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:template match="userinput" mode="root">
|
|
|
|
|
<xsl:text>
|
|
|
|
|
</xsl:text>
|
|
|
|
|
<xsl:apply-templates mode="root"/>
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:template match="text()">
|
|
|
|
|
<xsl:call-template name="remove-ampersand">
|
|
|
|
|
<xsl:with-param name="out-string" select="string()"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
2013-10-29 16:42:03 +01:00
|
|
|
|
<xsl:template match="text()" mode="root">
|
|
|
|
|
<xsl:call-template name="output-root">
|
|
|
|
|
<xsl:with-param name="out-string" select="string()"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
|
<xsl:template name="output-root">
|
|
|
|
|
<xsl:param name="out-string" select="''"/>
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="contains($out-string,'$') and $sudo = 'y'">
|
|
|
|
|
<xsl:call-template name="output-root">
|
|
|
|
|
<xsl:with-param name="out-string"
|
|
|
|
|
select="substring-before($out-string,'$')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
<xsl:text>\$</xsl:text>
|
|
|
|
|
<xsl:call-template name="output-root">
|
|
|
|
|
<xsl:with-param name="out-string"
|
|
|
|
|
select="substring-after($out-string,'$')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:when test="contains($out-string,'`') and $sudo = 'y'">
|
|
|
|
|
<xsl:call-template name="output-root">
|
|
|
|
|
<xsl:with-param name="out-string"
|
|
|
|
|
select="substring-before($out-string,'`')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
<xsl:text>\`</xsl:text>
|
|
|
|
|
<xsl:call-template name="output-root">
|
|
|
|
|
<xsl:with-param name="out-string"
|
|
|
|
|
select="substring-after($out-string,'`')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:when test="contains($out-string,'\') and $sudo = 'y'">
|
|
|
|
|
<xsl:call-template name="output-root">
|
|
|
|
|
<xsl:with-param name="out-string"
|
|
|
|
|
select="substring-before($out-string,'\')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
<xsl:text>\\</xsl:text>
|
|
|
|
|
<xsl:call-template name="output-root">
|
|
|
|
|
<xsl:with-param name="out-string"
|
|
|
|
|
select="substring-after($out-string,'\')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:call-template name="remove-ampersand">
|
|
|
|
|
<xsl:with-param name="out-string" select="$out-string"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
<!-- <xsl:value-of select="$out-string"/> -->
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
2018-02-05 19:12:17 +01:00
|
|
|
|
<xsl:template name="output-destdir">
|
|
|
|
|
<xsl:apply-templates
|
|
|
|
|
select="userinput|following-sibling::screen[@role='root']/userinput"
|
|
|
|
|
mode="destdir"/>
|
|
|
|
|
<xsl:text>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
|
2018-02-05 19:12:17 +01:00
|
|
|
|
echo Time after install: ${SECONDS} >> $INFOLOG
|
2021-11-01 13:12:11 +01:00
|
|
|
|
echo Size after install: $(sudo du -skx --exclude home $BUILD_DIR) >> $INFOLOG
|
2018-02-05 19:12:17 +01:00
|
|
|
|
</xsl:text>
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
|
<xsl:template match="userinput" mode="destdir">
|
2019-08-13 17:28:49 +02:00
|
|
|
|
<xsl:text>
|
|
|
|
|
</xsl:text>
|
2023-03-19 10:10:24 +01:00
|
|
|
|
<xsl:for-each select="./literal">
|
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
|
<xsl:with-param name="outputstring" select="preceding-sibling::text()[1]"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
<xsl:apply-templates select="."/>
|
|
|
|
|
</xsl:for-each>
|
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
|
<xsl:with-param name="outputstring" select="text()[last()]"/>
|
|
|
|
|
</xsl:call-template>
|
2018-02-05 19:12:17 +01:00
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
|
<xsl:template name="outputpkgdest">
|
|
|
|
|
<xsl:param name="outputstring" select="'foo'"/>
|
|
|
|
|
<xsl:choose>
|
2023-03-19 10:15:18 +01:00
|
|
|
|
<xsl:when test="contains(normalize-space($outputstring),' make ') or
|
|
|
|
|
starts-with($outputstring, 'make ')">
|
2018-02-05 19:12:17 +01:00
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="not(starts-with($outputstring,'make'))">
|
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
|
<xsl:with-param name="outputstring"
|
|
|
|
|
select="substring-before($outputstring,'make')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
|
<xsl:with-param
|
|
|
|
|
name="outputstring"
|
|
|
|
|
select="substring-after($outputstring,
|
|
|
|
|
substring-before($outputstring,'make'))"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
|
|
|
|
|
make DESTDIR=$PKG_DEST</xsl:text>
|
2018-02-05 19:12:17 +01:00
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
|
<xsl:with-param
|
|
|
|
|
name="outputstring"
|
|
|
|
|
select="substring-after($outputstring,'make')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:when test="contains($outputstring,'ninja install')">
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="not(starts-with($outputstring,'ninja install'))">
|
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
|
<xsl:with-param name="outputstring"
|
|
|
|
|
select="substring-before($outputstring,'ninja install')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
|
<xsl:with-param
|
|
|
|
|
name="outputstring"
|
|
|
|
|
select="substring-after($outputstring,
|
|
|
|
|
substring-before($outputstring,'ninja install'))"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
|
|
|
|
|
DESTDIR=$PKG_DEST ninja</xsl:text>
|
2018-02-05 19:12:17 +01:00
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
|
<xsl:with-param
|
|
|
|
|
name="outputstring"
|
|
|
|
|
select="substring-after($outputstring,'ninja')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise> <!-- no make nor ninja in this string -->
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="contains($outputstring,'>/') and
|
|
|
|
|
not(contains(substring-before($outputstring,'>/'),' /'))">
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:call-template name="remove-ampersand">
|
|
|
|
|
<xsl:with-param name="out-string"
|
|
|
|
|
select="substring-before($outputstring,'>/')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
<!-- <xsl:value-of select="substring-before($outputstring,'>/')"/>-->
|
2018-02-05 19:12:17 +01:00
|
|
|
|
<xsl:text>>$PKG_DEST/</xsl:text>
|
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
|
<xsl:with-param name="outputstring" select="substring-after($outputstring,'>/')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:when test="contains($outputstring,' /')">
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:call-template name="remove-ampersand">
|
|
|
|
|
<xsl:with-param name="out-string"
|
|
|
|
|
select="substring-before($outputstring,' /')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
<!-- <xsl:value-of select="substring-before($outputstring,' /')"/>-->
|
2018-02-05 19:12:17 +01:00
|
|
|
|
<xsl:text> $PKG_DEST/</xsl:text>
|
|
|
|
|
<xsl:call-template name="outputpkgdest">
|
|
|
|
|
<xsl:with-param name="outputstring" select="substring-after($outputstring,' /')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:call-template name="remove-ampersand">
|
|
|
|
|
<xsl:with-param name="out-string" select="$outputstring"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
<!-- <xsl:value-of select="$outputstring"/>-->
|
2018-02-05 19:12:17 +01:00
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:template name="remove-ampersand">
|
|
|
|
|
<xsl:param name="out-string" select="''"/>
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="contains($out-string,'&&
')">
|
|
|
|
|
<xsl:variable name="instruction-before">
|
|
|
|
|
<xsl:call-template name="last-line">
|
|
|
|
|
<xsl:with-param
|
|
|
|
|
name="instructions"
|
|
|
|
|
select="substring-before($out-string,'&&
')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:variable>
|
|
|
|
|
<xsl:call-template name="remove-end-space">
|
|
|
|
|
<xsl:with-param
|
|
|
|
|
name="instructions"
|
|
|
|
|
select="substring-before($out-string,'&&
')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
<xsl:if test="contains($instruction-before,' ]') or
|
|
|
|
|
contains($instruction-before,'test ') or
|
|
|
|
|
contains($instruction-before,'pgrep -l')">
|
|
|
|
|
<xsl:text> &&</xsl:text>
|
|
|
|
|
</xsl:if>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:text>
|
|
|
|
|
</xsl:text>
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:call-template name="remove-ampersand">
|
|
|
|
|
<xsl:with-param name="out-string"
|
|
|
|
|
select="substring-after($out-string,
|
|
|
|
|
'&&
')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:copy-of select="$out-string"/>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
|
<xsl:template name="last-line">
|
|
|
|
|
<xsl:param name="instructions" select="''"/>
|
|
|
|
|
<xsl:choose>
|
|
|
|
|
<xsl:when test="contains($instructions,'
')">
|
|
|
|
|
<xsl:call-template name="last-line">
|
|
|
|
|
<xsl:with-param
|
|
|
|
|
name="instructions"
|
|
|
|
|
select="substring-after($instructions,'
')"/>
|
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
|
|
|
|
<xsl:copy-of select="normalize-space($instructions)"/>
|
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
|
<xsl:template name="remove-end-space">
|
|
|
|
|
<xsl:param name="instructions" select="''"/>
|
|
|
|
|
<xsl:choose>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:when
|
|
|
|
|
test="substring($instructions,string-length($instructions))=' '">
|
2019-04-22 11:38:44 +02:00
|
|
|
|
<xsl:call-template name="remove-end-space">
|
|
|
|
|
<xsl:with-param
|
|
|
|
|
name="instructions"
|
2019-06-15 17:26:23 +02:00
|
|
|
|
select="substring($instructions,
|
|
|
|
|
1,
|
|
|
|
|
string-length($instructions)-1)"/>
|
2019-04-22 11:38:44 +02:00
|
|
|
|
</xsl:call-template>
|
|
|
|
|
</xsl:when>
|
|
|
|
|
<xsl:otherwise>
|
2019-06-15 17:26:23 +02:00
|
|
|
|
<xsl:copy-of select="$instructions"/>
|
2019-04-22 11:38:44 +02:00
|
|
|
|
</xsl:otherwise>
|
|
|
|
|
</xsl:choose>
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
2013-10-29 16:42:03 +01:00
|
|
|
|
</xsl:stylesheet>
|