From d236bbdf03a9d59796227d69be66fa6b6950dc36 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Sun, 31 Mar 2013 17:25:21 +0000 Subject: [PATCH] BLFS tools: - Separates the groups of xorg package into individual builds --- BLFS/gen-special.sh | 151 ++++++++++++++++++++++++-------- BLFS/xsl/gen_config.xsl | 12 ++- BLFS/xsl/gen_pkg_list.xsl | 34 ++++--- BLFS/xsl/make_book.xsl | 180 +++++++++++++++++++++++++++++++++++++- 4 files changed, 325 insertions(+), 52 deletions(-) diff --git a/BLFS/gen-special.sh b/BLFS/gen-special.sh index 3949d07..b502cab 100755 --- a/BLFS/gen-special.sh +++ b/BLFS/gen-special.sh @@ -2,20 +2,38 @@ # $Id: gen-special.sh 21 2012-02-16 15:06:19Z labastie $ +#------------------------------------------------------------------------- +# generates an xsl stylesheet containing a template for special +# cases in the book: +# - If the version does not begin with a number, it is impossible to know +# where the package name ends and where the version begins. We therefore +# use the ENTITY at the beginning of the validated full-xml. +# - If a package is part of a group of xorg packages (proto, fonts, etc) +# there is no easy way to extract it from the xml. We use the ENTITY at +# the top of each file x7*.xml +# - If a pacakge is versioned but the version is not mentioned in the book +# (currently only udev), we retrieve the version by other means +#------------------------------------------------------------------------- +# Arguments: +# $1 contains the name of the validated xml book +# $2 contains the name of the ouput xsl file +# $3 contains the name of the book sources directory +#------------------------------------------------------------------------- + BLFS_XML=$1 if ! test -f ${BLFS_XML}; then - echo ${BLFS_XML} does not exist + echo File \`${BLFS_XML}\' does not exist exit 1 fi SPECIAL_FILE=$2 if test -z "${SPECIAL_FILE}"; then SPECIAL_FILE=specialCases.xsl;fi +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 | sed 's@^[^"]*"\([^"]*\)".*@\1@') -# Version for X Window packages without a version in the book -XVERSION=$(grep 'ENTITY xorg-version' $BLFS_XML | - sed 's@^[^"]*"\([^"]*\)".*@\1@') -# The case of udev + # Set PATH to be sure to find udevadm SAVPATH=$PATH PATH=/bin:/sbin:/usr/bin:/usr/sbin @@ -29,7 +47,7 @@ cat >$SPECIAL_FILE << EOF - + @@ -53,46 +71,94 @@ cat >$SPECIAL_FILE << EOF + - +EOF + +# Taking packages inside x7proto etc, 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 +cat >tmpfile << EOF + + + + +EOF +for file in $(ls ${BLFS_DIR}/x/installing/x7* | grep -v x7driver); do + id=$(grep xreflabel $file | sed 's@.*id="\([^"]*\).*@\1@') + cat >>$SPECIAL_FILE << EOF + - + $id - $XVERSION - - - - - - +EOF + cat >> tmpfile << EOF + +EOF +# In the list, the preceding package is a dependency of the following, +# except the first: + precpack=NONE +# 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@') + cat >>$SPECIAL_FILE << EOF + + $packname + $packversion + + + + + - - +EOF + if test $precpack != NONE; then + cat >>$SPECIAL_FILE << EOF + + required + $precpack + ref + +EOF + else + cat >>$SPECIAL_FILE << EOF + +EOF + fi + cat >>$SPECIAL_FILE << EOF + + +EOF + cat >> tmpfile << EOF - required - - + + + $packname ref - - - - - EOF + precpack=$packname + done + cat >>$SPECIAL_FILE << EOF + + +EOF + cat >> tmpfile << EOF + +EOF +done for ver_ent in $EXCEPTIONS; do id=$(grep 'xreflabel=".*'$ver_ent $BLFS_XML | sed 's@.*id="\([^"]*\)".*@\1@') @@ -137,6 +203,17 @@ cat >>$SPECIAL_FILE << EOF - +EOF +cat $SPECIAL_FILE tmpfile > tmpfile1 +mv tmpfile1 $SPECIAL_FILE +rm tmpfile +cat >> $SPECIAL_FILE << EOF + + + You should not be seeing this + + + + EOF diff --git a/BLFS/xsl/gen_config.xsl b/BLFS/xsl/gen_config.xsl index 22680e8..c846c95 100644 --- a/BLFS/xsl/gen_config.xsl +++ b/BLFS/xsl/gen_config.xsl @@ -181,9 +181,19 @@ depends MENU_ ] " - default n + default + + + y + + + n + + + + diff --git a/BLFS/xsl/gen_pkg_list.xsl b/BLFS/xsl/gen_pkg_list.xsl index 58fc5f9..c6d2372 100644 --- a/BLFS/xsl/gen_pkg_list.xsl +++ b/BLFS/xsl/gen_pkg_list.xsl @@ -256,17 +256,31 @@ - + + + + + + + + + + + + + - - - - - - - - ref - + + + + + + + + ref + + + diff --git a/BLFS/xsl/make_book.xsl b/BLFS/xsl/make_book.xsl index de4e91e..ea74a55 100644 --- a/BLFS/xsl/make_book.xsl +++ b/BLFS/xsl/make_book.xsl @@ -34,25 +34,45 @@ - + The templates after this one treat each of those cases. + However, some items are xorg package names, 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...--> - + + + - + + + + + + + + + + @@ -265,4 +285,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + filename=".html" + + <xsl:value-of select="$package"/> + + Introduction to <xsl:value-of select="$package"/> + Package Information + + + Download (HTTP): + + + + + + + + + Download (FTP): + + + + + + + + + + Download MD5 sum: + + + + + + Installation of <xsl:value-of select="$package"/> + + + Install + by running the following commands: + + + packagedir= + + + + + + Now as the root user: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +