From a6655ffd7dd8b1b6ac5c46f80437434e6d29de78 Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Sun, 16 Jul 2006 10:06:03 +0000 Subject: [PATCH] Avoiding hardcoded supported books versions. --- CLFS/config | 1 + HLFS/config | 1 + LFS/config | 1 + common/common-functions | 19 ++++++++++--------- common/func_validate_configs.sh | 2 +- master.sh | 31 ++++++++++++++++--------------- 6 files changed, 30 insertions(+), 25 deletions(-) diff --git a/CLFS/config b/CLFS/config index 5e1c455..64aff76 100644 --- a/CLFS/config +++ b/CLFS/config @@ -68,6 +68,7 @@ XSL=clfs.xsl #--- Book version LFSVRS=development +TREE=trunk/BOOK #--- Name of the makefile MKFILE=$JHALFSDIR/Makefile diff --git a/HLFS/config b/HLFS/config index cb34228..378b7c0 100644 --- a/HLFS/config +++ b/HLFS/config @@ -38,6 +38,7 @@ XSL=hlfs.xsl #--- Book version LFSVRS=development +TREE=trunk/BOOK #--- Name of the makefile MKFILE=$JHALFSDIR/Makefile diff --git a/LFS/config b/LFS/config index a1388c0..a58f968 100644 --- a/LFS/config +++ b/LFS/config @@ -32,6 +32,7 @@ XSL=lfs.xsl #--- Book version LFSVRS=development +TREE=trunk/BOOK #--- Name of the makefile MKFILE=$JHALFSDIR/Makefile diff --git a/common/common-functions b/common/common-functions index 077b9eb..f67eb92 100644 --- a/common/common-functions +++ b/common/common-functions @@ -52,8 +52,12 @@ ${BOLD} -V, --version${OFF} ${BOLD} -B, --book VER${OFF} use VER version of the book as the system to build. - Supported versions are: dev*, trunk, SVN - These are aliases for the Development version of {C,H}LFS + Supported VER values are: + dev*, trunk, SVN = aliases for the Development version of {C,H}LFS + branch-NAME = a branch of name NAME + VERSION = the version of a stable released book + To know what branches and stable books works with this version of jhalfs + please see http://wiki.linuxfromscratch.org/alfs/wiki/SupportedBooks ${BOLD} -D --directory DIR${OFF} use DIR directory for building ${BOLD}$(echo $PROGNAME | tr [a-z] [A-Z])${OFF}; all files jhalfs produces @@ -653,7 +657,7 @@ get_book() { # test -d $JHALFSDIR/${PROGNAME}-commands && \ test -f $JHALFSDIR/pkg_tarball_list ; then # Set the canonical book version - echo -ne "done\n" + echo -ne "done\n" cd $JHALFSDIR case $PROGNAME in clfs) @@ -667,10 +671,7 @@ get_book() { # extract_commands fi else - case $LFSVRS in - development) - svn co $SVN/${svn_root}/trunk/BOOK ${PROGNAME}-$LFSVRS >>$LOGDIR/$LOG 2>&1 ;; - esac + svn co $SVN/${svn_root}/${TREE} ${PROGNAME}-$LFSVRS >>$LOGDIR/$LOG 2>&1 echo -ne "done\n" extract_commands fi @@ -679,7 +680,7 @@ get_book() { # echo -ne "Using $BOOK as book's sources ...\n" extract_commands fi - echo -ne " Document version ${L_arrow}${BOLD}${VERSION}${R_arrow}\n" + echo -ne " Document version ${L_arrow}${BOLD}${VERSION}${R_arrow}\n" } #----------------------------# @@ -692,7 +693,7 @@ extract_commands() { # cd $JHALFSDIR case $PROGNAME in - clfs) + clfs) VERSION=$(xmllint --noent $BOOK/prologue/$ARCH/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;; *) VERSION=$(xmllint --noent $BOOK/prologue/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;; diff --git a/common/func_validate_configs.sh b/common/func_validate_configs.sh index 526d962..1e51f02 100644 --- a/common/func_validate_configs.sh +++ b/common/func_validate_configs.sh @@ -216,7 +216,7 @@ inline_doc BOOK) if [[ "${WC}" = "1" ]] ; then validate_dir -z -d else - validate_against_str "x${PROGNAME}-developmentx" + validate_against_str "x${PROGNAME}-${LFSVRS}x" fi ;; # Validate directories, testable states: diff --git a/master.sh b/master.sh index 254e70b..8bab34f 100755 --- a/master.sh +++ b/master.sh @@ -105,22 +105,23 @@ while test $# -gt 0 ; do case $1 in dev* | SVN | trunk ) LFSVRS=development + TREE=trunk/BOOK ;; - *) if [[ "$PROGNAME" = "lfs" ]]; then - case $1 in - 6.1.1 ) - echo "For stable 6.1.1 book, please use jhalfs-0.2." - exit 0 - ;; - * ) - echo "$1 is an unsupported version at this time." - exit 0 - ;; - esac - else - echo "The requested version, ${L_arrow} ${BOLD}$1${OFF} ${R_arrow}, is undefined in the ${BOLD}$(echo $PROGNAME | tr [a-z] [A-Z])${OFF} series." - exit 0 - fi + branch-* ) + LFSVRS=$1 + TREE=branches/${1#branch-}/BOOK + ;; + * ) + case $PROGNAME in + lfs | hlfs ) + LFSVRS=$1 + TREE=tags/$1/BOOK + ;; + clfs ) + LFSVRS=$1 + TREE=tags/$1 + ;; + esac ;; esac ;;