From c048987a2cafde63c769ce727b1773da44e88f65 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Tue, 16 Apr 2019 07:30:02 +0000 Subject: [PATCH] BLFS: fix generation of install and test instructions (ticket #1721): - add a gen-install.xsl stylesheet for grouping all cases - add a mode="installation" attribute for templates - rewrite sect2 template so that the right templates are applied - adapt other templates so that they are compatible - rewording of some comments (no direct relation with the ticket) --- BLFS/xsl/gen-install.xsl | 257 +++++++++++++++++++++++++++++ BLFS/xsl/scripts.xsl | 342 ++++++++++++++++++--------------------- 2 files changed, 412 insertions(+), 187 deletions(-) create mode 100644 BLFS/xsl/gen-install.xsl diff --git a/BLFS/xsl/gen-install.xsl b/BLFS/xsl/gen-install.xsl new file mode 100644 index 0000000..f218c26 --- /dev/null +++ b/BLFS/xsl/gen-install.xsl @@ -0,0 +1,257 @@ + + + + + + + + + + + + + non-root + + + config + + + install + + + + + + + + + + none + + + non-root + + + config + + + install + + + + + + + + + + none + + + non-root + + + config + + + install + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + sudo -E sh << ROOT_EOF + + + + + + + if [ -r "$JH_PACK_INSTALL" ]; then + source $JH_PACK_INSTALL + export -f wrapInstall + export -f packInstall +fi +wrapInstall ' + + + + + + + ROOT_EOF + + + + + + + + + + + + ' packInstall + + + + + + + + + + + + + + + + + '\'' + + + + + + + + + + + + + diff --git a/BLFS/xsl/scripts.xsl b/BLFS/xsl/scripts.xsl index 8d06991..0407720 100644 --- a/BLFS/xsl/scripts.xsl +++ b/BLFS/xsl/scripts.xsl @@ -9,7 +9,8 @@ - + + @@ -80,64 +81,74 @@ done - + + + + ' + + + + + + + - + - - - + + - - - - - - 00 - - - - 0 - - - - - - - + + + + + + 00 + + + + 0 + + + + + + + - - SCRIPT is - - FTPDIR is - - - + + SCRIPT is + + FTPDIR is + + + - - - #!/bin/bash + + + #!/bin/bash set -e unset MAKELEVEL - + - - - - - export JH_PKG_DIR= - - + + + + + export JH_PKG_DIR= + + SRC_DIR=${JH_SRC_ARCHIVE}${JH_SRC_SUBDIRS:+/${JH_PKG_DIR}} BUILD_DIR=${JH_BUILD_ROOT}${JH_BUILD_SUBDIRS:+/${JH_PKG_DIR}} mkdir -p $SRC_DIR @@ -146,54 +157,56 @@ mkdir -p $BUILD_DIR - - INFOLOG=$(pwd)/info-${JH_PKG_DIR} + + INFOLOG=$(pwd)/info-${JH_PKG_DIR} TESTLOG=$(pwd)/test-${JH_PKG_DIR} unset MAKEFLAGS #MAKEFLAGS=-j4 echo MAKEFLAGS: $MAKEFLAGS > $INFOLOG -> $TESTLOG +: > $TESTLOG PKG_DEST=${BUILD_DIR}/dest rm -rf $PKG_DEST - - - - - cd $BUILD_DIR + + + + + cd $BUILD_DIR [[ -n "$JH_KEEP_FILES" ]] || - - - sudo - - rm -rf $JH_UNPACKDIR unpacked - - - - - - - exit - - + + + sudo + + rm -rf $JH_UNPACKDIR unpacked + + + + + + + exit + + cd $SRC_DIR - + + + cd $BUILD_DIR @@ -248,17 +261,21 @@ cd $JH_UNPACKDIR + .//para/command[contains(text(),'check') or + contains(text(),'test')]"/> sudo /sbin/ ldconfig - + + - + + @@ -517,75 +534,30 @@ EOF + - - - - - - - - - - sudo -E sh << ROOT_EOF - - - if [ -r "$JH_PACK_INSTALL" ]; then - source $JH_PACK_INSTALL - export -f wrapInstall - export -f packInstall -fi -wrapInstall ' - - + + + + + + sudo -E sh << ROOT_EOF - - - - - - - - - ' packInstall - - - ROOT_EOF - + + + + + ROOT_EOF - - - - - - sudo -E sh << ROOT_EOF - - - - - - ROOT_EOF - - - + + - - - - - - + + + + + @@ -652,42 +624,61 @@ popd - + - - - + + + + + echo Time after make: ${SECONDS} >> $INFOLOG echo Size after make: $(sudo du -skx --exclude home /) >> $INFOLOG echo Time before test: ${SECONDS} >> $INFOLOG + - - - # - - - - - - make - - -k - - - - - - - - - >> $TESTLOG 2>&1 - - || true + + + + # + + + + + + make + + -k + + + + + + + + + >> $TESTLOG 2>&1 + || true + + +echo Time after test: ${SECONDS} >> $INFOLOG +echo Size after test: $(sudo du -skx --exclude home /) >> $INFOLOG +echo Time before install: ${SECONDS} >> $INFOLOG + + + @@ -700,8 +691,6 @@ echo Time before test: ${SECONDS} >> $INFOLOG - ' - @@ -749,19 +738,6 @@ echo Time before test: ${SECONDS} >> $INFOLOG select="substring-after($out-string,'\')"/> - - - - - '\'' - - - - @@ -829,14 +805,6 @@ echo Time before test: ${SECONDS} >> $INFOLOG - - -echo Time after tests: ${SECONDS} >> $INFOLOG -echo Size after tests: $(sudo du -skx --exclude home /) >> $INFOLOG -echo Time before install: ${SECONDS} >> $INFOLOG -