2006-07-16 12:29:37 +02: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">
|
|
|
|
|
|
|
|
<!-- $Id$ -->
|
|
|
|
|
|
|
|
<!-- XSLT stylesheet to create shell scripts from "linear build" BLFS books. -->
|
|
|
|
|
2006-08-13 13:58:59 +02:00
|
|
|
<!-- Build as user (y) or as root (n)? -->
|
|
|
|
<xsl:param name="sudo" select="y"/>
|
|
|
|
|
2006-07-16 12:29:37 +02:00
|
|
|
<xsl:template match="/">
|
|
|
|
<xsl:apply-templates select="//sect1"/>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<!--=================== Master chunks code ======================-->
|
|
|
|
|
|
|
|
<xsl:template match="sect1">
|
2006-08-15 19:00:43 +02:00
|
|
|
<xsl:if test="(count(descendant::screen/userinput) > 0 and
|
2006-07-16 12:29:37 +02:00
|
|
|
count(descendant::screen/userinput) >
|
2006-08-15 19:00:43 +02:00
|
|
|
count(descendant::screen[@role='nodump'])) and
|
|
|
|
@id != 'locale-issues' and @id != 'xorg7' and
|
|
|
|
@id != 'x-setup'">
|
2006-07-16 12:29:37 +02:00
|
|
|
|
|
|
|
<!-- The file names -->
|
2006-08-24 22:38:22 +02:00
|
|
|
<xsl:variable name="filename" select="@id"/>
|
2006-07-16 12:29:37 +02:00
|
|
|
|
|
|
|
<!-- Package name (use "Download FTP" by default. If empty, use "Download HTTP" -->
|
2007-07-25 22:09:15 +02:00
|
|
|
<xsl:variable name="package">
|
2006-07-16 12:29:37 +02:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when
|
|
|
|
test="string-length(sect2[@role='package']/itemizedlist/listitem[2]/para/ulink/@url)
|
|
|
|
> '10'">
|
|
|
|
<xsl:call-template name="package_name">
|
|
|
|
<xsl:with-param name="url"
|
|
|
|
select="sect2[@role='package']/itemizedlist/listitem[2]/para/ulink/@url"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:call-template name="package_name">
|
|
|
|
<xsl:with-param name="url"
|
|
|
|
select="sect2[@role='package']/itemizedlist/listitem[1]/para/ulink/@url"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2007-07-25 22:09:15 +02:00
|
|
|
</xsl:variable>
|
2006-07-16 12:29:37 +02:00
|
|
|
|
|
|
|
<!-- FTP dir name -->
|
2007-07-25 22:09:15 +02:00
|
|
|
<xsl:variable name="ftpdir">
|
2006-07-16 12:29:37 +02:00
|
|
|
<xsl:call-template name="ftp_dir">
|
|
|
|
<xsl:with-param name="package" select="$package"/>
|
|
|
|
</xsl:call-template>
|
2007-07-25 22:09:15 +02:00
|
|
|
</xsl:variable>
|
2006-07-16 12:29:37 +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>
|
|
|
|
|
|
|
|
<!-- Depuration code -->
|
|
|
|
<xsl:message>
|
|
|
|
<xsl:text>SCRIPT is </xsl:text>
|
|
|
|
<xsl:value-of select="concat($order,'-',$filename)"/>
|
|
|
|
<xsl:text>
 PACKAGE is </xsl:text>
|
|
|
|
<xsl:value-of select="$package"/>
|
|
|
|
<xsl:text>
 FTPDIR is </xsl:text>
|
|
|
|
<xsl:value-of select="$ftpdir"/>
|
|
|
|
<xsl:text>

</xsl:text>
|
|
|
|
</xsl:message>
|
|
|
|
|
|
|
|
<!-- Creating the scripts -->
|
2006-08-12 16:30:58 +02:00
|
|
|
<exsl:document href="{$order}-z-{$filename}" method="text">
|
2006-11-11 12:39:16 +01:00
|
|
|
<xsl:text>#!/bin/bash
set -e

</xsl:text>
|
2006-07-16 12:29:37 +02:00
|
|
|
<xsl:choose>
|
|
|
|
<!-- Package page -->
|
2006-08-15 19:00:43 +02:00
|
|
|
<xsl:when test="sect2[@role='package'] and not(@id = 'xorg7-app' or
|
|
|
|
@id = 'xorg7-data' or @id = 'xorg7-driver' or
|
|
|
|
@id = 'xorg7-font' or @id = 'xorg7-lib' or
|
|
|
|
@id = 'xorg7-proto' or @id = 'xorg7-util')">
|
2006-07-16 12:29:37 +02:00
|
|
|
<!-- Variables -->
|
|
|
|
<xsl:text>SRC_ARCHIVE=$SRC_ARCHIVE
</xsl:text>
|
|
|
|
<xsl:text>FTP_SERVER=$FTP_SERVER

PACKAGE=</xsl:text>
|
|
|
|
<xsl:value-of select="$package"/>
|
|
|
|
<xsl:text>
PKG_DIR=</xsl:text>
|
|
|
|
<xsl:value-of select="$ftpdir"/>
|
2006-08-14 20:48:48 +02:00
|
|
|
<xsl:text>
SRC_DIR=$SRC_DIR

</xsl:text>
|
2006-07-16 12:29:37 +02:00
|
|
|
<!-- Download code and build commands -->
|
|
|
|
<xsl:apply-templates select="sect2">
|
|
|
|
<xsl:with-param name="package" select="$package"/>
|
|
|
|
<xsl:with-param name="ftpdir" select="$ftpdir"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
<!-- Clean-up -->
|
2007-07-27 00:12:32 +02:00
|
|
|
<xsl:if test="not(@id='mesalib')">
|
|
|
|
<xsl:text>cd $SRC_DIR/$PKG_DIR
</xsl:text>
|
|
|
|
<xsl:text>rm -rf $UNPACKDIR unpacked

</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:if test="@id='xorg7-server'">
|
|
|
|
<xsl:text>cd $SRC_DIR/MesaLib
|
|
|
|
UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
|
|
|
|
rm -rf $UNPACKDIR unpacked

</xsl:text>
|
|
|
|
</xsl:if>
|
2006-07-16 12:29:37 +02:00
|
|
|
</xsl:when>
|
2006-08-15 19:00:43 +02:00
|
|
|
<!-- Xorg7 pseudo-packages -->
|
|
|
|
<xsl:when test="contains(@id,'xorg7') and not(@id = 'xorg7-server')">
|
|
|
|
<xsl:text>SRC_DIR=$SRC_DIR
|
|
|
|
|
|
|
|
cd $SRC_DIR
|
|
|
|
mkdir -p xc
|
|
|
|
cd xc
</xsl:text>
|
|
|
|
<xsl:apply-templates select="sect2" mode="xorg7"/>
|
|
|
|
</xsl:when>
|
2006-07-16 12:29:37 +02:00
|
|
|
<!-- Non-package page -->
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:apply-templates select=".//screen"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<xsl:text>exit</xsl:text>
|
|
|
|
</exsl:document>
|
|
|
|
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<!--======================= Sub-sections code =======================-->
|
|
|
|
|
|
|
|
<xsl:template match="sect2">
|
|
|
|
<xsl:param name="package" select="foo"/>
|
|
|
|
<xsl:param name="ftpdir" select="foo"/>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="@role = 'package'">
|
2006-08-14 20:45:31 +02:00
|
|
|
<xsl:text>mkdir -p $SRC_DIR/$PKG_DIR
</xsl:text>
|
|
|
|
<xsl:text>cd $SRC_DIR/$PKG_DIR
</xsl:text>
|
2006-07-16 12:29:37 +02:00
|
|
|
<xsl:apply-templates select="itemizedlist/listitem/para">
|
|
|
|
<xsl:with-param name="package" select="$package"/>
|
|
|
|
<xsl:with-param name="ftpdir" select="$ftpdir"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="@role = 'installation'">
|
2006-08-12 16:27:36 +02:00
|
|
|
<xsl:text>
|
|
|
|
if [[ -e unpacked ]] ; then
|
|
|
|
UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
|
|
|
|
rm -rf $UNPACKDIR
|
|
|
|
fi
|
|
|
|
tar -xvf $PACKAGE > unpacked
|
|
|
|
UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
|
2006-08-15 16:02:27 +02:00
|
|
|
cd $UNPACKDIR
</xsl:text>
|
2006-07-16 12:29:37 +02:00
|
|
|
<xsl:apply-templates select=".//screen | .//para/command"/>
|
2006-08-15 13:54:36 +02:00
|
|
|
<xsl:if test="$sudo = 'y'">
|
2007-07-06 02:59:01 +02:00
|
|
|
<xsl:text>sudo /sbin/</xsl:text>
|
2006-08-15 13:54:36 +02:00
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>ldconfig

</xsl:text>
|
2006-07-16 12:29:37 +02:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="@role = 'configuration'">
|
|
|
|
<xsl:apply-templates select=".//screen"/>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
2006-08-15 19:00:43 +02:00
|
|
|
<xsl:template match="sect2" mode="xorg7">
|
|
|
|
<xsl:choose>
|
2007-07-26 21:07:03 +02:00
|
|
|
<xsl:when test="@role = 'package'">
|
|
|
|
<xsl:apply-templates select="itemizedlist/listitem/para" mode="xorg7"/>
|
|
|
|
</xsl:when>
|
2006-08-15 19:00:43 +02:00
|
|
|
<xsl:when test="not(@role)">
|
2007-07-27 21:14:48 +02:00
|
|
|
<xsl:text>SRC_ARCHIVE=$SRC_ARCHIVE
|
|
|
|
FTP_SERVER=$FTP_SERVER
</xsl:text>
|
2007-07-26 21:07:03 +02:00
|
|
|
<xsl:apply-templates select=".//screen" mode="sect-ver"/>
|
2007-07-27 21:14:48 +02:00
|
|
|
<xsl:text>mkdir -p ${section}
cd ${section}
</xsl:text>
|
|
|
|
<xsl:apply-templates select="../sect2[@role='package']/itemizedlist/listitem/para" mode="xorg7-patch"/>
|
2007-08-06 20:28:09 +02:00
|
|
|
<xsl:text>for line in $(grep -v '^#' ../${sect_ver}.wget) ; do
|
2007-07-27 21:34:13 +02:00
|
|
|
if [[ ! -f ${line} ]] ; then
|
|
|
|
if [[ -f $SRC_ARCHIVE/Xorg/${section}/${line} ]] ; then
|
|
|
|
cp $SRC_ARCHIVE/Xorg/${section}/${line} ${line}
|
|
|
|
elif [[ -f $SRC_ARCHIVE/Xorg/${line} ]] ; then
|
|
|
|
cp $SRC_ARCHIVE/Xorg/${line} ${line}
|
|
|
|
elif [[ -f $SRC_ARCHIVE/${section}/${line} ]] ; then
|
|
|
|
cp $SRC_ARCHIVE/${section}/${line} ${line}
|
|
|
|
elif [[ -f $SRC_ARCHIVE/${line} ]] ; then
|
|
|
|
cp $SRC_ARCHIVE/${line} ${line}
|
2007-07-27 21:14:48 +02:00
|
|
|
else
|
2007-07-27 21:34:13 +02:00
|
|
|
wget ${FTP_SERVER}conglomeration/Xorg/${line} || \
|
|
|
|
wget http://xorg.freedesktop.org/releases/individual/${section}/${line}
|
2007-07-27 21:14:48 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
2007-08-06 20:28:09 +02:00
|
|
|
md5sum -c ../${sect_ver}.md5
|
|
|
|
cp ../${sect_ver}.wget ../${sect_ver}.wget.orig
|
|
|
|
cp ../${sect_ver}.md5 ../${sect_ver}.md5.orig
</xsl:text>
|
2006-08-15 19:00:43 +02:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="@role = 'installation'">
|
2007-08-06 20:28:09 +02:00
|
|
|
<xsl:text>for package in $(grep -v '^#' ../${sect_ver}.wget) ; do
|
2006-08-15 19:00:43 +02:00
|
|
|
packagedir=$(echo $package | sed 's/.tar.bz2//')
|
2007-07-27 21:34:13 +02:00
|
|
|
tar -xf ${package}
|
|
|
|
cd ${packagedir}
</xsl:text>
|
2006-08-15 19:00:43 +02:00
|
|
|
<xsl:apply-templates select=".//screen | .//para/command"/>
|
2006-08-15 19:23:39 +02:00
|
|
|
<xsl:text> cd ..
|
2007-07-27 21:34:13 +02:00
|
|
|
rm -rf ${packagedir}
|
2007-08-06 20:28:09 +02:00
|
|
|
sed -i "/${package}/d" ../${sect_ver}.wget
|
|
|
|
sed -i "/${package}/d" ../${sect_ver}.md5
|
2007-07-27 21:14:48 +02:00
|
|
|
done
|
2007-08-06 20:28:09 +02:00
|
|
|
mv ../${sect_ver}.wget.orig ../${sect_ver}.wget
|
|
|
|
mv ../${sect_ver}.md5.orig ../${sect_ver}.md5
</xsl:text>
|
2006-08-15 19:00:43 +02:00
|
|
|
<xsl:if test="$sudo = 'y'">
|
2007-07-06 02:59:01 +02:00
|
|
|
<xsl:text>sudo /sbin/</xsl:text>
|
2006-08-15 19:00:43 +02:00
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>ldconfig

</xsl:text>
|
|
|
|
</xsl:when>
|
2007-07-26 21:07:03 +02:00
|
|
|
<xsl:when test="@role = 'configuration'">
|
|
|
|
<xsl:apply-templates select=".//screen"/>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:when>
|
2006-08-15 19:00:43 +02:00
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
2006-07-16 12:29:37 +02:00
|
|
|
<!--==================== Download code =======================-->
|
|
|
|
|
|
|
|
<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:when test="contains($sub-url,'.patch')"/>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$sub-url"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template name="ftp_dir">
|
|
|
|
<xsl:param name="package" select="foo"/>
|
|
|
|
<!-- A lot of hardcoded dir names. Not full revised yet. -->
|
|
|
|
<xsl:choose>
|
|
|
|
<!-- cdparanoia -->
|
|
|
|
<xsl:when test="contains($package, '-III')">
|
|
|
|
<xsl:text>cdparanoia</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- DobBook 3.1 -->
|
|
|
|
<xsl:when test="contains($package, 'docbk31')">
|
|
|
|
<xsl:text>docbk</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- gc -->
|
|
|
|
<xsl:when test="contains($package, 'gc6')">
|
|
|
|
<xsl:text>gc</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- ISO-codes -->
|
|
|
|
<xsl:when test="contains($package, 'iso-codes')">
|
|
|
|
<xsl:text>iso-codes</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- JPEG -->
|
|
|
|
<xsl:when test="contains($package, 'jpegsrc')">
|
|
|
|
<xsl:text>jpeg</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- lynx -->
|
|
|
|
<xsl:when test="contains($package, 'lynx')">
|
|
|
|
<xsl:text>lynx</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- ntp -->
|
|
|
|
<xsl:when test="contains($package, 'ntp')">
|
|
|
|
<xsl:text>ntp</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- OpenLDAP -->
|
|
|
|
<xsl:when test="contains($package, 'openldap')">
|
|
|
|
<xsl:text>openldap</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- Open Office -->
|
|
|
|
<xsl:when test="contains($package, 'OOo')">
|
|
|
|
<xsl:text>OOo</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- pine -->
|
|
|
|
<xsl:when test="contains($package, 'pine')">
|
|
|
|
<xsl:text>pine</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- portmap -->
|
|
|
|
<xsl:when test="contains($package, 'portmap')">
|
|
|
|
<xsl:text>portmap</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- psutils -->
|
|
|
|
<xsl:when test="contains($package, 'psutils')">
|
|
|
|
<xsl:text>psutils</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- qpopper -->
|
|
|
|
<xsl:when test="contains($package, 'qpopper')">
|
|
|
|
<xsl:text>qpopper</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- QT -->
|
|
|
|
<xsl:when test="contains($package, 'qt-x')">
|
|
|
|
<xsl:text>qt-x11-free</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- sendmail -->
|
|
|
|
<xsl:when test="contains($package, 'sendmail')">
|
|
|
|
<xsl:text>sendmail</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- Slib -->
|
|
|
|
<xsl:when test="contains($package, 'slib')">
|
|
|
|
<xsl:text>slib</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- TCL -->
|
|
|
|
<xsl:when test="contains($package, 'tcl')">
|
|
|
|
<xsl:text>tcl</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- tcpwrappers -->
|
|
|
|
<xsl:when test="contains($package, 'tcp_wrappers')">
|
|
|
|
<xsl:text>tcp_wrappers</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- TeTeX -->
|
|
|
|
<xsl:when test="contains($package, 'tetex')">
|
|
|
|
<xsl:text>tetex</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- Tidy -->
|
|
|
|
<xsl:when test="contains($package, 'tidy')">
|
|
|
|
<xsl:text>tidy</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- Tk -->
|
|
|
|
<xsl:when test="contains($package, 'tk8')">
|
|
|
|
<xsl:text>tk</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- unzip -->
|
|
|
|
<xsl:when test="contains($package, 'unzip')">
|
|
|
|
<xsl:text>unzip</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- wireless_tools -->
|
|
|
|
<xsl:when test="contains($package, 'wireless_tools')">
|
|
|
|
<xsl:text>wireless_tools</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- whois -->
|
|
|
|
<xsl:when test="contains($package, 'whois')">
|
|
|
|
<xsl:text>whois</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- XOrg -->
|
|
|
|
<xsl:when test="contains($package, 'X11R6')">
|
|
|
|
<xsl:text>Xorg</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- zip -->
|
|
|
|
<xsl:when test="contains($package, 'zip2')">
|
|
|
|
<xsl:text>zip</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- General rule -->
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:variable name="cut"
|
|
|
|
select="translate(substring-after($package, '-'), '0123456789', '0000000000')"/>
|
|
|
|
<xsl:variable name="package2">
|
|
|
|
<xsl:value-of select="substring-before($package, '-')"/>
|
|
|
|
<xsl:text>-</xsl:text>
|
|
|
|
<xsl:value-of select="$cut"/>
|
|
|
|
</xsl:variable>
|
|
|
|
<xsl:value-of select="substring-before($package2, '-0')"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="itemizedlist/listitem/para">
|
|
|
|
<xsl:param name="package" select="foo"/>
|
|
|
|
<xsl:param name="ftpdir" select="foo"/>
|
|
|
|
<xsl:choose>
|
|
|
|
<!-- This depend on all package pages having both "Download HTTP" and "Download FTP" lines -->
|
|
|
|
<xsl:when test="contains(string(),'HTTP')">
|
|
|
|
<xsl:text>if [[ ! -f $PACKAGE ]] ; then
</xsl:text>
|
|
|
|
<!-- SRC_ARCHIVE may have subdirectories or not -->
|
|
|
|
<xsl:text> if [[ -f $SRC_ARCHIVE/$PKG_DIR/$PACKAGE ]] ; then
</xsl:text>
|
|
|
|
<xsl:text> cp $SRC_ARCHIVE/$PKG_DIR/$PACKAGE $PACKAGE
</xsl:text>
|
|
|
|
<xsl:text> elif [[ -f $SRC_ARCHIVE/$PACKAGE ]] ; then
</xsl:text>
|
|
|
|
<xsl:text> cp $SRC_ARCHIVE/$PACKAGE $PACKAGE
 else
</xsl:text>
|
|
|
|
<!-- The FTP_SERVER mirror -->
|
2006-08-12 14:34:01 +02:00
|
|
|
<xsl:text> wget ${FTP_SERVER}conglomeration/$PKG_DIR/$PACKAGE</xsl:text>
|
2006-07-16 12:29:37 +02:00
|
|
|
<!-- Upstream HTTP URL -->
|
2006-12-04 18:47:37 +01:00
|
|
|
<xsl:if test="string-length(ulink/@url) > '10'">
|
2006-07-16 12:29:37 +02:00
|
|
|
<xsl:text> || \
 wget </xsl:text>
|
2006-12-04 18:47:37 +01:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains(ulink/@url,'?')">
|
|
|
|
<xsl:value-of select="substring-before(ulink/@url,'?')"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="ulink/@url"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2006-07-16 12:29:37 +02:00
|
|
|
</xsl:if>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains(string(),'FTP')">
|
|
|
|
<!-- Upstream FTP URL -->
|
|
|
|
<xsl:if test="string-length(ulink/@url) > '10'">
|
|
|
|
<xsl:text> || \
 wget </xsl:text>
|
|
|
|
<xsl:value-of select="ulink/@url"/>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>
 fi
fi
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="contains(string(),'MD5')">
|
|
|
|
<xsl:text>echo "</xsl:text>
|
|
|
|
<xsl:value-of select="substring-after(string(),'sum: ')"/>
|
|
|
|
<xsl:text>  $PACKAGE" | md5sum -c -
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- Patches -->
|
|
|
|
<xsl:when test="contains(string(ulink/@url),'.patch')">
|
|
|
|
<xsl:text>wget </xsl:text>
|
|
|
|
<xsl:value-of select="ulink/@url"/>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
2006-08-15 19:23:39 +02:00
|
|
|
<xsl:template match="itemizedlist/listitem/para" mode="xorg7">
|
2007-07-26 21:07:03 +02:00
|
|
|
<xsl:if test="contains(string(ulink/@url),'.md5') or
|
|
|
|
contains(string(ulink/@url),'.wget')">
|
|
|
|
<xsl:text>wget </xsl:text>
|
|
|
|
<xsl:value-of select="ulink/@url"/>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="itemizedlist/listitem/para" mode="xorg7-patch">
|
2006-08-15 19:23:39 +02:00
|
|
|
<xsl:if test="contains(string(ulink/@url),'.patch')">
|
|
|
|
<xsl:text>wget </xsl:text>
|
|
|
|
<xsl:value-of select="ulink/@url"/>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
2006-07-16 12:29:37 +02:00
|
|
|
<!--======================== Commands code ==========================-->
|
|
|
|
|
|
|
|
<xsl:template match="screen">
|
|
|
|
<xsl:if test="child::* = userinput and not(@role = 'nodump')">
|
2006-08-13 13:58:59 +02:00
|
|
|
<xsl:if test="@role = 'root' and $sudo = 'y'">
|
2006-07-16 12:29:37 +02:00
|
|
|
<xsl:text>sudo sh -c "</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:apply-templates select="userinput"/>
|
2006-08-13 13:58:59 +02:00
|
|
|
<xsl:if test="@role = 'root' and $sudo = 'y'">
|
2006-07-16 12:29:37 +02:00
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
2007-07-26 21:07:03 +02:00
|
|
|
<xsl:template match="screen" mode="sect-ver">
|
2007-07-27 21:14:48 +02:00
|
|
|
<xsl:text>section=</xsl:text>
|
|
|
|
<xsl:value-of select="substring-before(substring-after(string(),'mkdir '),' &')"/>
|
2007-08-06 20:28:09 +02:00
|
|
|
<xsl:text>
sect_ver=</xsl:text>
|
2007-07-26 21:07:03 +02:00
|
|
|
<xsl:value-of select="substring-before(substring-after(string(),'-c ../'),'.md5')"/>
|
|
|
|
<xsl:text>
</xsl:text>
|
2006-08-15 19:00:43 +02:00
|
|
|
</xsl:template>
|
|
|
|
|
2006-07-16 12:29:37 +02:00
|
|
|
<xsl:template match="para/command">
|
|
|
|
<xsl:if test="(contains(string(),'test') or
|
|
|
|
contains(string(),'check'))">
|
|
|
|
<xsl:text>#</xsl:text>
|
|
|
|
<xsl:value-of select="substring-before(string(),'make')"/>
|
|
|
|
<xsl:text>make -k</xsl:text>
|
|
|
|
<xsl:value-of select="substring-after(string(),'make')"/>
|
|
|
|
<xsl:text> || true
</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="userinput">
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="replaceable">
|
2007-07-27 00:12:32 +02:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="ancestor::sect1[@id='xorg7-server']">
|
|
|
|
<xsl:text>$SRC_DIR/MesaLib</xsl:text>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:text>**EDITME</xsl:text>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
<xsl:text>EDITME**</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2006-07-16 12:29:37 +02:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
</xsl:stylesheet>
|