- Timestamp:
- 04/22/2019 09:38:44 AM (5 years ago)
- Branches:
- ablfs-more, legacy, trunk
- Children:
- 72e9e68
- Parents:
- dfc023a
- Location:
- BLFS/xsl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
BLFS/xsl/gen-install.xsl
rdfc023a raeb8539 248 248 <xsl:otherwise> 249 249 <xsl:call-template name="output-root"> 250 <xsl:with-param name="out-string" select=" ."/>250 <xsl:with-param name="out-string" select="$out-string"/> 251 251 </xsl:call-template> 252 252 </xsl:otherwise> -
BLFS/xsl/scripts.xsl
rdfc023a raeb8539 541 541 <!-- instructions run as root (configuration mainly) --> 542 542 <xsl:when test="@role = 'root'"> 543 <!-- templates begin/end-root are in gen-install.xsl --> 543 544 <xsl:if test="not(preceding-sibling::screen[1][@role='root'])"> 544 <xsl:if test="$sudo = 'y'"> 545 <xsl:text>sudo -E sh << ROOT_EOF
</xsl:text> 546 </xsl:if> 545 <xsl:call-template name="begin-root"/> 547 546 </xsl:if> 548 547 <xsl:apply-templates mode="root"/> 548 <xsl:text>
</xsl:text> 549 549 <xsl:if test="not(following-sibling::screen[1][@role='root'])"> 550 <xsl:if test="$sudo = 'y'"> 551 <xsl:text>
ROOT_EOF</xsl:text> 552 </xsl:if> 550 <xsl:call-template name="end-root"/> 553 551 </xsl:if> 554 552 </xsl:when> … … 556 554 <xsl:otherwise> 557 555 <xsl:apply-templates select="userinput"/> 558 </xsl:otherwise>559 </xsl:choose>560 < xsl:text>
</xsl:text>556 <xsl:text>
</xsl:text> 557 </xsl:otherwise> 558 </xsl:choose> 561 559 </xsl:template> 562 560 … … 603 601 <xsl:template match="screen" mode="config"> 604 602 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']"> 603 <!-- if the preceding "screen" tag is role="root", and we are role="root" 604 the end-root has not been called. So do it --> 605 <xsl:if test="preceding-sibling::screen[1][@role='root'] and 606 @role='root'"> 607 <xsl:call-template name="end-root"/> 608 </xsl:if> 605 609 <xsl:call-template name="set-bootpkg-dir"> 606 610 <xsl:with-param name="bootpkg" select="'bootscripts'"/> … … 608 612 select="id('bootscripts')//itemizedlist//ulink/@url"/> 609 613 </xsl:call-template> 614 <!-- if the preceding "screen" tag is role="root", and we are role="root" 615 the begin-root will not be called. So do it --> 616 <xsl:if test="preceding-sibling::screen[1][@role='root'] and 617 @role='root'"> 618 <xsl:call-template name="begin-root"/> 619 </xsl:if> 610 620 </xsl:if> 611 621 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='systemd-units']"> 622 <!-- if the preceding "screen" tag is role="root", and we are role="root" 623 the end-root has not been called. So do it --> 624 <xsl:if test="preceding-sibling::screen[1][@role='root'] and 625 @role='root'"> 626 <xsl:call-template name="end-root"/> 627 </xsl:if> 612 628 <xsl:call-template name="set-bootpkg-dir"> 613 629 <xsl:with-param name="bootpkg" select="'systemd-units'"/> … … 615 631 select="id('systemd-units')//itemizedlist//ulink/@url"/> 616 632 </xsl:call-template> 633 <!-- if the preceding "screen" tag is role="root", and we are role="root" 634 the begin-root will not be called. So do it --> 635 <xsl:if test="preceding-sibling::screen[1][@role='root'] and 636 @role='root'"> 637 <xsl:call-template name="begin-root"/> 638 </xsl:if> 617 639 </xsl:if> 618 640 <xsl:apply-templates select='.'/> 619 641 <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts' or 620 642 @linkend='systemd-units']"> 621 <xsl:text> 622 popd</xsl:text> 643 <!-- if the next "screen" tag is role="root", and we are role="root" 644 the end-root has not been called. So do it --> 645 <xsl:if test="following-sibling::screen[1][@role='root'] and 646 @role='root'"> 647 <xsl:call-template name="end-root"/> 648 </xsl:if> 649 <xsl:text>popd 650 </xsl:text> 651 <!-- if the next "screen" tag is role="root", and we are role="root" 652 the begin-root will not be called. So do it --> 653 <xsl:if test="following-sibling::screen[1][@role='root'] and 654 @role='root'"> 655 <xsl:call-template name="begin-root"/> 656 </xsl:if> 623 657 </xsl:if> 624 <xsl:text>
</xsl:text>625 658 </xsl:template> 626 659 … … 686 719 </xsl:template> 687 720 721 <xsl:template match="text()"> 722 <xsl:call-template name="remove-ampersand"> 723 <xsl:with-param name="out-string" select="string()"/> 724 </xsl:call-template> 725 </xsl:template> 726 688 727 <xsl:template match="text()" mode="root"> 689 728 <xsl:call-template name="output-root"> … … 740 779 </xsl:when> 741 780 <xsl:otherwise> 742 <xsl:value-of select="$out-string"/> 781 <xsl:call-template name="remove-ampersand"> 782 <xsl:with-param name="out-string" select="$out-string"/> 783 </xsl:call-template> 784 <!-- <xsl:value-of select="$out-string"/> --> 743 785 </xsl:otherwise> 744 786 </xsl:choose> … … 890 932 <xsl:when test="contains($outputstring,'>/') and 891 933 not(contains(substring-before($outputstring,'>/'),' /'))"> 892 <xsl:value-of select="substring-before($outputstring,'>/')"/> 934 <xsl:call-template name="remove-ampersand"> 935 <xsl:with-param name="out-string" 936 select="substring-before($outputstring,'>/')"/> 937 </xsl:call-template> 938 <!-- <xsl:value-of select="substring-before($outputstring,'>/')"/>--> 893 939 <xsl:text>>$PKG_DEST/</xsl:text> 894 940 <xsl:call-template name="outputpkgdest"> … … 897 943 </xsl:when> 898 944 <xsl:when test="contains($outputstring,' /')"> 899 <xsl:value-of select="substring-before($outputstring,' /')"/> 945 <xsl:call-template name="remove-ampersand"> 946 <xsl:with-param name="out-string" 947 select="substring-before($outputstring,' /')"/> 948 </xsl:call-template> 949 <!-- <xsl:value-of select="substring-before($outputstring,' /')"/>--> 900 950 <xsl:text> $PKG_DEST/</xsl:text> 901 951 <xsl:call-template name="outputpkgdest"> … … 904 954 </xsl:when> 905 955 <xsl:otherwise> 906 <xsl:value-of select="$outputstring"/> 956 <xsl:call-template name="remove-ampersand"> 957 <xsl:with-param name="out-string" select="$outputstring"/> 958 </xsl:call-template> 959 <!-- <xsl:value-of select="$outputstring"/>--> 907 960 </xsl:otherwise> 908 961 </xsl:choose> … … 911 964 </xsl:template> 912 965 966 <xsl:template name="remove-ampersand"> 967 <xsl:param name="out-string" select="''"/> 968 <xsl:choose> 969 <xsl:when test="contains($out-string,'&&
')"> 970 <xsl:variable name="instruction-before"> 971 <xsl:call-template name="last-line"> 972 <xsl:with-param 973 name="instructions" 974 select="substring-before($out-string,'&&
')"/> 975 </xsl:call-template> 976 </xsl:variable> 977 <xsl:call-template name="remove-end-space"> 978 <xsl:with-param 979 name="instructions" 980 select="substring-before($out-string,'&&
')"/> 981 </xsl:call-template> 982 <xsl:if test="contains($instruction-before,' ]') or 983 contains($instruction-before,'test ') or 984 contains($instruction-before,'pgrep -l')"> 985 <xsl:text> &&</xsl:text> 986 </xsl:if> 987 <xsl:text>
</xsl:text> 988 <xsl:call-template name="remove-ampersand"> 989 <xsl:with-param name="out-string" 990 select="substring-after($out-string, 991 '&&
')"/> 992 </xsl:call-template> 993 </xsl:when> 994 <xsl:otherwise> 995 <xsl:copy-of select="$out-string"/> 996 </xsl:otherwise> 997 </xsl:choose> 998 </xsl:template> 999 1000 <xsl:template name="last-line"> 1001 <xsl:param name="instructions" select="''"/> 1002 <xsl:choose> 1003 <xsl:when test="contains($instructions,'
')"> 1004 <xsl:call-template name="last-line"> 1005 <xsl:with-param 1006 name="instructions" 1007 select="substring-after($instructions,'
')"/> 1008 </xsl:call-template> 1009 </xsl:when> 1010 <xsl:otherwise> 1011 <xsl:copy-of select="normalize-space($instructions)"/> 1012 </xsl:otherwise> 1013 </xsl:choose> 1014 </xsl:template> 1015 1016 <xsl:template name="remove-end-space"> 1017 <xsl:param name="instructions" select="''"/> 1018 <xsl:choose> 1019 <xsl:when test="contains($instructions,'
')"> 1020 <xsl:copy-of select="substring-before($instructions,'
')"/> 1021 <xsl:text>
</xsl:text> 1022 <xsl:call-template name="remove-end-space"> 1023 <xsl:with-param 1024 name="instructions" 1025 select="substring-after($instructions,'
')"/> 1026 </xsl:call-template> 1027 </xsl:when> 1028 <xsl:otherwise> 1029 <xsl:copy-of select="normalize-space($instructions)"/> 1030 </xsl:otherwise> 1031 </xsl:choose> 1032 </xsl:template> 1033 913 1034 </xsl:stylesheet>
Note:
See TracChangeset
for help on using the changeset viewer.