- Timestamp:
- 08/17/2019 08:30:36 AM (5 years ago)
- Branches:
- ablfs-more, legacy, trunk
- Children:
- 30732c6a
- Parents:
- 96d7e44
- Location:
- BLFS/xsl
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
BLFS/xsl/make_book.xsl
r96d7e44 r0a0b609 103 103 </xsl:when> 104 104 <xsl:when test="contains(concat($list,' '),'-pass1 ')"> 105 <!-- Let's do it only for sect1, hopefully-->105 <!-- We need to do it only for sect1 and sect2, because of libva --> 106 106 <xsl:variable 107 107 name="real-id" … … 109 109 <xsl:if test="id($real-id)[self::sect1]"> 110 110 <xsl:apply-templates select="id($real-id)" mode="pass1"/> 111 </xsl:if> 112 <xsl:if test="id($real-id)[self::sect2]"> 113 <xsl:apply-templates select="id($real-id)" mode="pass1-sect2"/> 111 114 </xsl:if> 112 115 </xsl:when> … … 185 188 </xsl:for-each> 186 189 <xsl:apply-templates mode="pass1"/> 190 </xsl:element> 191 </xsl:when> 192 <xsl:otherwise> 193 <xsl:copy-of select="."/> 194 </xsl:otherwise> 195 </xsl:choose> 196 </xsl:template> 197 198 <xsl:template match="*" mode="pass1-sect2"> 199 <xsl:choose> 200 <xsl:when test="self::sect2"> 201 <xsl:element name="sect1"> 202 <xsl:attribute name="id"><xsl:value-of select="@id"/>-pass1</xsl:attribute> 203 <xsl:attribute name="xreflabel"><xsl:value-of select="@xreflabel"/></xsl:attribute> 204 <xsl:processing-instruction name="dbhtml">filename="<xsl:value-of 205 select="@id"/>-pass1.html"</xsl:processing-instruction> 206 <xsl:apply-templates mode="pass1-sect2"/> 207 </xsl:element> 208 </xsl:when> 209 <xsl:when test="self::sect3"> 210 <xsl:element name="sect2"> 211 <xsl:attribute name="role"> 212 <xsl:value-of select="@role"/> 213 </xsl:attribute> 214 <xsl:apply-templates mode="pass1-sect2"/> 215 </xsl:element> 216 </xsl:when> 217 <xsl:when test="self::bridgehead"> 218 <xsl:element name="bridgehead"> 219 <xsl:attribute name="renderas"> 220 <xsl:if test="@renderas='sect4'">sect3</xsl:if> 221 <xsl:if test="@renderas='sect5'">sect4</xsl:if> 222 </xsl:attribute> 223 <xsl:value-of select='.'/> 224 </xsl:element> 225 </xsl:when> 226 <xsl:when test="self::xref"> 227 <xsl:choose> 228 <xsl:when test="contains(concat(' ',normalize-space($list),' '), 229 concat(' ',@linkend,' '))"> 230 <xsl:choose> 231 <xsl:when test="@linkend='x-window-system' or @linkend='xorg7'"> 232 <xref linkend="xorg7-server"/> 233 </xsl:when> 234 <xsl:when test="@linkend='server-mail'"> 235 <xref linkend="{$MTA}"/> 236 </xsl:when> 237 <xsl:otherwise> 238 <xsl:copy-of select="."/> 239 </xsl:otherwise> 240 </xsl:choose> 241 </xsl:when> 242 <xsl:otherwise> 243 <xsl:choose> 244 <xsl:when test="@linkend='bootscripts' or 245 @linkend='systemd-units'"> 246 <xsl:copy-of select="."/> 247 </xsl:when> 248 <xsl:otherwise> 249 <xsl:value-of select="@linkend"/> (in full book) 250 </xsl:otherwise> 251 </xsl:choose> 252 </xsl:otherwise> 253 </xsl:choose> 254 </xsl:when> 255 <xsl:when test="@id"> 256 <xsl:element name="{name()}"> 257 <xsl:for-each select="attribute::*"> 258 <xsl:attribute name="{name()}"> 259 <xsl:value-of select="."/> 260 <xsl:if test="name() = 'id'">-pass1</xsl:if> 261 </xsl:attribute> 262 </xsl:for-each> 263 <xsl:apply-templates mode="pass1-sect2"/> 264 </xsl:element> 265 </xsl:when> 266 <xsl:when test=".//xref | .//@id"> 267 <xsl:element name="{name()}"> 268 <xsl:for-each select="attribute::*"> 269 <xsl:attribute name="{name()}"> 270 <xsl:value-of select="."/> 271 </xsl:attribute> 272 </xsl:for-each> 273 <xsl:apply-templates mode="pass1-sect2"/> 187 274 </xsl:element> 188 275 </xsl:when> -
BLFS/xsl/process-install.xsl
r96d7e44 r0a0b609 18 18 19 19 <xsl:choose> 20 <!--============================================================--> 20 21 <!-- First, if we have an empty tree, close everything and exit --> 21 22 <xsl:when test="not($current-instr)"> … … 36 37 </xsl:call-template> 37 38 </xsl:if> 38 </xsl:when><!-- empty tree --> 39 </xsl:when><!-- end empty tree --> 40 <!--============================================================--> 39 41 <xsl:when test="$current-instr[@role='root' and @remap='test']"> 40 42 <xsl:if test="$install-seen"> … … 55 57 </xsl:if> 56 58 <xsl:call-template name="begin-root"/> 57 <xsl:choose>58 <xsl:when test="$want-stats">59 60 </xsl:when>61 <xsl:otherwise>62 <xsl:apply-templates select="$current-instr"63 mode="root-comment-out"/>64 < /xsl:otherwise>65 </xsl:c hoose>59 <!-- We first apply mode="root" templates, and save the result in a variable --> 60 <xsl:variable name="processed-instr"> 61 <xsl:apply-templates select="$current-instr" mode="root"/> 62 </xsl:variable> 63 <!-- We then process as a test instruction --> 64 <xsl:call-template name="process-test"> 65 <xsl:with-param name="test-instr" select="$processed-instr"/> 66 <xsl:with-param name="want-stats" select="$want-stats"/> 67 </xsl:call-template> 66 68 <xsl:call-template name="process-install"> 67 69 <xsl:with-param … … 74 76 <xsl:with-param name="doc-seen" select="boolean(0)"/> 75 77 </xsl:call-template> 76 </xsl:when><!-- role="root" and remap="test" --> 78 </xsl:when><!-- end role="root" and remap="test" --> 79 <!--============================================================--> 77 80 <xsl:when test="$current-instr[@role='root' and @remap='doc']"> 78 81 <xsl:if test="$test-seen"> … … 92 95 <xsl:call-template name="begin-install"/> 93 96 </xsl:if> 94 <xsl:apply-templates select="$current-instr" 95 mode="install-comment-out"/> 97 <!-- We first apply mode="install" templates, and save the result in a 98 variable --> 99 <xsl:variable name="processed-instr"> 100 <xsl:apply-templates select="$current-instr" mode="install"/> 101 </xsl:variable> 102 <!-- Then comment it out --> 103 <xsl:call-template name="output-comment-out"> 104 <xsl:with-param name="out-string" select="$processed-instr"/> 105 </xsl:call-template> 96 106 <!-- The above template ends with a commented line, so that if end-install 97 107 adds a closing single quote, it will not be seen. Add a CR to prevent … … 109 119 <xsl:with-param name="doc-seen" select="boolean(1)"/> 110 120 </xsl:call-template> 111 </xsl:when><!--role="root" and remap="doc" --> 121 </xsl:when><!-- end role="root" and remap="doc" --> 122 <!--============================================================--> 112 123 <xsl:when test="$current-instr[@role='root']"> 124 <!-- We have two cases, depending on the content: either a config instruction, 125 that we do not recorrd with porg (first case belaow), or a true install 126 instruction (otherwise below) --> 113 127 <xsl:choose> 128 <!--____________________________________________________________ --> 114 129 <xsl:when test="contains(string($current-instr),'useradd') or 115 130 contains(string($current-instr),'groupadd') or … … 149 164 </xsl:call-template> 150 165 </xsl:when><!-- end config as root --> 166 <!--____________________________________________________________ --> 151 167 <xsl:otherwise><!-- we have a true install instruction --> 152 168 <xsl:if test="$test-seen"> … … 196 212 </xsl:call-template> 197 213 </xsl:otherwise><!-- end true install instruction --> 214 <!--____________________________________________________________ --> 198 215 </xsl:choose> 199 216 </xsl:when><!-- role="root" and no remap --> 217 <!--============================================================--> 200 218 <xsl:when test="$current-instr[@remap='test'] or 201 219 $current-instr/self::command"> … … 221 239 </xsl:call-template> 222 240 </xsl:if> 223 <xsl:choose> 224 <xsl:when test="$want-stats"> 225 <xsl:apply-templates select="$current-instr"/> 226 </xsl:when> 227 <xsl:otherwise> 228 <xsl:apply-templates select="$current-instr" mode="comment-out"/> 229 </xsl:otherwise> 230 </xsl:choose> 241 <!-- We first apply normal templates, and save the result in a variable --> 242 <xsl:variable name="processed-instr"> 243 <xsl:apply-templates select="$current-instr"/> 244 </xsl:variable> 245 <!-- We then process as a test instruction --> 246 <xsl:call-template name="process-test"> 247 <xsl:with-param name="test-instr" select="$processed-instr"/> 248 <xsl:with-param name="want-stats" select="$want-stats"/> 249 </xsl:call-template> 231 250 <xsl:call-template name="process-install"> 232 251 <xsl:with-param … … 239 258 <xsl:with-param name="doc-seen" select="boolean(0)"/> 240 259 </xsl:call-template> 241 </xsl:when><!-- no role, remap=test --> 260 </xsl:when><!-- end no role, remap=test --> 261 <!--============================================================--> 242 262 <xsl:when test="$current-instr[@remap='doc']"> 243 263 <xsl:if test="$install-seen"> … … 262 282 </xsl:call-template> 263 283 </xsl:if> 264 <xsl:choose> 265 <xsl:when test="$want-stats"> 266 <xsl:apply-templates select="$current-instr"/> 267 </xsl:when> 268 <xsl:otherwise> 269 <xsl:apply-templates select="$current-instr" mode="comment-out"/> 270 </xsl:otherwise> 271 </xsl:choose> 284 <!-- We first apply normal templates, and save the result in a variable --> 285 <xsl:variable name="processed-instr"> 286 <xsl:apply-templates select="$current-instr"/> 287 </xsl:variable> 288 <!-- We then process as a doc instruction --> 289 <xsl:call-template name="process-doc"> 290 <xsl:with-param name="doc-instr" select="$processed-instr"/> 291 <xsl:with-param name="want-stats" select="$want-stats"/> 292 </xsl:call-template> 272 293 <xsl:call-template name="process-install"> 273 294 <xsl:with-param … … 281 302 </xsl:call-template> 282 303 </xsl:when><!-- no role, remap="doc" --> 304 <!--============================================================--> 283 305 <xsl:otherwise><!-- no role no remap --> 284 306 <xsl:if test="$install-seen"> … … 310 332 </xsl:call-template> 311 333 </xsl:otherwise><!-- no role, no remap --> 334 <!--============================================================--> 312 335 </xsl:choose> 313 </xsl:template>314 315 <xsl:template match="userinput" mode="install-comment-out">316 <xsl:text>317 </xsl:text>318 <xsl:call-template name="output-comment-out">319 <xsl:with-param name="out-string" select="string()"/>320 <xsl:with-param name="process" select="'install'"/>321 </xsl:call-template>322 </xsl:template>323 324 <xsl:template match="userinput|command" mode="root-comment-out">325 <xsl:text>326 </xsl:text>327 <xsl:call-template name="output-comment-out">328 <xsl:with-param name="out-string" select="string()"/>329 <xsl:with-param name="process" select="'root'"/>330 </xsl:call-template>331 </xsl:template>332 333 <xsl:template match="userinput|command" mode="comment-out">334 <xsl:text>335 </xsl:text>336 <xsl:call-template name="output-comment-out">337 <xsl:with-param name="out-string" select="string()"/>338 <xsl:with-param name="process" select="'none'"/>339 </xsl:call-template>340 336 </xsl:template> 341 337 … … 348 344 </xsl:template> 349 345 350 <xsl:template name="output-comment-out"> 351 <!-- Output instructions with each line commented out. The "process" 352 parameter is: 353 none: only output commented-out and remove ampersand 354 root: output commented out and remove ampersand, 355 with escaping of \, $, and ` 356 install: same + escape ' --> 357 <xsl:param name="out-string"/> 358 <xsl:param name="process"/> 346 <!-- userinput templates for mode="root" and normal are in scripts.xsl --> 347 348 <xsl:template name="process-test"> 349 <xsl:param name="test-instr"/> 350 <xsl:param name="want-stats"/> 359 351 <xsl:choose> 360 <xsl:when test="contains($out-string,'
')"> 352 <!-- the string may begin with a linefeed --> 353 <xsl:when test="substring($test-instr,1,1)='
'"> 354 <xsl:text> 355 </xsl:text> 356 <xsl:call-template name="process-test"> 357 <xsl:with-param name="test-instr" 358 select="substring-after($test-instr,'
')"/> 359 <xsl:with-param name="want-stats" select="$want-stats"/> 360 </xsl:call-template> 361 </xsl:when> 362 <xsl:when test="contains($test-instr,'
')"> 363 <xsl:call-template name="process-test"> 364 <xsl:with-param name="test-instr" 365 select="substring-before($test-instr,'
')"/> 366 <xsl:with-param name="want-stats" select="$want-stats"/> 367 </xsl:call-template> 368 <xsl:text> 369 </xsl:text> 370 <xsl:call-template name="process-test"> 371 <xsl:with-param name="test-instr" 372 select="substring-after($test-instr,'
')"/> 373 <xsl:with-param name="want-stats" select="$want-stats"/> 374 </xsl:call-template> 375 </xsl:when> 376 <xsl:otherwise> 377 <xsl:if test="not($want-stats)"> 378 <xsl:text>#</xsl:text> 379 </xsl:if> 361 380 <xsl:choose> 362 <xsl:when test="$process='install'"> 363 <xsl:call-template name="output-install"> 364 <xsl:with-param 365 name="out-string" 366 select="concat('# ', 367 substring-before($out-string,'
') 368 )"/> 369 </xsl:call-template> 370 </xsl:when> 371 <xsl:when test="$process='root'"> 372 <xsl:call-template name="output-root"> 373 <xsl:with-param 374 name="out-string" 375 select="concat('# ', 376 substring-before($out-string,'
') 377 )"/> 378 </xsl:call-template> 381 <xsl:when test="contains($test-instr,'make') 382 and not(contains($test-instr,'make -k'))"> 383 <xsl:copy-of select="substring-before($test-instr,'make')"/> 384 <xsl:text>make -k</xsl:text> 385 <xsl:copy-of select="substring-after($test-instr,'make')"/> 379 386 </xsl:when> 380 387 <xsl:otherwise> 381 <xsl:call-template name="remove-ampersand"> 382 <xsl:with-param 383 name="out-string" 384 select="concat('# ', 385 substring-before($out-string,'
') 386 )"/> 387 </xsl:call-template> 388 <xsl:copy-of select="$test-instr"/> 388 389 </xsl:otherwise> 389 390 </xsl:choose> 391 <xsl:if test="substring($test-instr, 392 string-length($test-instr), 393 1)!='\'"> 394 <xsl:if test="$want-stats"> 395 <xsl:text> >> $TESTLOG 2>&1</xsl:text> 396 </xsl:if> 397 <xsl:text> || true</xsl:text> 398 </xsl:if> 399 </xsl:otherwise> 400 </xsl:choose> 401 </xsl:template> 402 403 <xsl:template name="process-doc"> 404 <xsl:param name="doc-instr"/> 405 <xsl:param name="want-stats"/> 406 <xsl:choose> 407 <xsl:when test="$want-stats"> 408 <xsl:copy-of select="$doc-instr"/> 409 </xsl:when> 410 <xsl:otherwise> 411 <xsl:call-template name="output-comment-out"> 412 <xsl:with-param name="out-string" select="$doc-instr"/> 413 </xsl:call-template> 414 </xsl:otherwise> 415 </xsl:choose> 416 </xsl:template> 417 418 <xsl:template name="output-comment-out"> 419 <!-- Output instructions with each line commented out. --> 420 <xsl:param name="out-string"/> 421 <xsl:choose> 422 <!-- the string may begin with a linefeed --> 423 <xsl:when test="substring($out-string,1,1)='
'"> 390 424 <xsl:text> 391 425 </xsl:text> 392 426 <xsl:call-template name="output-comment-out"> 393 <xsl:with-param 394 name="out-string" 395 select="substring-after($out-string,'
')"/> 396 <xsl:with-param name="process" select="$process"/> 427 <xsl:with-param name="out-string" 428 select="substring-after($out-string,'
')"/> 429 </xsl:call-template> 430 </xsl:when> 431 <xsl:when test="contains($out-string,'
')"> 432 <xsl:text>#</xsl:text> 433 <xsl:copy-of select="substring-before($out-string,'
')"/> 434 <xsl:text> 435 </xsl:text> 436 <xsl:call-template name="output-comment-out"> 437 <xsl:with-param name="out-string" 438 select="substring-after($out-string,'
')"/> 397 439 </xsl:call-template> 398 440 </xsl:when> 399 441 <xsl:otherwise> 400 <xsl:choose> 401 <xsl:when test="$process='install'"> 402 <xsl:call-template name="output-install"> 403 <xsl:with-param name="out-string" 404 select="concat('# ',$out-string)"/> 405 </xsl:call-template> 406 </xsl:when> 407 <xsl:when test="$process='root'"> 408 <xsl:call-template name="output-root"> 409 <xsl:with-param name="out-string" 410 select="concat('# ',$out-string)"/> 411 </xsl:call-template> 412 </xsl:when> 413 <xsl:otherwise> 414 <xsl:call-template name="remove-ampersand"> 415 <xsl:with-param name="out-string" 416 select="concat('# ',$out-string)"/> 417 </xsl:call-template> 418 </xsl:otherwise> 419 </xsl:choose> 442 <xsl:text>#</xsl:text> 443 <xsl:copy-of select="$out-string"/> 420 444 </xsl:otherwise> 421 445 </xsl:choose> -
BLFS/xsl/scripts.xsl
r96d7e44 r0a0b609 190 190 </xsl:when> 191 191 192 <xsl:when test="@role = 'installation'"> 192 <xsl:when test="@role = 'installation' and 193 not(preceding-sibling::sect2[@role = 'installation'])"> 193 194 <xsl:text> 194 195 cd $BUILD_DIR
Note:
See TracChangeset
for help on using the changeset viewer.