When choosing the LFS book, we should not depend on docbook-xml. This is achieved by directly treating the revision attribute in lfs.xsl, instead of using profiling from docbook-xsl.

This commit is contained in:
Pierre Labastie 2017-03-27 09:40:41 +00:00
parent c67990fd77
commit 0ad3a337f1
2 changed files with 27 additions and 20 deletions

View file

@ -8,6 +8,10 @@
extension-element-prefixes="exsl"
version="1.0">
<!-- which revision attribute to include: can only be sysv or systemd,
but we leave checking to the caller-->
<xsl:param name="revision" select="'sysv'"/>
<!-- use package management ?
n = no, original behavior
y = yes, add PKG_DEST to scripts in install commands of chapter06-08
@ -44,7 +48,8 @@
<xsl:param name='full-locale' select='n'/>
<xsl:template match="/">
<xsl:apply-templates select="//sect1"/>
<xsl:apply-templates select="//sect1[not(@revision) or
@revision=$revision]"/>
</xsl:template>
<xsl:template match="sect1">
@ -123,9 +128,12 @@
<xsl:if test="sect2[@role='installation']">
<xsl:text>cd $PKGDIR&#xA;</xsl:text>
</xsl:if>
<xsl:apply-templates select="sect2|
screen[not(@role) or
@role!='nodump']/userinput"/>
<xsl:apply-templates select="sect2[not(@revision) or
@revision=$revision] |
screen[(not(@role) or
@role!='nodump') and
(not(@revision) or
@revision=$revision)]/userinput"/>
<xsl:if test="@id='ch-system-creatingdirs' and $pkgmngt='y'">
<xsl:apply-templates
select="document('packageManager.xml')//sect1[
@ -148,8 +156,10 @@
<xsl:template match="sect2">
<xsl:apply-templates
select=".//screen[not(@role) or
@role != 'nodump']/userinput[
select=".//screen[(not(@role) or
@role != 'nodump') and
(not(@revision) or
@revision=$revision)]/userinput[
@remap = 'pre' or
@remap = 'configure' or
@remap = 'make' or
@ -179,8 +189,10 @@ esac
</xsl:text>
</xsl:if>
<xsl:apply-templates
select=".//screen[not(@role) or
@role != 'nodump']/userinput[@remap = 'install']"/>
select=".//screen[(not(@role) or
@role != 'nodump') and
(not(@revision) or
@revision=$revision)]/userinput[@remap = 'install']"/>
<xsl:if test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
$pkgmngt = 'y' and
descendant::screen[not(@role) or
@ -255,8 +267,10 @@ fi
</xsl:if>
<xsl:apply-templates
select=".//screen[
not(@role) or
@role != 'nodump'
(not(@role) or
@role != 'nodump') and
(not(@revision) or
@revision=$revision)
]/userinput[
not(@remap) or
@remap='adjust' or

View file

@ -150,14 +150,9 @@ extract_commands() { #
fi
popd > /dev/null
xsltproc --nonet \
--xinclude \
--output /tmp/lfs-full.xml \
--stringparam profile.revision $INITSYS \
$BOOK/stylesheets/lfs-xsl/profile.xsl \
$BOOK/index.xml
xsltproc --nonet \
--xinclude \
--stringparam revision $INITSYS \
--stringparam testsuite $TEST \
--stringparam bomb-testsuite $BOMB_TEST \
--stringparam vim-lang $VIMLANG \
@ -168,9 +163,7 @@ extract_commands() { #
--stringparam pkgmngt $PKGMNGT \
--output ./${PROGNAME}-commands/ \
$XSL \
/tmp/lfs-full.xml >>$LOGDIR/$LOG 2>&1
rm /tmp/lfs-full.xml
$BOOK/index.xml
;;
*) echo -n " ${L_arrow}${PROGNAME}${R_arrow} book invalid, terminate build... "
exit 1 ;;