[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 |
|
---|
| 146 |
|
---|
| 147 |
|
---|
| 148 |
|
---|
| 149 |
|
---|
| 150 |
|
---|
| 151 |
|
---|
| 152 |
|
---|
| 153 |
|
---|
| 154 |
|
---|
| 155 |
|
---|
| 156 | <xsl:template match="sect2">
|
---|
| 157 | <xsl:apply-templates
|
---|
| 158 | select=".//screen[not(@role) or
|
---|
| 159 | @role != 'nodump']/userinput[
|
---|
| 160 | @remap = 'pre' or
|
---|
| 161 | @remap = 'configure' or
|
---|
| 162 | @remap = 'make' or
|
---|
| 163 | @remap = 'test' and
|
---|
| 164 | not(current()/../@id='ch-tools-dejagnu')]"/>
|
---|
| 165 | <xsl:if
|
---|
| 166 | test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
|
---|
| 167 | $pkgmngt = 'y' and
|
---|
| 168 | descendant::screen[not(@role) or
|
---|
| 169 | @role != 'nodump']/userinput[
|
---|
| 170 | @remap='install']">
|
---|
| 171 | <xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin}
|
---|
[7072e1f] | 172 | mkdir -pv $PKG_DEST/usr/{lib,bin,sbin,include}
|
---|
| 173 | mkdir -pv $PKG_DEST/usr/share/{doc,info,man}
|
---|
| 174 | mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
|
---|
| 175 | ln -sv share/{man,doc,info} $PKG_DEST/usr
|
---|
| 176 | case $(uname -m) in
|
---|
| 177 | x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
|
---|
| 178 | esac
|
---|
| 179 | </xsl:text>
|
---|
[76f8888] | 180 | </xsl:if>
|
---|
| 181 | <xsl:if test="../@id = 'ch-system-glibc' and
|
---|
| 182 | $pkgmngt = 'y'">
|
---|
| 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'">
|
---|
[7072e1f] | 195 | <!-- those files are provided by the shadow package -->
|
---|
| 196 | <xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}
|
---|
| 197 | </xsl:text>
|
---|
[76f8888] | 198 | </xsl:if>
|
---|
| 199 | <xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
|
---|
[7072e1f] | 200 | rm -fv $PKG_DEST/usr/{man,doc,info}
|
---|
| 201 | for dir in $PKG_DEST/usr/share/man/man{1..8}; do
|
---|
| 202 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 203 | done
|
---|
| 204 | for dir in $PKG_DEST/usr/share/{doc,info,man}; do
|
---|
| 205 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 206 | done
|
---|
| 207 | for dir in $PKG_DEST/usr/{lib,bin,sbin,include}; do
|
---|
| 208 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 209 | done
|
---|
| 210 | for dir in $PKG_DEST/{boot,etc,lib,bin,sbin}; do
|
---|
| 211 | [[ -z $(ls $dir) ]] && rmdir -v $dir
|
---|
| 212 | done
|
---|
| 213 | packInstall
|
---|
| 214 | rm -rf $PKG_DEST
|
---|
| 215 | </xsl:text>
|
---|
[76f8888] | 216 | </xsl:if>
|
---|
| 217 | <xsl:if test="$testsuite='3' and
|
---|
| 218 | ../@id='ch-tools-glibc' and
|
---|
| 219 | @role='installation'">
|
---|
| 220 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
| 221 | <xsl:text>
</xsl:text>
|
---|
| 222 | </xsl:if>
|
---|
| 223 | <xsl:if test="../@id='ch-system-glibc' and @role='installation'">
|
---|
| 224 | <xsl:choose>
|
---|
| 225 | <xsl:when test="$full-locale='y'">
|
---|
| 226 | <xsl:copy-of select="//userinput[@remap='locale-full']"/>
|
---|
| 227 | <xsl:text>
</xsl:text>
|
---|
| 228 | </xsl:when>
|
---|
| 229 | <xsl:otherwise>
|
---|
| 230 | <xsl:copy-of select="//userinput[@remap='locale-test']"/>
|
---|
| 231 | <xsl:text>
</xsl:text>
|
---|
| 232 | <xsl:if test="not(contains(string(//userinput[@remap='locale-test']),$lang)) and $lang!='C' and $lang!='POSIX'">
|
---|
| 233 | <xsl:text>if LOCALE=`grep "</xsl:text>
|
---|
| 234 | <xsl:value-of select="$lang"/>
|
---|
| 235 | <xsl:text>/" $PKGDIR/localedata/SUPPORTED`; then
|
---|
[b339c94] | 236 | CHARMAP=`echo $LOCALE | sed 's,[^/]*/\([^ ]*\) [\],\1,'`
|
---|
| 237 | INPUT=`echo $LOCALE | sed 's,[/.].*,,'`
|
---|
| 238 | LOCALE=`echo $LOCALE | sed 's,/.*,,'`
|
---|
| 239 | localedef -i $INPUT -f $CHARMAP $LOCALE
|
---|
| 240 | fi
|
---|
| 241 | </xsl:text>
|
---|
[76f8888] | 242 | </xsl:if>
|
---|
| 243 | </xsl:otherwise>
|
---|
| 244 | </xsl:choose>
|
---|
[c4cf6de] | 245 | </xsl:if>
|
---|
[76f8888] | 246 | <xsl:apply-templates
|
---|
| 247 | select=".//screen[
|
---|
| 248 | not(@role) or
|
---|
| 249 | @role != 'nodump'
|
---|
| 250 | ]/userinput[
|
---|
| 251 | not(@remap) or
|
---|
| 252 | @remap='adjust' or
|
---|
| 253 | @remap='test' and current()/../@id='ch-tools-dejagnu'
|
---|
| 254 | ]"/>
|
---|
[557fe91] | 255 | </xsl:template>
|
---|
| 256 |
|
---|
[7e51281] | 257 | <xsl:template match="sect1" mode="pkgmngt">
|
---|
[7072e1f] | 258 | <xsl:param name="dirname" select="chapter05"/>
|
---|
| 259 | <!-- The build order -->
|
---|
[575bcf3] | 260 | <xsl:param name="order" select="062"/>
|
---|
[7072e1f] | 261 | <!-- The file names -->
|
---|
| 262 | <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
|
---|
| 263 | <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
|
---|
| 264 | <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
|
---|
| 265 | <!-- Creating dirs and files -->
|
---|
[7e51281] | 266 | <xsl:if test="count(descendant::screen/userinput) > 0 and
|
---|
| 267 | count(descendant::screen/userinput) >
|
---|
| 268 | count(descendant::screen[@role='nodump'])">
|
---|
| 269 | <exsl:document href="{$dirname}/{$order}-{position()}-{$filename}"
|
---|
| 270 | method="text">
|
---|
| 271 | <xsl:text>#!/bin/bash
|
---|
[7072e1f] | 272 | set +h
|
---|
| 273 | set -e
|
---|
| 274 |
|
---|
| 275 | cd $PKGDIR
|
---|
| 276 | </xsl:text>
|
---|
[7e51281] | 277 | <xsl:apply-templates
|
---|
| 278 | select=".//screen[not(@role) or
|
---|
| 279 | @role != 'nodump']/userinput[@remap != 'adjust']"
|
---|
[7072e1f] | 280 | mode="pkgmngt"/>
|
---|
[7e51281] | 281 | <xsl:if test="$dirname = 'chapter06'">
|
---|
| 282 | <xsl:text>packInstall
|
---|
[7072e1f] | 283 | rm -rf $PKG_DEST
|
---|
| 284 | </xsl:text>
|
---|
[7e51281] | 285 | </xsl:if>
|
---|
| 286 | <xsl:apply-templates
|
---|
| 287 | select=".//screen[not(@role) or
|
---|
| 288 | @role != 'nodump'
|
---|
| 289 | ]/userinput[not(@remap) or
|
---|
| 290 | @remap='adjust'
|
---|
[7072e1f] | 291 | ]"
|
---|
| 292 | mode="pkgmngt"/>
|
---|
[7e51281] | 293 | <xsl:text>
|
---|
[7072e1f] | 294 | echo -e "\n\nTotalseconds: $SECONDS\n"
|
---|
| 295 | exit
|
---|
| 296 | </xsl:text>
|
---|
[7e51281] | 297 | </exsl:document>
|
---|
| 298 | </xsl:if>
|
---|
[557fe91] | 299 | </xsl:template>
|
---|
| 300 |
|
---|
[7072e1f] | 301 | <xsl:template match="userinput" mode="pkgmngt">
|
---|
| 302 | <xsl:apply-templates/>
|
---|
| 303 | <xsl:text>
</xsl:text>
|
---|
| 304 | </xsl:template>
|
---|
| 305 |
|
---|
| 306 | <xsl:template match="userinput">
|
---|
[3eb60fa] | 307 | <xsl:choose>
|
---|
[fd691b4] | 308 | <!-- Copying the kernel config file -->
|
---|
| 309 | <xsl:when test="string() = 'make mrproper'">
|
---|
| 310 | <xsl:text>make mrproper
</xsl:text>
|
---|
[7072e1f] | 311 | <xsl:if test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
[bcfb3bf] | 312 | <xsl:text>cp -v ../kernel-config .config
</xsl:text>
|
---|
| 313 | </xsl:if>
|
---|
[92568bf] | 314 | </xsl:when>
|
---|
[7072e1f] | 315 | <!-- test instructions -->
|
---|
| 316 | <xsl:when test="@remap = 'test'">
|
---|
[4afcedb] | 317 | <xsl:choose>
|
---|
| 318 | <xsl:when test="$testsuite = '0'"/>
|
---|
| 319 | <xsl:when test="$testsuite = '1' and
|
---|
| 320 | not(ancestor::sect1[@id='ch-system-gcc']) and
|
---|
| 321 | not(ancestor::sect1[@id='ch-system-glibc']) and
|
---|
[7072e1f] | 322 | not(ancestor::sect1[@id='ch-system-gmp']) and
|
---|
| 323 | not(ancestor::sect1[@id='ch-system-mpfr']) and
|
---|
[4afcedb] | 324 | not(ancestor::sect1[@id='ch-system-binutils'])"/>
|
---|
| 325 | <xsl:when test="$testsuite = '2' and
|
---|
| 326 | ancestor::chapter[@id='chapter-temporary-tools']"/>
|
---|
| 327 | <xsl:otherwise>
|
---|
| 328 | <xsl:choose>
|
---|
| 329 | <xsl:when test="$bomb-testsuite = 'n'">
|
---|
[7072e1f] | 330 | <xsl:choose>
|
---|
| 331 | <!-- special case for glibc -->
|
---|
| 332 | <xsl:when test="contains(string(), 'glibc-check-log')">
|
---|
| 333 | <xsl:value-of
|
---|
| 334 | select="substring-before(string(),'2>&1')"/>
|
---|
| 335 | <xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 336 | </xsl:when>
|
---|
[960099f] | 337 | <!-- special case for procps-ng -->
|
---|
| 338 | <xsl:when test="contains(string(), 'pushd')">
|
---|
| 339 | <xsl:text>{ </xsl:text>
|
---|
| 340 | <xsl:apply-templates/>
|
---|
| 341 | <xsl:text>; } >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 342 | </xsl:when>
|
---|
[7072e1f] | 343 | <xsl:when test="contains(string(), 'make -k')">
|
---|
| 344 | <xsl:apply-templates/>
|
---|
| 345 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 346 | </xsl:when>
|
---|
| 347 | <xsl:when test="contains(string(), 'make')">
|
---|
| 348 | <xsl:value-of select="substring-before(string(),'make')"/>
|
---|
| 349 | <xsl:text>make -k</xsl:text>
|
---|
| 350 | <xsl:value-of select="substring-after(string(),'make')"/>
|
---|
| 351 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 352 | </xsl:when>
|
---|
| 353 | <xsl:otherwise>
|
---|
| 354 | <xsl:apply-templates/>
|
---|
| 355 | <xsl:if test="not(contains(string(), '>>'))">
|
---|
| 356 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
| 357 | </xsl:if>
|
---|
| 358 | <xsl:text>
</xsl:text>
|
---|
| 359 | </xsl:otherwise>
|
---|
| 360 | </xsl:choose>
|
---|
[4afcedb] | 361 | </xsl:when>
|
---|
| 362 | <xsl:otherwise>
|
---|
[7072e1f] | 363 | <!-- bomb-testsuite != 'n'-->
|
---|
| 364 | <xsl:choose>
|
---|
| 365 | <!-- special case for glibc -->
|
---|
| 366 | <xsl:when test="contains(string(), 'glibc-check-log')">
|
---|
| 367 | <xsl:value-of
|
---|
| 368 | select="substring-before(string(),'2>&1')"/>
|
---|
[2c9a16b] | 369 | <xsl:text>>> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
[7072e1f] | 370 | </xsl:when>
|
---|
[960099f] | 371 | <!-- special case for gmp -->
|
---|
[f663589] | 372 | <xsl:when test="contains(string(), 'tee gmp-check-log')">
|
---|
| 373 | <xsl:text>(</xsl:text>
|
---|
| 374 | <xsl:apply-templates/>
|
---|
| 375 | <xsl:text>>> $TEST_LOG 2>&1 && exit $PIPESTATUS)
</xsl:text>
|
---|
| 376 | </xsl:when>
|
---|
[960099f] | 377 | <!-- special case for procps-ng -->
|
---|
| 378 | <xsl:when test="contains(string(), 'pushd')">
|
---|
| 379 | <xsl:text>{ </xsl:text>
|
---|
| 380 | <xsl:apply-templates/>
|
---|
| 381 | <xsl:text>; } >> $TEST_LOG 2>&1
</xsl:text>
|
---|
| 382 | </xsl:when>
|
---|
[2c9a16b] | 383 | <xsl:when test="contains(string(), 'make -k')">
|
---|
| 384 | <xsl:apply-templates/>
|
---|
| 385 | <xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
---|
| 386 | </xsl:when>
|
---|
[7072e1f] | 387 | <xsl:otherwise>
|
---|
| 388 | <xsl:apply-templates/>
|
---|
| 389 | <xsl:if test="not(contains(string(), '>>'))">
|
---|
| 390 | <xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
---|
| 391 | </xsl:if>
|
---|
| 392 | <xsl:text>
</xsl:text>
|
---|
| 393 | </xsl:otherwise>
|
---|
| 394 | </xsl:choose>
|
---|
[4afcedb] | 395 | </xsl:otherwise>
|
---|
| 396 | </xsl:choose>
|
---|
| 397 | </xsl:otherwise>
|
---|
| 398 | </xsl:choose>
|
---|
| 399 | </xsl:when>
|
---|
[7072e1f] | 400 | <!-- End of test instructions -->
|
---|
[fd691b4] | 401 | <!-- Don't stop on strip run -->
|
---|
| 402 | <xsl:when test="contains(string(),'strip ')">
|
---|
[3eb60fa] | 403 | <xsl:apply-templates/>
|
---|
[fd691b4] | 404 | <xsl:text> || true
</xsl:text>
|
---|
[1f025ca] | 405 | </xsl:when>
|
---|
[7072e1f] | 406 | <!-- Package management -->
|
---|
| 407 | <!-- Add $PKG_DEST to installation commands -->
|
---|
| 408 | <xsl:when test="@remap='install' and
|
---|
| 409 | not(ancestor::chapter[
|
---|
| 410 | @id='chapter-temporary-tools'
|
---|
| 411 | ])">
|
---|
| 412 | <xsl:choose>
|
---|
| 413 | <xsl:when test="$pkgmngt='n'">
|
---|
| 414 | <xsl:choose>
|
---|
| 415 | <xsl:when test="contains(string(),'firmware,udev')">
|
---|
| 416 | <xsl:text>if [[ ! -d /lib/udev/devices ]] ; then
</xsl:text>
|
---|
| 417 | <xsl:apply-templates/>
|
---|
| 418 | <xsl:text>
fi
</xsl:text>
|
---|
| 419 | </xsl:when>
|
---|
| 420 | <xsl:otherwise>
|
---|
| 421 | <xsl:apply-templates/>
|
---|
| 422 | <xsl:text>
</xsl:text>
|
---|
| 423 | </xsl:otherwise>
|
---|
| 424 | </xsl:choose>
|
---|
| 425 | </xsl:when>
|
---|
| 426 | <xsl:otherwise><!--pkgmngt = 'y'-->
|
---|
| 427 | <xsl:choose>
|
---|
| 428 | <xsl:when test="./literal">
|
---|
| 429 | <xsl:call-template name="outputpkgdest">
|
---|
| 430 | <xsl:with-param name="outputstring"
|
---|
| 431 | select="text()[1]"/>
|
---|
| 432 | </xsl:call-template>
|
---|
| 433 | <xsl:apply-templates select="literal"/>
|
---|
| 434 | <xsl:call-template name="outputpkgdest">
|
---|
| 435 | <xsl:with-param name="outputstring"
|
---|
| 436 | select="text()[2]"/>
|
---|
| 437 | </xsl:call-template>
|
---|
| 438 | </xsl:when>
|
---|
| 439 | <xsl:otherwise>
|
---|
| 440 | <xsl:call-template name="outputpkgdest">
|
---|
| 441 | <xsl:with-param name="outputstring" select="string()"/>
|
---|
| 442 | </xsl:call-template>
|
---|
| 443 | </xsl:otherwise>
|
---|
| 444 | </xsl:choose>
|
---|
| 445 | </xsl:otherwise>
|
---|
| 446 | </xsl:choose>
|
---|
| 447 | </xsl:when>
|
---|
| 448 | <!-- End addition for package management -->
|
---|
[fd691b4] | 449 | <!-- The rest of commands -->
|
---|
[1f025ca] | 450 | <xsl:otherwise>
|
---|
| 451 | <xsl:apply-templates/>
|
---|
[fd691b4] | 452 | <xsl:text>
</xsl:text>
|
---|
[1f025ca] | 453 | </xsl:otherwise>
|
---|
| 454 | </xsl:choose>
|
---|
| 455 | </xsl:template>
|
---|
[7072e1f] | 456 |
|
---|
[557fe91] | 457 | <xsl:template match="replaceable">
|
---|
[a41ce58] | 458 | <xsl:choose>
|
---|
[2a54650] | 459 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
[877cc6a] | 460 | <xsl:value-of select="$timezone"/>
|
---|
[2a54650] | 461 | </xsl:when>
|
---|
[a41ce58] | 462 | <xsl:when test="ancestor::sect1[@id='ch-system-groff']">
|
---|
[877cc6a] | 463 | <xsl:value-of select="$page"/>
|
---|
[a41ce58] | 464 | </xsl:when>
|
---|
[81a7fb8] | 465 | <xsl:when test="contains(string(.),'<ll>_<CC>')">
|
---|
| 466 | <xsl:value-of select="$lang"/>
|
---|
| 467 | </xsl:when>
|
---|
[a41ce58] | 468 | <xsl:otherwise>
|
---|
| 469 | <xsl:text>**EDITME</xsl:text>
|
---|
| 470 | <xsl:apply-templates/>
|
---|
| 471 | <xsl:text>EDITME**</xsl:text>
|
---|
| 472 | </xsl:otherwise>
|
---|
| 473 | </xsl:choose>
|
---|
[557fe91] | 474 | </xsl:template>
|
---|
[7072e1f] | 475 |
|
---|
| 476 | <xsl:template name="outputpkgdest">
|
---|
| 477 | <xsl:param name="outputstring" select="foo"/>
|
---|
| 478 | <xsl:choose>
|
---|
| 479 | <xsl:when test="contains($outputstring,'make ')">
|
---|
| 480 | <xsl:choose>
|
---|
| 481 | <xsl:when test="not(starts-with($outputstring,'make'))">
|
---|
| 482 | <xsl:call-template name="outputpkgdest">
|
---|
| 483 | <xsl:with-param name="outputstring"
|
---|
| 484 | select="substring-before($outputstring,'make')"/>
|
---|
| 485 | </xsl:call-template>
|
---|
| 486 | <xsl:call-template name="outputpkgdest">
|
---|
| 487 | <xsl:with-param
|
---|
| 488 | name="outputstring"
|
---|
| 489 | select="substring-after($outputstring,
|
---|
| 490 | substring-before($outputstring,'make'))"/>
|
---|
| 491 | </xsl:call-template>
|
---|
| 492 | </xsl:when>
|
---|
| 493 | <xsl:otherwise>
|
---|
| 494 | <xsl:choose>
|
---|
| 495 | <!-- special cases (no DESTDIR) here -->
|
---|
| 496 | <xsl:when test="ancestor::sect1[@id='ch-system-glibc']">
|
---|
| 497 | <xsl:text>make install_root=$PKG_DEST -j1</xsl:text>
|
---|
| 498 | <xsl:value-of
|
---|
| 499 | select="substring-before(substring-after(string(),'make'),
|
---|
| 500 | 'install')"/>
|
---|
| 501 | <xsl:text>install
</xsl:text>
|
---|
| 502 | </xsl:when>
|
---|
| 503 | <xsl:when test="ancestor::sect1[@id='ch-system-bzip2']">
|
---|
| 504 | <xsl:text>make PREFIX=$PKG_DEST/usr install
</xsl:text>
|
---|
| 505 | </xsl:when>
|
---|
| 506 | <xsl:when test="ancestor::sect1[@id='ch-system-sysklogd']">
|
---|
| 507 | <xsl:text>make BINDIR=$PKG_DEST/sbin prefix=$PKG_DEST install
</xsl:text>
|
---|
| 508 | </xsl:when>
|
---|
| 509 | <xsl:when test="ancestor::sect1[@id='ch-system-iproute2']">
|
---|
| 510 | <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
|
---|
| 511 | <xsl:value-of
|
---|
| 512 | select="substring-before(substring-after(string(),'DESTDIR='),
|
---|
| 513 | 'install')"/>
|
---|
| 514 | <xsl:text>install
</xsl:text>
|
---|
| 515 | </xsl:when>
|
---|
| 516 | <xsl:when test="ancestor::sect1[@id='ch-system-sysvinit']">
|
---|
| 517 | <xsl:text>make ROOT=$PKG_DEST</xsl:text>
|
---|
| 518 | <xsl:value-of
|
---|
| 519 | select="substring-before(substring-after(string(),'make'),
|
---|
| 520 | 'install')"/>
|
---|
| 521 | <xsl:text>install
</xsl:text>
|
---|
| 522 | </xsl:when>
|
---|
| 523 | <xsl:when test="ancestor::sect1[@id='ch-bootable-kernel']">
|
---|
| 524 | <xsl:text>make INSTALL_MOD_PATH=$PKG_DEST</xsl:text>
|
---|
| 525 | <xsl:value-of
|
---|
| 526 | select="substring-before(substring-after(string(),'make'),
|
---|
| 527 | 'install')"/>
|
---|
| 528 | <xsl:text>install
</xsl:text>
|
---|
| 529 | </xsl:when>
|
---|
| 530 | <xsl:otherwise>
|
---|
| 531 | <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
|
---|
| 532 | <xsl:call-template name="outputpkgdest">
|
---|
| 533 | <xsl:with-param
|
---|
| 534 | name="outputstring"
|
---|
| 535 | select="substring-after($outputstring,'make')"/>
|
---|
| 536 | </xsl:call-template>
|
---|
| 537 | </xsl:otherwise>
|
---|
| 538 | </xsl:choose>
|
---|
| 539 | </xsl:otherwise>
|
---|
| 540 | </xsl:choose>
|
---|
| 541 | </xsl:when>
|
---|
| 542 | <xsl:otherwise> <!-- no make in this string -->
|
---|
| 543 | <xsl:choose>
|
---|
| 544 | <xsl:when test="contains($outputstring,'>/') and
|
---|
| 545 | not(contains(substring-before($outputstring,'>/'),' /'))">
|
---|
| 546 | <xsl:value-of select="substring-before($outputstring,'>/')"/>
|
---|
| 547 | <xsl:text>>$PKG_DEST/</xsl:text>
|
---|
| 548 | <xsl:call-template name="outputpkgdest">
|
---|
| 549 | <xsl:with-param name="outputstring" select="substring-after($outputstring,'>/')"/>
|
---|
| 550 | </xsl:call-template>
|
---|
| 551 | </xsl:when>
|
---|
| 552 | <xsl:when test="contains($outputstring,' /')">
|
---|
| 553 | <xsl:value-of select="substring-before($outputstring,' /')"/>
|
---|
| 554 | <xsl:text> $PKG_DEST/</xsl:text>
|
---|
| 555 | <xsl:call-template name="outputpkgdest">
|
---|
| 556 | <xsl:with-param name="outputstring" select="substring-after($outputstring,' /')"/>
|
---|
| 557 | </xsl:call-template>
|
---|
| 558 | </xsl:when>
|
---|
| 559 | <xsl:otherwise>
|
---|
| 560 | <xsl:value-of select="$outputstring"/>
|
---|
| 561 | <xsl:text>
</xsl:text>
|
---|
| 562 | </xsl:otherwise>
|
---|
| 563 | </xsl:choose>
|
---|
| 564 | </xsl:otherwise>
|
---|
| 565 | </xsl:choose>
|
---|
| 566 | </xsl:template>
|
---|
[557fe91] | 567 | </xsl:stylesheet>
|
---|