[7072e1f] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[db181c47] | 2 |
|
---|
[877cc6a] | 3 | <!-- $Id$ -->
|
---|
| 4 |
|
---|
[7072e1f] | 5 | <xsl:stylesheet
|
---|
| 6 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 7 | xmlns:exsl="http://exslt.org/common"
|
---|
| 8 | extension-element-prefixes="exsl"
|
---|
| 9 | version="1.0">
|
---|
[557fe91] | 10 |
|
---|
[7072e1f] | 11 | <!-- use package management ?
|
---|
| 12 | n = no, original behavior
|
---|
| 13 | y = yes, add PKG_DEST to scripts in install commands of chapter06-08
|
---|
| 14 | -->
|
---|
| 15 | <xsl:param name="pkgmngt" select="n"/>
|
---|
| 16 |
|
---|
[31d6944] | 17 | <!-- Run test suites?
|
---|
| 18 | 0 = none
|
---|
| 19 | 1 = only chapter06 Glibc, GCC and Binutils testsuites
|
---|
| 20 | 2 = all chapter06 testsuites
|
---|
[28f4756] | 21 | 3 = all chapter05 and chapter06 testsuites
|
---|
| 22 | -->
|
---|
[31d6944] | 23 | <xsl:param name="testsuite" select="1"/>
|
---|
[01e51a1] | 24 |
|
---|
[28f4756] | 25 | <!-- Bomb on test suites failures?
|
---|
[401f81e] | 26 | n = no, I want to build the full system and review the logs
|
---|
| 27 | y = yes, bomb at the first test suite failure to can review the build dir
|
---|
[28f4756] | 28 | -->
|
---|
[401f81e] | 29 | <xsl:param name="bomb-testsuite" select="n"/>
|
---|
[28f4756] | 30 |
|
---|
[7072e1f] | 31 | <!-- Install vim-lang package? OBSOLETE should always be 'n'-->
|
---|
| 32 | <xsl:param name="vim-lang" select="n"/>
|
---|
| 33 |
|
---|
[877cc6a] | 34 | <!-- Time zone -->
|
---|
[a229600] | 35 | <xsl:param name="timezone" select="GMT"/>
|
---|
[7072e1f] | 36 |
|
---|
[877cc6a] | 37 | <!-- Page size -->
|
---|
| 38 | <xsl:param name="page" select="letter"/>
|
---|
[7072e1f] | 39 |
|
---|
[877cc6a] | 40 | <!-- Locale settings -->
|
---|
[a229600] | 41 | <xsl:param name="lang" select="C"/>
|
---|
[b339c94] | 42 |
|
---|
| 43 | <!-- Install the whole set of locales -->
|
---|
| 44 | <xsl:param name='full-locale' select='n'/>
|
---|
[7072e1f] | 45 |
|
---|
[557fe91] | 46 | <xsl:template match="/">
|
---|
| 47 | <xsl:apply-templates select="//sect1"/>
|
---|
| 48 | </xsl:template>
|
---|
[7072e1f] | 49 |
|
---|
[557fe91] | 50 | <xsl:template match="sect1">
|
---|
[7072e1f] | 51 | <xsl:if test="(../@id='chapter-temporary-tools' or
|
---|
[14eaa9f] | 52 | ../@id='chapter-building-system' or
|
---|
| 53 | ../@id='chapter-bootscripts' or
|
---|
| 54 | ../@id='chapter-bootable') and
|
---|
| 55 | count(descendant::screen/userinput) > 0 and
|
---|
| 56 | count(descendant::screen/userinput) >
|
---|
[7072e1f] | 57 | count(descendant::screen[@role='nodump'])">
|
---|
[c4cf6de] | 58 | <!-- The dirs names -->
|
---|
| 59 | <xsl:variable name="pi-dir" select="../processing-instruction('dbhtml')"/>
|
---|
| 60 | <xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/>
|
---|
| 61 | <xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/>
|
---|
| 62 | <xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/>
|
---|
[7072e1f] | 63 | <!-- The file names -->
|
---|
| 64 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
| 65 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
| 66 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
| 67 | <!-- The build order -->
|
---|
| 68 | <xsl:variable name="position" select="position()"/>
|
---|
| 69 | <xsl:variable name="order">
|
---|
| 70 | <xsl:choose>
|
---|
| 71 | <xsl:when test="string-length($position) = 1">
|
---|
| 72 | <xsl:text>00</xsl:text>
|
---|
| 73 | <xsl:value-of select="$position"/>
|
---|
| 74 | </xsl:when>
|
---|
| 75 | <xsl:when test="string-length($position) = 2">
|
---|
| 76 | <xsl:text>0</xsl:text>
|
---|
| 77 | <xsl:value-of select="$position"/>
|
---|
| 78 | </xsl:when>
|
---|
| 79 | <xsl:otherwise>
|
---|
| 80 | <xsl:value-of select="$position"/>
|
---|
| 81 | </xsl:otherwise>
|
---|
| 82 | </xsl:choose>
|
---|
| 83 | </xsl:variable>
|
---|
| 84 | <!-- Inclusion of package manager scriptlets -->
|
---|
| 85 | <xsl:if test="@id='ch-tools-stripping' and $pkgmngt='y'">
|
---|
| 86 | <xsl:apply-templates
|
---|
[575bcf3] | 87 | select="document('packageManager.xml')//sect1[contains(@id,'ch-tools')]"
|
---|
[7072e1f] | 88 | mode="pkgmngt">
|
---|
[575bcf3] | 89 | <xsl:with-param name="order" select="$order"/>
|
---|
[7072e1f] | 90 | <xsl:with-param name="dirname" select="$dirname"/>
|
---|
| 91 | </xsl:apply-templates>
|
---|
| 92 | </xsl:if>
|
---|
| 93 | <xsl:if test="@id='ch-system-strippingagain' and $pkgmngt='y'">
|
---|
| 94 | <xsl:apply-templates
|
---|
[575bcf3] | 95 | select="document('packageManager.xml')//sect1[contains(@id,'ch-system')]"
|
---|
[7072e1f] | 96 | mode="pkgmngt">
|
---|
[575bcf3] | 97 | <xsl:with-param name="order" select="$order"/>
|
---|
[7072e1f] | 98 | <xsl:with-param name="dirname" select="$dirname"/>
|
---|
| 99 | </xsl:apply-templates>
|
---|
| 100 | </xsl:if>
|
---|
| 101 | <!-- Creating dirs and files -->
|
---|
| 102 | <exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
|
---|
| 103 | <xsl:choose>
|
---|
| 104 | <xsl:when test="@id='ch-system-creatingdirs' or
|
---|
| 105 | @id='ch-system-createfiles' or
|
---|
| 106 | @id='ch-system-strippingagain'">
|
---|
| 107 | <xsl:text>#!/tools/bin/bash
set +h
</xsl:text>
|
---|
| 108 | </xsl:when>
|
---|
| 109 | <xsl:otherwise>
|
---|
| 110 | <xsl:text>#!/bin/bash
set +h
</xsl:text>
|
---|
| 111 | </xsl:otherwise>
|
---|
| 112 | </xsl:choose>
|
---|
| 113 | <xsl:if test="not(@id='ch-tools-stripping') and
|
---|
| 114 | not(@id='ch-system-strippingagain')">
|
---|
| 115 | <xsl:text>set -e
</xsl:text>
|
---|
| 116 | </xsl:if>
|
---|
| 117 | <xsl:text>
</xsl:text>
|
---|
| 118 | <xsl:if test="sect2[@role='installation']">
|
---|
| 119 | <xsl:text>cd $PKGDIR
</xsl:text>
|
---|
| 120 | </xsl:if>
|
---|
[76f8888] | 121 | <xsl:apply-templates select="sect2|
|
---|
| 122 | screen[not(@role) or
|
---|
| 123 | @role!='nodump']/userinput"/>
|
---|
| 124 | <xsl:if test="@id='ch-system-creatingdirs'">
|
---|
| 125 | <xsl:apply-templates
|
---|
| 126 | select="document('packageManager.xml')//sect1[
|
---|
| 127 | @id='ch-pkgmngt-creatingdirs'
|
---|
| 128 | ]//userinput"/>
|
---|
| 129 | </xsl:if>
|
---|
| 130 | <xsl:if test="@id='ch-system-createfiles'">
|
---|
| 131 | <xsl:apply-templates
|
---|
| 132 | select="document('packageManager.xml')//sect1[
|
---|
| 133 | @id='ch-pkgmngt-createfiles'
|
---|
| 134 | ]//userinput"/>
|
---|
| 135 | </xsl:if>
|
---|
| 136 | <xsl:if test="not(@id='ch-system-chroot') and
|
---|
| 137 | not(@id='ch-system-revisedchroot')">
|
---|
| 138 | <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"
</xsl:text>
|
---|
| 139 | </xsl:if>
|
---|
| 140 | <xsl:text>exit
</xsl:text>
|
---|
| 141 | </exsl:document>
|
---|
| 142 | </xsl:if>
|
---|
| 143 | </xsl:template>
|
---|
| 144 |
|
---|
| 145 | <xsl:template match="sect2">
|
---|
[2629bf2] | 146 | <!--XML::Parser is on the same page as Perl. The present code is OK
|
---|
| 147 | except for PKG_DEST and PKGDIR, which would be the same as for Perl.
|
---|
| 148 | so set them to valid values.-->
|
---|
| 149 | <xsl:if test="contains(string(./title),'XML::Parser')">
|
---|
| 150 | <xsl:text>PKGDIR=$(dirname $PKGDIR)/</xsl:text>
|
---|
| 151 | <xsl:copy-of select="substring-after(.//userinput[@remap='pre'], 'cd ')"/>
|
---|
| 152 | <xsl:text>
|
---|
| 153 | PKG_DEST=$(dirname $PKGDIR)/000-xml-parser
|
---|
| 154 | </xsl:text>
|
---|
| 155 | </xsl:if>
|
---|
[76f8888] | 156 | <xsl:apply-templates
|
---|
| 157 | select=".//screen[not(@role) or
|
---|
| 158 | @role != 'nodump']/userinput[
|
---|
| 159 | @remap = 'pre' or
|
---|
| 160 | @remap = 'configure' or
|
---|
| 161 | @remap = 'make' or
|
---|
| 162 | @remap = 'test' and
|
---|
| 163 | not(current()/../@id='ch-tools-dejagnu')]"/>
|
---|
| 164 | <xsl:if
|
---|
| 165 | test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
|
---|
| 166 | $pkgmngt = 'y' and
|
---|
| 167 | descendant::screen[not(@role) or
|
---|
| 168 | @role != 'nodump']/userinput[
|
---|
| 169 | @remap='install']">
|
---|
| 170 | <xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin}
|
---|
[7072e1f] | 171 | mkdir -pv $PKG_DEST/usr/{lib,bin,sbin,include}
|
---|
| 172 | mkdir -pv $PKG_DEST/usr/share/{doc,info,man}
|
---|
| 173 | mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
|
---|
| 174 | ln -sv share/{man,doc,info} $PKG_DEST/usr
|
---|
| 175 | case $(uname -m) in
|
---|
| 176 | x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
|
---|
| 177 | esac
|
---|
| 178 | </xsl:text>
|
---|
[76f8888] | 179 | </xsl:if>
|
---|
| 180 | <xsl:if test="../@id = 'ch-system-glibc' and
|
---|
[930b742] | 181 | @role='installation' and
|
---|
| 182 | $pkgmngt = 'y'">
|
---|
[76f8888] | 183 | <xsl:text>mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc}
|
---|
[7072e1f] | 184 | </xsl:text>
|
---|
[76f8888] | 185 | </xsl:if>
|
---|
| 186 | <xsl:apply-templates
|
---|
| 187 | select=".//screen[not(@role) or
|
---|
| 188 | @role != 'nodump']/userinput[@remap = 'install']"/>
|
---|
| 189 | <xsl:if test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
|
---|
| 190 | $pkgmngt = 'y' and
|
---|
| 191 | descendant::screen[not(@role) or
|
---|
| 192 | @role != 'nodump']/userinput[
|
---|
| 193 | @remap='install']">
|
---|
| 194 | <xsl:if test="../@id = 'ch-system-man-pages'">
|
---|
[cbd0493] | 195 | <!-- these files are provided by the shadow package -->
|
---|
[7072e1f] | 196 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}
|
---|
[cbd0493] | 197 | </xsl:text>
|
---|
| 198 | </xsl:if>
|
---|
| 199 | <!-- Attr man/man2 pages are already installed by man-pages. As of
|
---|
| 200 | March 2013, they are the same pages. Check it sometimes... -->
|
---|
| 201 | <xsl:if test="../@id = 'ch-system-attr'">
|
---|
| 202 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/man2/*
|
---|
[7072e1f] | 203 | </xsl:text>
|
---|
[76f8888] | 204 | </xsl:if>
|
---|
| 205 | <xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
|
---|
[7072e1f] | 206 | rm -fv $PKG_DEST/usr/{man,doc,info}
|
---|
| 207 | for dir in $PKG_DEST/usr/share/man/man{1..8}; do
|
---|
| 208 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 209 | done
|
---|
| 210 | for dir in $PKG_DEST/usr/share/{doc,info,man}; do
|
---|
| 211 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 212 | done
|
---|
| 213 | for dir in $PKG_DEST/usr/{lib,bin,sbin,include}; do
|
---|
| 214 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 215 | done
|
---|
| 216 | for dir in $PKG_DEST/{boot,etc,lib,bin,sbin}; do
|
---|
| 217 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 218 | done
|
---|
| 219 | packInstall
|
---|
| 220 | rm -rf $PKG_DEST
|
---|
| 221 | </xsl:text>
|
---|
[76f8888] | 222 | </xsl:if>
|
---|
| 223 | <xsl:if test="$testsuite='3' and
|
---|
| 224 | ../@id='ch-tools-glibc' and
|
---|
| 225 | @role='installation'">
|
---|
| 226 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
| 227 | <xsl:text>
</xsl:text>
|
---|
| 228 | </xsl:if>
|
---|
| 229 | <xsl:if test="../@id='ch-system-glibc' and @role='installation'">
|
---|
| 230 | <xsl:choose>
|
---|
| 231 | <xsl:when test="$full-locale='y'">
|
---|
| 232 | <xsl:copy-of select="//userinput[@remap='locale-full']"/>
|
---|
| 233 | <xsl:text>
</xsl:text>
|
---|
| 234 | </xsl:when>
|
---|
| 235 | <xsl:otherwise>
|
---|
| 236 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
| 237 | <xsl:text>
</xsl:text>
|
---|
| 238 | <xsl:if test="not(contains(string(//userinput[@remap='locale-test']),$lang)) and $lang!='C' and $lang!='POSIX'">
|
---|
| 239 | <xsl:text>if LOCALE=`grep "</xsl:text>
|
---|
| 240 | <xsl:value-of select="$lang"/>
|
---|
| 241 | <xsl:text>/" $PKGDIR/localedata/SUPPORTED`; then
|
---|
[b339c94] | 242 | CHARMAP=`echo $LOCALE | sed 's,[^/]*/\([^ ]*\) [\],\1,'`
|
---|
| 243 | INPUT=`echo $LOCALE | sed 's,[/.].*,,'`
|
---|
| 244 | LOCALE=`echo $LOCALE | sed 's,/.*,,'`
|
---|
| 245 | localedef -i $INPUT -f $CHARMAP $LOCALE
|
---|
| 246 | fi
|
---|
| 247 | </xsl:text>
|
---|
[76f8888] | 248 | </xsl:if>
|
---|
| 249 | </xsl:otherwise>
|
---|
| 250 | </xsl:choose>
|
---|
[c4cf6de] | 251 | </xsl:if>
|
---|
[76f8888] | 252 | <xsl:apply-templates
|
---|
| 253 | select=".//screen[
|
---|
| 254 | not(@role) or
|
---|
| 255 | @role != 'nodump'
|
---|
| 256 | ]/userinput[
|
---|
| 257 | not(@remap) or
|
---|
| 258 | @remap='adjust' or
|
---|
| 259 | @remap='test' and current()/../@id='ch-tools-dejagnu'
|
---|
| 260 | ]"/>
|
---|
[557fe91] | 261 | </xsl:template>
|
---|
| 262 |
|
---|
[7e51281] | 263 | <xsl:template match="sect1" mode="pkgmngt">
|
---|
[7072e1f] | 264 | <xsl:param name="dirname" select="chapter05"/>
|
---|
| 265 | <!-- The build order -->
|
---|
[575bcf3] | 266 | <xsl:param name="order" select="062"/>
|
---|
[7072e1f] | 267 | <!-- The file names -->
|
---|
| 268 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
| 269 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
| 270 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
| 271 | <!-- Creating dirs and files -->
|
---|
[7e51281] | 272 | <xsl:if test="count(descendant::screen/userinput) > 0 and
|
---|
| 273 | count(descendant::screen/userinput) >
|
---|
| 274 | count(descendant::screen[@role='nodump'])">
|
---|
| 275 | <exsl:document href="{$dirname}/{$order}-{position()}-{$filename}"
|
---|
| 276 | method="text">
|
---|
| 277 | <xsl:text>#!/bin/bash
|
---|
[7072e1f] | 278 | set +h
|
---|
| 279 | set -e
|
---|
| 280 |
|
---|
| 281 | cd $PKGDIR
|
---|
| 282 | </xsl:text>
|
---|
[7e51281] | 283 | <xsl:apply-templates
|
---|
| 284 | select=".//screen[not(@role) or
|
---|
| 285 | @role != 'nodump']/userinput[@remap != 'adjust']"
|
---|
[7072e1f] | 286 | mode="pkgmngt"/>
|
---|
[7e51281] | 287 | <xsl:if test="$dirname = 'chapter06'">
|
---|
| 288 | <xsl:text>packInstall
|
---|
[7072e1f] | 289 | rm -rf $PKG_DEST
|
---|
| 290 | </xsl:text>
|
---|
[7e51281] | 291 | </xsl:if>
|
---|
| 292 | <xsl:apply-templates
|
---|
| 293 | select=".//screen[not(@role) or
|
---|
| 294 | @role != 'nodump'
|
---|
| 295 | ]/userinput[not(@remap) or
|
---|
| 296 | @remap='adjust'
|
---|
[7072e1f] | 297 | ]"
|
---|
| 298 | mode="pkgmngt"/>
|
---|
[7e51281] | 299 | <xsl:text>
|
---|
[7072e1f] | 300 | echo -e "\n\nTotalseconds: $SECONDS\n"
|
---|
| 301 | exit
|
---|
| 302 | </xsl:text>
|
---|
[7e51281] | 303 | </exsl:document>
|
---|
| 304 | </xsl:if>
|
---|
[557fe91] | 305 | </xsl:template>
|
---|
| 306 |
|
---|
[7072e1f] | 307 | <xsl:template match="userinput" mode="pkgmngt">
|
---|
| 308 | <xsl:apply-templates/>
|
---|
| 309 | <xsl:text>
</xsl:text>
|
---|
| 310 | </xsl:template>
|
---|
| 311 |
|
---|
| 312 | <xsl:template match="userinput">
|
---|
[3eb60fa] | 313 | <xsl:choose>
|
---|
[fd691b4] | 314 | <!-- Copying the kernel config file -->
|
---|
| 315 | <xsl:when test="string() = 'make mrproper'">
|
---|
| 316 | <xsl:text>make mrproper
</xsl:text>
|
---|
[7072e1f] | 317 | <xsl:if test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
[bcfb3bf] | 318 | <xsl:text>cp -v ../kernel-config .config
</xsl:text>
|
---|
| 319 | </xsl:if>
|
---|
[92568bf] | 320 | </xsl:when>
|
---|
[7072e1f] | 321 | <!-- test instructions -->
|
---|
| 322 | <xsl:when test="@remap = 'test'">
|
---|
[4afcedb] | 323 | <xsl:choose>
|
---|
| 324 | <xsl:when test="$testsuite = '0'"/>
|
---|
| 325 | <xsl:when test="$testsuite = '1' and
|
---|
| 326 | not(ancestor::sect1[@id='ch-system-gcc']) and
|
---|
| 327 | not(ancestor::sect1[@id='ch-system-glibc']) and
|
---|
[7072e1f] | 328 | not(ancestor::sect1[@id='ch-system-gmp']) and
|
---|
| 329 | not(ancestor::sect1[@id='ch-system-mpfr']) and
|
---|
[4afcedb] | 330 | not(ancestor::sect1[@id='ch-system-binutils'])"/>
|
---|
| 331 | <xsl:when test="$testsuite = '2' and
|
---|
| 332 | ancestor::chapter[@id='chapter-temporary-tools']"/>
|
---|
| 333 | <xsl:otherwise>
|
---|
| 334 | <xsl:choose>
|
---|
| 335 | <xsl:when test="$bomb-testsuite = 'n'">
|
---|
[7072e1f] | 336 | <xsl:choose>
|
---|
| 337 | <!-- special case for glibc -->
|
---|
| 338 | <xsl:when test="contains(string(), 'glibc-check-log')">
|
---|
| 339 | <xsl:value-of
|
---|
| 340 | select="substring-before(string(),'2>&1')"/>
|
---|
| 341 | <xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 342 | </xsl:when>
|
---|
[960099f] | 343 | <!-- special case for procps-ng -->
|
---|
| 344 | <xsl:when test="contains(string(), 'pushd')">
|
---|
| 345 | <xsl:text>{ </xsl:text>
|
---|
| 346 | <xsl:apply-templates/>
|
---|
| 347 | <xsl:text>; } >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 348 | </xsl:when>
|
---|
[7072e1f] | 349 | <xsl:when test="contains(string(), 'make -k')">
|
---|
| 350 | <xsl:apply-templates/>
|
---|
| 351 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 352 | </xsl:when>
|
---|
| 353 | <xsl:when test="contains(string(), 'make')">
|
---|
| 354 | <xsl:value-of select="substring-before(string(),'make')"/>
|
---|
| 355 | <xsl:text>make -k</xsl:text>
|
---|
| 356 | <xsl:value-of select="substring-after(string(),'make')"/>
|
---|
| 357 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 358 | </xsl:when>
|
---|
| 359 | <xsl:otherwise>
|
---|
| 360 | <xsl:apply-templates/>
|
---|
| 361 | <xsl:if test="not(contains(string(), '>>'))">
|
---|
| 362 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
| 363 | </xsl:if>
|
---|
| 364 | <xsl:text>
</xsl:text>
|
---|
| 365 | </xsl:otherwise>
|
---|
| 366 | </xsl:choose>
|
---|
[4afcedb] | 367 | </xsl:when>
|
---|
| 368 | <xsl:otherwise>
|
---|
[7072e1f] | 369 | <!-- bomb-testsuite != 'n'-->
|
---|
| 370 | <xsl:choose>
|
---|
| 371 | <!-- special case for glibc -->
|
---|
| 372 | <xsl:when test="contains(string(), 'glibc-check-log')">
|
---|
| 373 | <xsl:value-of
|
---|
| 374 | select="substring-before(string(),'2>&1')"/>
|
---|
[2c9a16b] | 375 | <xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
[7072e1f] | 376 | </xsl:when>
|
---|
[960099f] | 377 | <!-- special case for gmp -->
|
---|
[f663589] | 378 | <xsl:when test="contains(string(), 'tee gmp-check-log')">
|
---|
| 379 | <xsl:text>(</xsl:text>
|
---|
| 380 | <xsl:apply-templates/>
|
---|
| 381 | <xsl:text>>> $TEST_LOG 2>&1 && exit $PIPESTATUS)
</xsl:text>
|
---|
| 382 | </xsl:when>
|
---|
[960099f] | 383 | <!-- special case for procps-ng -->
|
---|
| 384 | <xsl:when test="contains(string(), 'pushd')">
|
---|
| 385 | <xsl:text>{ </xsl:text>
|
---|
| 386 | <xsl:apply-templates/>
|
---|
| 387 | <xsl:text>; } >> $TEST_LOG 2>&1
</xsl:text>
|
---|
| 388 | </xsl:when>
|
---|
[2c9a16b] | 389 | <xsl:when test="contains(string(), 'make -k')">
|
---|
| 390 | <xsl:apply-templates/>
|
---|
| 391 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 392 | </xsl:when>
|
---|
[7072e1f] | 393 | <xsl:otherwise>
|
---|
| 394 | <xsl:apply-templates/>
|
---|
| 395 | <xsl:if test="not(contains(string(), '>>'))">
|
---|
| 396 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
| 397 | </xsl:if>
|
---|
| 398 | <xsl:text>
</xsl:text>
|
---|
| 399 | </xsl:otherwise>
|
---|
| 400 | </xsl:choose>
|
---|
[4afcedb] | 401 | </xsl:otherwise>
|
---|
| 402 | </xsl:choose>
|
---|
| 403 | </xsl:otherwise>
|
---|
| 404 | </xsl:choose>
|
---|
| 405 | </xsl:when>
|
---|
[7072e1f] | 406 | <!-- End of test instructions -->
|
---|
[fd691b4] | 407 | <!-- Don't stop on strip run -->
|
---|
| 408 | <xsl:when test="contains(string(),'strip ')">
|
---|
[3eb60fa] | 409 | <xsl:apply-templates/>
|
---|
[fd691b4] | 410 | <xsl:text> || true
</xsl:text>
|
---|
[1f025ca] | 411 | </xsl:when>
|
---|
[7072e1f] | 412 | <!-- Package management -->
|
---|
| 413 | <!-- Add $PKG_DEST to installation commands -->
|
---|
| 414 | <xsl:when test="@remap='install' and
|
---|
| 415 | not(ancestor::chapter[
|
---|
| 416 | @id='chapter-temporary-tools'
|
---|
| 417 | ])">
|
---|
| 418 | <xsl:choose>
|
---|
| 419 | <xsl:when test="$pkgmngt='n'">
|
---|
| 420 | <xsl:choose>
|
---|
| 421 | <xsl:when test="contains(string(),'firmware,udev')">
|
---|
| 422 | <xsl:text>if [[ ! -d /lib/udev/devices ]] ; then
</xsl:text>
|
---|
| 423 | <xsl:apply-templates/>
|
---|
| 424 | <xsl:text>
fi
</xsl:text>
|
---|
| 425 | </xsl:when>
|
---|
| 426 | <xsl:otherwise>
|
---|
| 427 | <xsl:apply-templates/>
|
---|
| 428 | <xsl:text>
</xsl:text>
|
---|
| 429 | </xsl:otherwise>
|
---|
| 430 | </xsl:choose>
|
---|
| 431 | </xsl:when>
|
---|
| 432 | <xsl:otherwise><!--pkgmngt = 'y'-->
|
---|
| 433 | <xsl:choose>
|
---|
| 434 | <xsl:when test="./literal">
|
---|
| 435 | <xsl:call-template name="outputpkgdest">
|
---|
[cbd0493] | 436 | <xsl:with-param name="outputstring" select="text()[1]"/>
|
---|
[7072e1f] | 437 | </xsl:call-template>
|
---|
| 438 | <xsl:apply-templates select="literal"/>
|
---|
| 439 | <xsl:call-template name="outputpkgdest">
|
---|
[cbd0493] | 440 | <xsl:with-param name="outputstring" select="text()[2]"/>
|
---|
[7072e1f] | 441 | </xsl:call-template>
|
---|
| 442 | </xsl:when>
|
---|
| 443 | <xsl:otherwise>
|
---|
| 444 | <xsl:call-template name="outputpkgdest">
|
---|
| 445 | <xsl:with-param name="outputstring" select="string()"/>
|
---|
| 446 | </xsl:call-template>
|
---|
| 447 | </xsl:otherwise>
|
---|
| 448 | </xsl:choose>
|
---|
| 449 | </xsl:otherwise>
|
---|
| 450 | </xsl:choose>
|
---|
| 451 | </xsl:when>
|
---|
| 452 | <!-- End addition for package management -->
|
---|
[fd691b4] | 453 | <!-- The rest of commands -->
|
---|
[1f025ca] | 454 | <xsl:otherwise>
|
---|
| 455 | <xsl:apply-templates/>
|
---|
[fd691b4] | 456 | <xsl:text>
</xsl:text>
|
---|
[1f025ca] | 457 | </xsl:otherwise>
|
---|
| 458 | </xsl:choose>
|
---|
| 459 | </xsl:template>
|
---|
[7072e1f] | 460 |
|
---|
[557fe91] | 461 | <xsl:template match="replaceable">
|
---|
[a41ce58] | 462 | <xsl:choose>
|
---|
[2a54650] | 463 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
[877cc6a] | 464 | <xsl:value-of select="$timezone"/>
|
---|
[2a54650] | 465 | </xsl:when>
|
---|
[a41ce58] | 466 | <xsl:when test="ancestor::sect1[@id='ch-system-groff']">
|
---|
[877cc6a] | 467 | <xsl:value-of select="$page"/>
|
---|
[a41ce58] | 468 | </xsl:when>
|
---|
[81a7fb8] | 469 | <xsl:when test="contains(string(.),'<ll>_<CC>')">
|
---|
| 470 | <xsl:value-of select="$lang"/>
|
---|
| 471 | </xsl:when>
|
---|
[a41ce58] | 472 | <xsl:otherwise>
|
---|
| 473 | <xsl:text>**EDITME</xsl:text>
|
---|
| 474 | <xsl:apply-templates/>
|
---|
| 475 | <xsl:text>EDITME**</xsl:text>
|
---|
| 476 | </xsl:otherwise>
|
---|
| 477 | </xsl:choose>
|
---|
[557fe91] | 478 | </xsl:template>
|
---|
[7072e1f] | 479 |
|
---|
| 480 | <xsl:template name="outputpkgdest">
|
---|
| 481 | <xsl:param name="outputstring" select="foo"/>
|
---|
| 482 | <xsl:choose>
|
---|
| 483 | <xsl:when test="contains($outputstring,'make ')">
|
---|
| 484 | <xsl:choose>
|
---|
| 485 | <xsl:when test="not(starts-with($outputstring,'make'))">
|
---|
| 486 | <xsl:call-template name="outputpkgdest">
|
---|
| 487 | <xsl:with-param name="outputstring"
|
---|
| 488 | select="substring-before($outputstring,'make')"/>
|
---|
| 489 | </xsl:call-template>
|
---|
| 490 | <xsl:call-template name="outputpkgdest">
|
---|
| 491 | <xsl:with-param
|
---|
| 492 | name="outputstring"
|
---|
| 493 | select="substring-after($outputstring,
|
---|
| 494 | substring-before($outputstring,'make'))"/>
|
---|
| 495 | </xsl:call-template>
|
---|
| 496 | </xsl:when>
|
---|
| 497 | <xsl:otherwise>
|
---|
| 498 | <xsl:choose>
|
---|
| 499 | <!-- special cases (no DESTDIR) here -->
|
---|
| 500 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
| 501 | <xsl:text>make install_root=$PKG_DEST -j1</xsl:text>
|
---|
| 502 | <xsl:value-of
|
---|
| 503 | select="substring-before(substring-after(string(),'make'),
|
---|
| 504 | 'install')"/>
|
---|
| 505 | <xsl:text>install
</xsl:text>
|
---|
| 506 | </xsl:when>
|
---|
| 507 | <xsl:when test="ancestor::sect1[@id='ch-system-bzip2']">
|
---|
| 508 | <xsl:text>make PREFIX=$PKG_DEST/usr install
</xsl:text>
|
---|
| 509 | </xsl:when>
|
---|
| 510 | <xsl:when test="ancestor::sect1[@id='ch-system-sysklogd']">
|
---|
| 511 | <xsl:text>make BINDIR=$PKG_DEST/sbin prefix=$PKG_DEST install
</xsl:text>
|
---|
| 512 | </xsl:when>
|
---|
| 513 | <xsl:when test="ancestor::sect1[@id='ch-system-iproute2']">
|
---|
| 514 | <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
|
---|
| 515 | <xsl:value-of
|
---|
| 516 | select="substring-before(substring-after(string(),'DESTDIR='),
|
---|
| 517 | 'install')"/>
|
---|
| 518 | <xsl:text>install
</xsl:text>
|
---|
| 519 | </xsl:when>
|
---|
| 520 | <xsl:when test="ancestor::sect1[@id='ch-system-sysvinit']">
|
---|
| 521 | <xsl:text>make ROOT=$PKG_DEST</xsl:text>
|
---|
| 522 | <xsl:value-of
|
---|
| 523 | select="substring-before(substring-after(string(),'make'),
|
---|
| 524 | 'install')"/>
|
---|
| 525 | <xsl:text>install
</xsl:text>
|
---|
| 526 | </xsl:when>
|
---|
| 527 | <xsl:when test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
| 528 | <xsl:text>make INSTALL_MOD_PATH=$PKG_DEST</xsl:text>
|
---|
| 529 | <xsl:value-of
|
---|
| 530 | select="substring-before(substring-after(string(),'make'),
|
---|
| 531 | 'install')"/>
|
---|
| 532 | <xsl:text>install
</xsl:text>
|
---|
| 533 | </xsl:when>
|
---|
[cbd0493] | 534 | <xsl:when test="ancestor::sect1[@id='ch-system-attr']">
|
---|
| 535 | <xsl:text>DIST_ROOT=$PKG_DEST make</xsl:text>
|
---|
| 536 | <xsl:call-template name="outputpkgdest">
|
---|
| 537 | <xsl:with-param name="outputstring"
|
---|
| 538 | select="substring-after($outputstring,'make')"/>
|
---|
| 539 | </xsl:call-template>
|
---|
| 540 | </xsl:when>
|
---|
[7072e1f] | 541 | <xsl:otherwise>
|
---|
[cbd0493] | 542 | <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
|
---|
| 543 | <xsl:call-template name="outputpkgdest">>
|
---|
| 544 | <xsl:with-param
|
---|
[7072e1f] | 545 | name="outputstring"
|
---|
| 546 | select="substring-after($outputstring,'make')"/>
|
---|
[cbd0493] | 547 | </xsl:call-template>
|
---|
[7072e1f] | 548 | </xsl:otherwise>
|
---|
| 549 | </xsl:choose>
|
---|
| 550 | </xsl:otherwise>
|
---|
| 551 | </xsl:choose>
|
---|
| 552 | </xsl:when>
|
---|
| 553 | <xsl:otherwise> <!-- no make in this string -->
|
---|
| 554 | <xsl:choose>
|
---|
| 555 | <xsl:when test="contains($outputstring,'>/') and
|
---|
| 556 | not(contains(substring-before($outputstring,'>/'),' /'))">
|
---|
| 557 | <xsl:value-of select="substring-before($outputstring,'>/')"/>
|
---|
| 558 | <xsl:text>>$PKG_DEST/</xsl:text>
|
---|
| 559 | <xsl:call-template name="outputpkgdest">
|
---|
| 560 | <xsl:with-param name="outputstring" select="substring-after($outputstring,'>/')"/>
|
---|
| 561 | </xsl:call-template>
|
---|
| 562 | </xsl:when>
|
---|
| 563 | <xsl:when test="contains($outputstring,' /')">
|
---|
| 564 | <xsl:value-of select="substring-before($outputstring,' /')"/>
|
---|
| 565 | <xsl:text> $PKG_DEST/</xsl:text>
|
---|
| 566 | <xsl:call-template name="outputpkgdest">
|
---|
| 567 | <xsl:with-param name="outputstring" select="substring-after($outputstring,' /')"/>
|
---|
| 568 | </xsl:call-template>
|
---|
| 569 | </xsl:when>
|
---|
| 570 | <xsl:otherwise>
|
---|
| 571 | <xsl:value-of select="$outputstring"/>
|
---|
| 572 | <xsl:text>
</xsl:text>
|
---|
| 573 | </xsl:otherwise>
|
---|
| 574 | </xsl:choose>
|
---|
| 575 | </xsl:otherwise>
|
---|
| 576 | </xsl:choose>
|
---|
| 577 | </xsl:template>
|
---|
[557fe91] | 578 | </xsl:stylesheet>
|
---|