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