From 4f3c433f7b72359c4186e8201ee20e415ddafc36 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Mon, 13 Jun 2016 16:51:45 +0000 Subject: [PATCH] Fix for using the BLFS "double" book. Note that it does not work if one of the revisions has been rendered, and you want to switch to the other one --- BLFS/Makefile | 22 +++++++++++++++++++--- BLFS/gen-special.sh | 2 +- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/BLFS/Makefile b/BLFS/Makefile index 0793109..bcf1da7 100644 --- a/BLFS/Makefile +++ b/BLFS/Makefile @@ -5,6 +5,16 @@ # $Id$ +ifeq ($(REV),) + REV = sysv +endif + +ifneq ($(REV),sysv) + ifneq ($(REV),systemd) + $(error The REV variable is $(REV), but can only be 'sysv' or 'systemd') + endif +endif + ifdef V Q = else @@ -97,10 +107,16 @@ $(XSLDIR)/specialCases.xsl: $(TOPDIR)/gen-special.sh $(BLFS_FULL) $(Q)$(TOPDIR)/gen-special.sh $(BLFS_FULL) $@ $(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL) - @echo "Validating the book..." $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP) - $(Q)xmllint --nonet --noent --xinclude --postvalid \ - -o $@ $(BLFS_XML)/index.xml + @echo "Adjusting for revision $(REV)..." + $(Q)xsltproc --nonet --xinclude \ + --stringparam profile.revision $(REV) \ + --output $(RENDERTMP)/blfs-prof.xml \ + $(BLFS_XML)/stylesheets/lfs-xsl/profile.xsl \ + $(BLFS_XML)/index.xml + @echo "Validating the book..." + $(Q)xmllint --nonet --noent --postvalid \ + -o $@ $(RENDERTMP)/blfs-prof.xml all: update $(BOOK_XML) diff --git a/BLFS/gen-special.sh b/BLFS/gen-special.sh index 916ea6d..4d83dce 100755 --- a/BLFS/gen-special.sh +++ b/BLFS/gen-special.sh @@ -34,7 +34,7 @@ BLFS_DIR=$3 if test -z "${BLFS_DIR}"; then BLFS_DIR=$(cd $(dirname ${BLFS_XML})/.. ; pwd);fi # Packages whose version does not begin with a number -EXCEPTIONS=$(grep 'ENTITY.*version[ ]*"[^0-9"&.].*[0-9]' $BLFS_XML | +EXCEPTIONS=$(grep 'ENTITY.*version[ ]*"[^0-9"&.].*[0-9]' ${BLFS_DIR}/packages.ent | sed 's@^[^"]*"\([^"]*\)".*@\1@') # Non-versioned packages: