diff options
author | Pierre Labastie <pierre.labastie@neuf.fr> | 2024-02-09 18:26:38 +0100 |
---|---|---|
committer | Pierre Labastie <pierre.labastie@neuf.fr> | 2024-02-09 18:26:38 +0100 |
commit | fb7af8c9acb4ce03219eebaf0204dd9b09c97975 (patch) | |
tree | 938505bccc0f6d36883944da8fc69f2c967c769b | |
parent | 41a4032ad6f67fec3622c725b2793836efcb319a (diff) | |
parent | 695a921796d38d5e5bb8725b27631a9d03723076 (diff) |
Merge branch 'ablfs-more' into trunk
I've used it for a while, and nothing bad seems to be occurring...
-rwxr-xr-x | BLFS/gen-special.sh | 89 | ||||
-rw-r--r-- | BLFS/xsl/gen_config.xsl | 5 | ||||
-rw-r--r-- | BLFS/xsl/gen_pkg_list.xsl | 6 | ||||
-rw-r--r-- | BLFS/xsl/make_book.xsl | 366 | ||||
-rw-r--r-- | BLFS/xsl/process-prompt.xsl | 99 | ||||
-rw-r--r-- | BLFS/xsl/process-replaceable.xsl | 12 | ||||
-rw-r--r-- | BLFS/xsl/scripts.xsl | 20 |
7 files changed, 447 insertions, 150 deletions
diff --git a/BLFS/gen-special.sh b/BLFS/gen-special.sh index 8b61d6817e..b64b7a21bc 100755 --- a/BLFS/gen-special.sh +++ b/BLFS/gen-special.sh @@ -59,13 +59,21 @@ EOF # Non-versionned packages. Add to NV_LIST if you need more. for nv_id in $NV_LIST; do +# Actually, kf5-intro contains some version info, so should be +# versioned. For other packages, we define version to 1.0.0 +# because the DTD needs a version tag. + DUM_VER=1.0.0 + if [ $nv_id = kf5-intro ]; then + DUM_VER=$(grep kf5-version $BLFS_DIR/packages.ent | \ + sed 's/[^"]*"\([^"]*\).*/\1/') + fi cat >>$SPECIAL_FILE << EOF <xsl:when test="@id='$nv_id'"> <xsl:text> </xsl:text> <package><xsl:text>
 </xsl:text> <xsl:element name="name">$nv_id</xsl:element> <xsl:text>
 </xsl:text> - <xsl:element name="version">1.0.0</xsl:element> + <xsl:element name="version">$DUM_VER</xsl:element> <xsl:if test="document(\$installed-packages)//package[name=current()/@id]"> <xsl:text>
 </xsl:text> @@ -87,10 +95,11 @@ for nv_id in $NV_LIST; do EOF done -# Taking packages inside x7proto etc, as versionned modules. +# Taking packages contained in pages installing several packages (x7* except +# x7driver, kf5-frameworks, and plasma5-all), as versionned modules. # We also write a dependency expansion when a dep is of the form -# xorg7-something. Since that is another template, we need -# a temporary file, which we shall concatenate at the end +# xorg7-something or kf5-frameworks or plasma5-build. Since that is another +# template, we need a temporary file, which we shall concatenate at the end cat >tmpfile << EOF <xsl:template name="expand-deps"> <xsl:param name="section"/> @@ -98,7 +107,9 @@ cat >tmpfile << EOF <xsl:param name="build"/> <xsl:choose> EOF -for file in $(ls ${BLFS_DIR}/x/installing/x7* | grep -v x7driver); do +for file in $(ls ${BLFS_DIR}/x/installing/x7* | grep -v x7driver) \ + ${BLFS_DIR}/kde/kf5/kf5-frameworks.xml \ + ${BLFS_DIR}/kde/plasma5/plasma-all.xml; do id=$(grep xreflabel $file | sed 's@.*id="\([^"]*\).*@\1@') cat >>$SPECIAL_FILE << EOF <xsl:when test="@id='$id'"> @@ -110,32 +121,31 @@ EOF cat >> tmpfile << EOF <xsl:when test="\$section='$id'"> EOF -# We extract the list of packages for an xorg page from -# the version part of the .xml file. Seems that -# the order is not always the same as in the "cat" command. -# So we have to read that command too, since it may be assumed +# We extract the list of packages for those pages from +# the "cat" command that creates the md5 file. We assume # that the preceding package is a dependency of the following, # except the first. - list_cat="$(sed -n '/>cat/,/EOF</p' $file | grep -v 'cat\|EOF\|#' | +# note that some pages may have several "cat" command, so we have to +# make a complex regex for the first line to save. All those lines have +# .md5 in them except the one for x7legacy that has .dat. +# we need also to remove lines beginning with #. +# Note that only xorg pages have '&' in them. So for kde +# pages, what is extracted it the full tarball name. + list_cat="$(sed -n '/>cat.*\.\(md5\|dat\)/,/EOF</p' $file | \ + grep -v '>cat\|EOF<\|#' | \ awk '{ print $NF }' | sed 's/-&.*//')" -# Rationale for the sed below: the following for breaks words at spaces (unless -# we tweak IFS). So replace spaces with commas in lines so that only newlines -# are separators. - for pack in \ - $(grep 'ENTITY.*version' $file | sed 's/[ ]\+/,/g'); do - packname=$(echo $pack | sed s'@.*ENTITY,\(.*\)-version.*@\1@') - packversion=$(echo $pack | sed 's@[^"]*"\([^"]*\).*@\1@') - precpack=NONE - for i in $list_cat; do - if [ "$i" = "$packname" ]; then break; fi - precpack=$i - done -# It may happen that packname is not in list_cat, because its entity -# is commented out in the xml, but we do not check that (too complicated). -# In that case, the whole list is scanned, and $precpack=$i at the end. -# when packname is found in the list $precpack!=$i. - if [ "$precpack" = "$i" ]; then continue; fi + precpack=NONE + for pack in $list_cat; do + if grep -q x7 $file; then # this is an xorg package + packname=$pack +# We extract the version from the ENTITY parts of the .xml file. + packversion=$(grep "ENTITY ${pack}-version" $file | \ + sed 's@[^"]*"\([^"]*\).*@\1@') + else + packname=${pack%-[[:digit:]]*} + packversion=$(echo $pack | sed 's/[^.]*-\([.[:digit:]]*\)\.tar.*/\1/') + fi cat >>$SPECIAL_FILE << EOF <module><xsl:text>
 </xsl:text> <xsl:element name="name">$packname</xsl:element> @@ -184,6 +194,31 @@ EOF #EOF precpack=$packname done +# We need a dummy package for plasma post install instructions + if [ $(basename $file .xml) = plasma-all ]; then + cat >>$SPECIAL_FILE << EOF + <module><xsl:text>
 </xsl:text> + <xsl:element name="name">plasma-post-install</xsl:element> + <xsl:element name="version">1.0.0</xsl:element> + <xsl:if test="document(\$installed-packages)//package[name='plasma-post-install']"> + <xsl:element name="inst-version"> + <xsl:value-of + select="document(\$installed-packages + )//package[name='plasma-post-install']/version"/> + </xsl:element> + </xsl:if> +<!-- Dependencies --> + <xsl:element name="dependency"> + <xsl:attribute name="status">required</xsl:attribute> + <xsl:attribute name="build">before</xsl:attribute> + <xsl:attribute name="name">$precpack</xsl:attribute> + <xsl:attribute name="type">ref</xsl:attribute> + </xsl:element> +<!-- End dependencies --> + </module> +EOF + fi + cat >>$SPECIAL_FILE << EOF </package> </xsl:when> diff --git a/BLFS/xsl/gen_config.xsl b/BLFS/xsl/gen_config.xsl index 63b376899d..d3326f8dc1 100644 --- a/BLFS/xsl/gen_config.xsl +++ b/BLFS/xsl/gen_config.xsl @@ -309,7 +309,10 @@ if	MENU_</xsl:text> <xsl:text>" 			default	</xsl:text> <xsl:choose> - <xsl:when test="contains(../name,'xorg')"> + <!-- for compound packages, default to selecting all the subpackages--> + <xsl:when test="contains(../name,'xorg') or + contains(../name,'plasma') or + contains(../name,'kf5')"> <xsl:text>y </xsl:text> diff --git a/BLFS/xsl/gen_pkg_list.xsl b/BLFS/xsl/gen_pkg_list.xsl index b069245dc4..b7426d10ae 100644 --- a/BLFS/xsl/gen_pkg_list.xsl +++ b/BLFS/xsl/gen_pkg_list.xsl @@ -358,8 +358,10 @@ <xsl:when test="ancestor::*[@id=current()/@linkend]"/> <!-- do not depend on something which is not a dependency --> <xsl:when test="@role='nodep'"/> -<!-- Call list expansion when we have an xorg7 series of packages --> - <xsl:when test="contains(@linkend,'xorg7-')"> +<!-- Call list expansion when we have a compound package --> + <xsl:when test="contains(@linkend,'xorg7-') or + @linkend='kf5-frameworks' or + @linkend='plasma5-build'"> <xsl:call-template name="expand-deps"> <xsl:with-param name="section"> <xsl:value-of select="@linkend"/> diff --git a/BLFS/xsl/make_book.xsl b/BLFS/xsl/make_book.xsl index 6e35b914c9..556ef375f8 100644 --- a/BLFS/xsl/make_book.xsl +++ b/BLFS/xsl/make_book.xsl @@ -57,19 +57,21 @@ <!-- apply-templates for each item in the list. Normally, those items are id of nodes. Those nodes can be sect1 (normal case), - sect2 (python modules or DBus bindings) - bridgehead (perl modules) - para (dependency of perl modules). + sect2 (python/perl modules/dependencies ) The templates after this one treat each of those cases. - However, some items are xorg package names, and not id. + However, some items are sub-packages of compound packages (xorg7-*, + kf5, plasma), and not id. We need special instructions in that case. The difficulty is that some of those names *are* id's, because they are referenced in the index. - Hopefully, none of those id's are sect{1,2}, bridgehead or para...--> + Hopefully, none of those id's are sect{1,2}... + We also need a special template for plasma-post-install, + because this one is not an id at all!--> <xsl:template name="apply-list"> <xsl:param name="list" select="''"/> <xsl:if test="string-length($list) > 0"> <xsl:choose> + <!-- iterate if there are several packages in list --> <xsl:when test="contains($list,' ')"> <xsl:call-template name="apply-list"> <xsl:with-param name="list" @@ -80,6 +82,8 @@ select="substring-after($list,' ')"/> </xsl:call-template> </xsl:when> + <!-- From now on, $list contains only one package --> + <!-- If it is a group, do nothing --> <xsl:when test="contains($list,'groupxx')"/> <xsl:otherwise> <xsl:variable name="is-lfs"> @@ -90,6 +94,7 @@ </xsl:variable> <xsl:choose> <xsl:when test="$is-lfs='true'"> + <!-- LFS package --> <xsl:message> <xsl:value-of select="$list"/> <xsl:text> is an lfs package</xsl:text> @@ -100,7 +105,7 @@ </xsl:call-template> </xsl:when> <xsl:when test="contains(concat($list,' '),'-pass1 ')"> -<!-- We need to do it only for sect1 and sect2, because of libva --> +<!-- We need to do it for both sect1 and sect2, because of libva --> <xsl:variable name="real-id" select="substring-before(concat($list,' '),'-pass1 ')"/> @@ -111,12 +116,21 @@ <xsl:apply-templates select="id($real-id)" mode="pass1-sect2"/> </xsl:if> </xsl:when> - <xsl:when test="not(id($list)[self::sect1 or self::sect2 or self::para or self::bridgehead])"> + <xsl:when test="$list='plasma-post-install'"> <xsl:apply-templates - select="//sect1[contains(@id,'xorg7') - and contains(string(.//userinput), - concat($list,'-'))]" - mode="xorg"> + select="//sect1[@id='plasma5-build']" + mode="plasma-post-install"/> + </xsl:when> + <xsl:when test="not(id($list)[self::sect1 or self::sect2])"> + <!-- This is a sub-package: parse the corresponding compound + package--> + <xsl:apply-templates + select="//sect1[(contains(@id,'xorg7') or + contains(@id,'frameworks') or + contains(@id,'plasma5')) + and .//userinput/literal[contains(string(), + concat($list,'-'))]]" + mode="compound"> <xsl:with-param name="package" select="$list"/> </xsl:apply-templates> </xsl:when> @@ -495,7 +509,7 @@ <!-- we have got an xorg package. We are at the installation page but now we need to make an autonomous page from the global one --> - <xsl:template match="sect1" mode="xorg"> + <xsl:template match="sect1" mode="compound"> <xsl:param name="package"/> <xsl:variable name="tarball"> <xsl:call-template name="tarball"> @@ -504,114 +518,146 @@ select="string(.//userinput[starts-with(string(),'cat ')])"/> </xsl:call-template> </xsl:variable> - <xsl:variable name="md5sum"> - <xsl:call-template name="md5sum"> - <xsl:with-param name="package" select="concat(' ',$package,'-')"/> - <xsl:with-param name="cat-md5" - select=".//userinput[starts-with(string(),'cat ')]"/> - </xsl:call-template> - </xsl:variable> - <xsl:variable name="download-dir"> - <xsl:call-template name="download-dir"> - <xsl:with-param name="package" select="concat(' ',$package,'-')"/> - <xsl:with-param name="cat-md5" - select=".//userinput[starts-with(string(),'cat ')]"/> - </xsl:call-template> - </xsl:variable> - <xsl:variable name="install-instructions"> - <xsl:call-template name="inst-instr"> - <xsl:with-param name="inst-instr" - select=".//userinput[starts-with(string(),'for ')]"/> - </xsl:call-template> - </xsl:variable> - <xsl:element name="sect1"> - <xsl:attribute name="id"><xsl:value-of select="$package"/></xsl:attribute> - <xsl:processing-instruction name="dbhtml"> - filename="<xsl:value-of select='$package'/>.html" - </xsl:processing-instruction> - <title><xsl:value-of select="$package"/></title> - <sect2 role="package"> - <title>Introduction to <xsl:value-of select="$package"/></title> - <bridgehead renderas="sect3">Package Information</bridgehead> - <itemizedlist spacing="compact"> - <listitem> - <para>Download (HTTP): <xsl:element name="ulink"> - <xsl:attribute name="url"> - <xsl:value-of - select=".//para[contains(string(),'(HTTP)')]/ulink/@url"/> - <xsl:value-of select="$download-dir"/> - <xsl:value-of select="$tarball"/> - </xsl:attribute> - </xsl:element> - </para> - </listitem> - <listitem> - <para>Download (FTP): <xsl:element name="ulink"> - <xsl:attribute name="url"> - <xsl:value-of - select=".//para[contains(string(),'(FTP)')]/ulink/@url"/> - <xsl:value-of select="$download-dir"/> - <xsl:value-of select="$tarball"/> - </xsl:attribute> - </xsl:element> - </para> - </listitem> - <listitem> - <para> - Download MD5 sum: <xsl:value-of select="$md5sum"/> - </para> - </listitem> - </itemizedlist> - <!-- If there is an additional download, we need to output that --> - <xsl:if test=".//bridgehead[contains(string(),'Additional')]"> - <xsl:copy-of - select=".//bridgehead[contains(string(),'Additional')]"/> - <xsl:copy-of - select=".//bridgehead[contains(string(),'Additional')] - /following-sibling::itemizedlist[1]"/> - </xsl:if> - </sect2> - <sect2 role="installation"> - <title>Installation of <xsl:value-of select="$package"/></title> - - <para> - Install <application><xsl:value-of select="$package"/></application> - by running the following commands: - </para> + <!-- Unfortunately, there are packages in kf5 and plasma5 that + starts in the same way: for example kwallet in kf5 + and kwallet-pam in plasma. So we may arrive here with + package=kwallet and tarball=kwallet-pam-(version).tar.xz. + We should not continue in this case. For checking, transform + digits into X, and check that package-X occurs in tarball. We + have to translate package too, since it may contain digits.--> + <xsl:if test= + "contains(translate($tarball,'0123456789','XXXXXXXXXX'), + concat(translate($package,'0123456789','XXXXXXXXXX'),'-X'))"> + <xsl:variable name="md5sum"> + <xsl:call-template name="md5sum"> + <xsl:with-param name="package" select="concat(' ',$package,'-')"/> + <xsl:with-param name="cat-md5" + select=".//userinput[starts-with(string(),'cat ')]"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="download-dir"> + <xsl:call-template name="download-dir"> + <xsl:with-param name="package" select="concat(' ',$package,'-')"/> + <xsl:with-param name="cat-md5" + select=".//userinput[starts-with(string(),'cat ')]"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="install-instructions"> + <xsl:call-template name="inst-instr"> + <xsl:with-param name="inst-instr" + select= + "substring-after( + substring-after(.//userinput[starts-with(string(),'for ') or + starts-with(string(),'while ')], + 'pushd'), + '
')"/> + <xsl:with-param name="package" select="$package"/> + </xsl:call-template> + </xsl:variable> + <xsl:element name="sect1"> + <xsl:attribute name="id"> + <xsl:value-of select="$package"/> + </xsl:attribute> + <xsl:processing-instruction name="dbhtml"> + filename="<xsl:value-of select='$package'/>.html" + </xsl:processing-instruction> + <title><xsl:value-of select="$package"/></title> + <sect2 role="package"> + <title>Introduction to <xsl:value-of select="$package"/></title> + <bridgehead renderas="sect3">Package Information</bridgehead> + <itemizedlist spacing="compact"> + <listitem> + <para>Download (HTTP): <xsl:element name="ulink"> + <xsl:attribute name="url"> + <xsl:value-of + select=".//para[contains(string(),'(HTTP)')]/ulink/@url"/> + <xsl:value-of select="$download-dir"/> + <!-- $download-dir contains the trailing / for xorg, + but not for KDE... --> + <xsl:if test="contains(@id,'frameworks') or + contains(@id,'plasma5')"> + <xsl:text>/</xsl:text> + </xsl:if> + <!-- Some kf5 packages are in a subdirectory --> + <xsl:if test="$package='khtml' or + $package='kdelibs4support' or + $package='kdesignerplugin' or + $package='kdewebkit' or + $package='kjs' or + $package='kjsembed' or + $package='kmediaplayer' or + $package='kross' or + $package='kxmlrpcclient'"> + <xsl:text>portingAids/</xsl:text> + </xsl:if> + <xsl:value-of select="$tarball"/> + </xsl:attribute> + </xsl:element> + </para> + </listitem> + <!-- don't use FTP, although they are available for xorg --> + <listitem> + <para>Download (FTP): <ulink url=" "/> + </para> + </listitem> + <listitem> + <para> + Download MD5 sum: <xsl:value-of select="$md5sum"/> + </para> + </listitem> + </itemizedlist> + <!-- If there is an additional download, we need to output that --> + <xsl:if test=".//bridgehead[contains(string(),'Additional')]"> + <xsl:copy-of + select=".//bridgehead[contains(string(),'Additional')]"/> + <xsl:copy-of + select=".//bridgehead[contains(string(),'Additional')] + /following-sibling::itemizedlist[1]"/> + </xsl:if> + </sect2> + <sect2 role="installation"> + <title>Installation of <xsl:value-of select="$package"/></title> - <screen><userinput>packagedir=<xsl:value-of - select="substring-before($tarball,'.tar.')"/> - <xsl:text>
</xsl:text> - <xsl:value-of select="substring-before($install-instructions, - 'as_root')"/> - </userinput></screen> + <para> + Install <application><xsl:value-of select="$package"/></application> + by running the following commands: + </para> + <!-- packagedir is used in xorg lib instructions --> + <screen><userinput>packagedir=<xsl:value-of + select="substring-before($tarball,'.tar.')"/> + <!-- name is used in kf5 instructions --> + <xsl:text> +name=$(echo $packagedir | sed 's/-[[:digit:]].*//') +</xsl:text> + <xsl:value-of select="substring-before($install-instructions, + 'as_root')"/> + </userinput></screen> - <para> - Now as the <systemitem class="username">root</systemitem> user: - </para> - <screen role='root'> - <userinput><xsl:value-of select="substring-after( - $install-instructions, - 'as_root')"/> - </userinput> - </screen> - </sect2> - </xsl:element><!-- sect1 --> + <para> + Now as the <systemitem class="username">root</systemitem> user: + </para> + <screen role='root'> + <userinput><xsl:value-of select="substring-after( + $install-instructions, + 'as_root')"/> + </userinput> + </screen> + </sect2> + </xsl:element><!-- sect1 --> + </xsl:if> </xsl:template> <!-- get the tarball name from the text that comes from the .md5 file --> <xsl:template name="tarball"> + <!-- $package must start with a space, and finish with a "-", to be + sure to match exactly the package. Note that if we have two + packages named e.g. "pkg1" and "pkg1-add", the second one may be + matched by " pkg1-". So this only works if "pkg1" comes before + "pkg1-add" in the md5 file. Presently this is the case in the book... + --> <xsl:param name="package"/> <xsl:param name="cat-md5"/> -<!-- DEBUG -<xsl:message><xsl:text>Entering "tarball" template: - package is: </xsl:text> -<xsl:value-of select="$package"/><xsl:text> - cat-md5 is: </xsl:text> -<xsl:value-of select="$cat-md5"/> -</xsl:message> -END DEBUG --> <xsl:choose> <xsl:when test="contains(substring-before($cat-md5,$package),'
')"> <xsl:call-template name="tarball"> @@ -679,19 +725,103 @@ END DEBUG --> </xsl:template> <xsl:template name="inst-instr"> + <!-- This template is necessary because of the "libpciaccess" case in Xorg + libraries and the "kapidox" case in kf5: + Normally, the general instructions extract the package and change + to the extracted dir for running the installation instructions. + When installing a sub-package of a compound package, the installation + instructions to be run are located between a pushd and a popd, + *except* for Xorg libraries and kf5, where a popd occurs inside a + case for libpciaccess and kapidox... + So we call this template with a "inst-instr" string that contains + everything after the pushd.--> <xsl:param name="inst-instr"/> + <xsl:param name="package"/> <xsl:choose> - <xsl:when test="contains($inst-instr,'pushd')"> - <xsl:call-template name="inst-instr"> - <xsl:with-param name="inst-instr" - select="substring-after( - substring-after($inst-instr,'pushd'), - '
')"/> - </xsl:call-template> + <!-- first the cases where there are two "popd"--> + <xsl:when test="contains(substring-after($inst-instr,'popd'),'popd')"> + <xsl:choose> + <xsl:when test="$package='kapidox'"> + <!-- only the instructions inside the "case" and before popd --> + <xsl:copy-of select="substring-after(substring-before($inst-instr,'popd'),'kapidox)')"/> + </xsl:when> + <xsl:when test="$package='libpciaccess'"> + <!-- only the instructions inside the "case" and before popd --> + <xsl:copy-of select="substring-after(substring-before($inst-instr,'popd'),'libpciaccess* )')"/> + </xsl:when> + <xsl:otherwise> + <!-- We first copy what is before the first "as_root", then what is + after the first "popd", by calling the template again. The + reason for excluding "as_root" is that the output template takes + special action when it sees "as_root", which generates bogus code + if there are several of those...--> + <xsl:copy-of select="substring-before($inst-instr,'as_root')"/> + <xsl:call-template name="inst-instr"> + <xsl:with-param + name="inst-instr" + select="substring-after($inst-instr,'popd')"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> </xsl:when> <xsl:otherwise> + <!-- normal case: everything that is before popd --> <xsl:copy-of select="substring-before($inst-instr,'popd')"/> </xsl:otherwise> </xsl:choose> </xsl:template> + + <xsl:template match="sect1" mode="plasma-post-install"> + <xsl:variable name="package" select="'plasma-post-install'"/> + <xsl:element name="sect1"> + <xsl:attribute name="id"> + <xsl:value-of select="$package"/> + </xsl:attribute> + <xsl:processing-instruction name="dbhtml"> + filename="<xsl:value-of select='$package'/>.html" + </xsl:processing-instruction> + <title><xsl:value-of select="$package"/></title> + <sect2 role="installation"> + <title>Installation of <xsl:value-of select="$package"/></title> + + <para> + Install <application><xsl:value-of select="$package"/></application> + by running the following commands: + </para> + <screen role="root"> + <userinput> + <xsl:call-template name="plasma-sessions"> + <xsl:with-param + name="p-sessions-text" + select="string(.//userinput[contains(text(),'xsessions')])"/> + </xsl:call-template> + </userinput> + </screen> + <xsl:copy-of select=".//screen[@role='root']"/> + </sect2> + </xsl:element><!-- sect1 --> + </xsl:template> + + <xsl:template name="plasma-sessions"> + <xsl:param name="p-sessions-text"/> + <xsl:choose> + <xsl:when test="string-length($p-sessions-text)=0"/> + <xsl:when test="contains($p-sessions-text,'as_root')"> + <xsl:call-template name="plasma-sessions"> + <xsl:with-param + name="p-sessions-text" + select="substring-before($p-sessions-text,'as_root')"/> + </xsl:call-template> + <xsl:call-template name="plasma-sessions"> + <xsl:with-param + name="p-sessions-text" + select="substring-after($p-sessions-text,'as_root ')"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="$p-sessions-text"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + </xsl:stylesheet> diff --git a/BLFS/xsl/process-prompt.xsl b/BLFS/xsl/process-prompt.xsl new file mode 100644 index 0000000000..8f3457cdef --- /dev/null +++ b/BLFS/xsl/process-prompt.xsl @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:template name="process-prompt"> + <xsl:param name="instructions"/> + <xsl:param name="root-seen"/> + <xsl:param name="prompt-seen"/> + +<!-- Isolate the current instruction --> + <xsl:variable name="current-instr" select="$instructions[1]"/> + + <xsl:choose> +<!--============================================================--> +<!-- First, if we have an empty tree, close everything and exit --> + <xsl:when test="not($current-instr)"> + <xsl:if test="$prompt-seen"> + <xsl:call-template name="end-prompt"/> + </xsl:if> + <xsl:if test="$root-seen"> + <xsl:call-template name="end-root"/> + </xsl:if> + </xsl:when><!-- end empty tree --> +<!--============================================================--> + <xsl:when test="$current-instr[@role='root']"> + <xsl:choose> + <xsl:when test="$current-instr//prompt"> + <xsl:if test="not($root-seen)"> + <xsl:call-template name="begin-root"/> + </xsl:if> + <xsl:text>
</xsl:text> + <xsl:if test="not($prompt-seen)"> + <xsl:copy-of + select="substring-before($current-instr//text()[1],'
')"/> + <xsl:text> << PROMPT_EOF +</xsl:text> + </xsl:if> + <xsl:apply-templates + select="$current-instr/userinput/node()[position()>1]"/> + <xsl:call-template name="process-prompt"> + <xsl:with-param + name="instructions" + select="$instructions[position()>1]"/> + <xsl:with-param name="root-seen" select="boolean(1)"/> + <xsl:with-param name="prompt-seen" select="boolean(1)"/> + </xsl:call-template> + </xsl:when><!-- end prompt as root --> +<!--____________________________________________________________ --> + <xsl:otherwise><!-- we have no prompt --> + <xsl:if test="$prompt-seen"> + <xsl:text> +quit +PROMPT_EOF</xsl:text> + </xsl:if> + <xsl:apply-templates + select="$current-instr" + mode="config"/> + <!-- the above will call "end-root" if the next screen + sibling is not role="root". We need to pass root-seen=false + in this case. Otherwise, we need to pass root-seen=true. + So create a variable --> + <xsl:variable name="rs" + select="$instructions[2][@role='root']"/> + <xsl:call-template name="process-prompt"> + <xsl:with-param + name="instructions" + select="$instructions[position()>1]"/> + <xsl:with-param name="root-seen" select="boolean($rs)"/> + <xsl:with-param name="prompt-seen" select="boolean(0)"/> + </xsl:call-template> + </xsl:otherwise><!-- end no prompt --> +<!--____________________________________________________________ --> + </xsl:choose> + </xsl:when><!-- role="root" --> +<!--============================================================--> + <xsl:otherwise><!-- no role --> + <xsl:if test="$prompt-seen"> + <xsl:text> +quit +PROMPT_EOF</xsl:text> + </xsl:if> + <xsl:if test="$root-seen"> + <xsl:call-template name="end-root"/> + </xsl:if> + <xsl:apply-templates select="$current-instr/userinput"/> + <xsl:call-template name="process-prompt"> + <xsl:with-param + name="instructions" + select="$instructions[position()>1]"/> + <xsl:with-param name="root-seen" select="boolean(0)"/> + <xsl:with-param name="prompt-seen" select="boolean(0)"/> + </xsl:call-template> + </xsl:otherwise><!-- no role --> +<!--============================================================--> + </xsl:choose> + </xsl:template> + + <xsl:template match="prompt"/> +</xsl:stylesheet> diff --git a/BLFS/xsl/process-replaceable.xsl b/BLFS/xsl/process-replaceable.xsl index ca61b601a6..194feac28e 100644 --- a/BLFS/xsl/process-replaceable.xsl +++ b/BLFS/xsl/process-replaceable.xsl @@ -112,6 +112,9 @@ <!-- for MIT-Kerberos config file --> <xsl:when test="string()='<EXAMPLE.ORG>'"> <xsl:copy-of select="$DOMAINNAME"/> + <xsl:if test="contains(preceding-sibling::text()[1],'kdb5_util')"> + <xsl:text> -P rtpw </xsl:text> + </xsl:if> </xsl:when> <xsl:when test="string()='<example.org>'"> <xsl:copy-of select="$domainname"/> @@ -121,7 +124,16 @@ </xsl:when> <!-- in this case, even root can be used --> <xsl:when test="string()='<loginname>'"> + <xsl:if test="contains(preceding-sibling::text()[1],'-policy')"> + <xsl:text>-pw lupw </xsl:text> + </xsl:if> <xsl:text>$USER</xsl:text> + <xsl:if test="contains(preceding-sibling::text()[1],'kinit')"> + <xsl:text> << PASS_EOF +lupw +PASS_EOF +</xsl:text> + </xsl:if> </xsl:when> <!-- for xorg environment. Note that libreoffice too uses <PREFIX> --> <xsl:when test="string()='<PREFIX>' and diff --git a/BLFS/xsl/scripts.xsl b/BLFS/xsl/scripts.xsl index ad6612ad66..6c2997c19a 100644 --- a/BLFS/xsl/scripts.xsl +++ b/BLFS/xsl/scripts.xsl @@ -80,6 +80,9 @@ done</xsl:variable> <!-- include the template for replaceable tags --> <xsl:include href="process-replaceable.xsl"/> +<!-- include the template for prompt tags --> + <xsl:include href="process-prompt.xsl"/> + <!--=================== Begin processing ========================--> <xsl:template match="/"> @@ -385,8 +388,21 @@ echo Start Time: ${SECONDS} >> $INFOLOG <xsl:when test="@role = 'configuration'"> <xsl:text>
</xsl:text> - <xsl:apply-templates mode="config" - select=".//screen[not(@role = 'nodump') and ./userinput]"/> + <xsl:choose> + <xsl:when test=".//screen/userinput/prompt"> + <xsl:call-template name="process-prompt"> + <xsl:with-param + name="instructions" + select=".//screen[not(@role = 'nodump') and ./userinput]"/> + <xsl:with-param name="root-seen" select="false"/> + <xsl:with-param name="prompt-seen" select="false"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates mode="config" + select=".//screen[not(@role = 'nodump') and ./userinput]"/> + </xsl:otherwise> + </xsl:choose> </xsl:when><!-- @role="configuration" --> </xsl:choose> |