Changeset 625cb14 for BLFS/xsl/scripts.xsl
- Timestamp:
- 09/28/2018 02:35:46 PM (6 years ago)
- Branches:
- ablfs-more, legacy, trunk
- Children:
- 6e28f3c
- Parents:
- 3b4399c9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BLFS/xsl/scripts.xsl
r3b4399c9 r625cb14 34 34 <!-- Build as user (y) or as root (n)? --> 35 35 <xsl:param name="sudo" select="'y'"/> 36 37 <!-- Localization in the form ll_CC.charmap@modifier (to be used in 38 bash shell startup scripts). ll, CC, and charmap must be present: 39 no way to use "C" or "POSIX". --> 40 <xsl:param name="language" select="'en_US.UTF-8'"/> 41 42 <!-- Break it in pieces --> 43 <xsl:variable name="lang-ll"> 44 <xsl:copy-of select="substring-before($language,'_')"/> 45 </xsl:variable> 46 <xsl:variable name="lang-CC"> 47 <xsl:copy-of 48 select="substring-before(substring-after($language,'_'),'.')"/> 49 </xsl:variable> 50 <xsl:variable name="lang-charmap"> 51 <xsl:choose> 52 <xsl:when test="contains($language,'@')"> 53 <xsl:copy-of 54 select="substring-before(substring-after($language,'.'),'@')"/> 55 </xsl:when> 56 <xsl:otherwise> 57 <xsl:copy-of select="substring-after($language,'.')"/> 58 </xsl:otherwise> 59 </xsl:choose> 60 </xsl:variable> 61 <xsl:variable name="lang-modifier"> 62 <xsl:choose> 63 <xsl:when test="contains($language,'@')"> 64 <xsl:copy-of select="concat('@',substring-after($language,'@'))"/> 65 </xsl:when> 66 <xsl:otherwise> 67 <xsl:copy-of select="''"/> 68 </xsl:otherwise> 69 </xsl:choose> 70 </xsl:variable> 36 71 37 72 <!-- simple instructions for removing .la files. --> … … 134 169 <!-- Non-package page --> 135 170 <xsl:otherwise> 136 <xsl:apply-templates select=".//screen" />171 <xsl:apply-templates select=".//screen" mode="not-pack"/> 137 172 </xsl:otherwise> 138 173 </xsl:choose> 139 174 <xsl:text>exit</xsl:text> 140 175 </exsl:document> 141 </xsl:if> 176 </xsl:if><!-- id!=bootscript or id!=systemd-units --> 142 177 </xsl:template> 143 178 … … 154 189 </xsl:when> 155 190 <xsl:when test="@role = 'qt4-prefix' or @role = 'qt5-prefix'"> 156 <xsl:apply-templates select=".//screen "/>191 <xsl:apply-templates select=".//screen[./userinput]"/> 157 192 </xsl:when> 158 193 <xsl:when test="@role = 'installation'"> … … 209 244 </xsl:if> 210 245 211 <xsl:apply-templates select=".//screen | .//para/command"/> 246 <xsl:apply-templates 247 select=".//screen[not(@role = 'nodump') and ./userinput] | 248 .//para/command"/> 212 249 <xsl:if test="$sudo = 'y'"> 213 250 <xsl:text>sudo /sbin/</xsl:text> … … 216 253 </xsl:when> 217 254 <xsl:when test="@role = 'configuration'"> 218 <xsl:apply-templates select=".//screen" mode="config"/> 255 <xsl:apply-templates mode="config" 256 select=".//screen[not(@role = 'nodump') and ./userinput]"/> 219 257 </xsl:when> 220 258 </xsl:choose> … … 456 494 </xsl:call-template> 457 495 </xsl:template> 496 497 <!--====================== Non package code =========================--> 498 499 <xsl:template match="screen" mode="not-pack"> 500 <xsl:choose> 501 <xsl:when test="ancestor::sect1[@id='postlfs-config-vimrc']"> 502 <xsl:text> 503 cat > ~/.vimrc <<EOF 504 </xsl:text> 505 <xsl:apply-templates/> 506 <xsl:text> 507 EOF 508 </xsl:text> 509 </xsl:when> 510 <xsl:otherwise> 511 <xsl:apply-templates select="." mode="config"/> 512 </xsl:otherwise> 513 </xsl:choose> 514 </xsl:template> 458 515 <!--======================== Commands code ==========================--> 459 516 … … 465 522 ancestor::sect2[@role='installation'] and 466 523 not(contains(string(),'useradd')) and 524 not(contains(string(),'usermod')) and 525 not(contains(string(),'icon-cache')) and 526 not(contains(string(),'desktop-database')) and 527 not(contains(string(),'compile-schemas')) and 467 528 not(contains(string(),'groupadd'))"> 468 529 <xsl:if test="not(preceding-sibling::screen[1][@role='root'])"> … … 705 766 706 767 <xsl:template match="replaceable"> 768 <xsl:choose> 769 <!-- When adding a user to a group, the book uses "username" in a replaceable 770 tag. Replace by the user name only if not running as root --> 771 <xsl:when test="contains(string(),'username') and $sudo='y'"> 772 <xsl:text>$USER</xsl:text> 773 </xsl:when> 774 <!-- The next three entries are for gpm. I guess those settings are OK 775 for a laptop or desktop. --> 776 <xsl:when test="contains(string(),'yourprotocol')"> 777 <xsl:text>imps2</xsl:text> 778 </xsl:when> 779 <xsl:when test="contains(string(),'yourdevice')"> 780 <xsl:text>/dev/input/mice</xsl:text> 781 </xsl:when> 782 <xsl:when test="contains(string(),'additional options')"/> 783 <!-- the book has four fields for language. The language param is 784 broken into four pieces above. We use the results here. --> 785 <xsl:when test="contains(string(),'<ll>')"> 786 <xsl:copy-of select="$lang-ll"/> 787 </xsl:when> 788 <xsl:when test="contains(string(),'<CC>')"> 789 <xsl:copy-of select="$lang-CC"/> 790 </xsl:when> 791 <xsl:when test="contains(string(),'<charmap>')"> 792 <xsl:copy-of select="$lang-charmap"/> 793 </xsl:when> 794 <xsl:when test="contains(string(),'@modifier')"> 795 <xsl:copy-of select="$lang-modifier"/> 796 </xsl:when> 797 <!-- At several places, the number of jobs is given as "N" in a replaceable 798 tag. We either detect "N" alone or <N> Replace N with 4. --> 799 <xsl:when test="contains(string(),'<N>') or string()='N'"> 800 <xsl:text>4</xsl:text> 801 </xsl:when> 802 <!-- Mercurial config file uses user_name. Replace only if non root. 803 Add a bogus mail field. That works for the proposed tests anyway. --> 804 <xsl:when test="contains(string(),'user_name') and $sudo='y'"> 805 <xsl:text>$USER ${USER}@mail.bogus</xsl:text> 806 </xsl:when> 807 <!-- Use the config for Gtk+3 as is --> 808 <xsl:when test="ancestor::sect1[@id='gtk3']"> 809 <xsl:copy-of select="string()"/> 810 </xsl:when> 811 <!-- Give 1Gb to fop. Hopefully, nobody has less RAM nowadays. --> 812 <xsl:when test="contains(string(),'RAM_Installed')"> 813 <xsl:text>1024</xsl:text> 814 </xsl:when> 815 <xsl:otherwise> 707 816 <xsl:text>**EDITME</xsl:text> 708 817 <xsl:apply-templates/> 709 818 <xsl:text>EDITME**</xsl:text> 819 </xsl:otherwise> 820 </xsl:choose> 710 821 </xsl:template> 711 822 712 823 <xsl:template match="replaceable" mode="root"> 713 <xsl:text>**EDITME</xsl:text> 714 <xsl:apply-templates/> 715 <xsl:text>EDITME**</xsl:text> 824 <xsl:apply-templates select="."/> 716 825 </xsl:template> 717 826
Note:
See TracChangeset
for help on using the changeset viewer.