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