From 1ff67686df30c2c59dbbeb2d5bcda3617a361f0f Mon Sep 17 00:00:00 2001 From: George Boudreau Date: Fri, 23 Jun 2006 22:25:53 +0000 Subject: [PATCH] Reworked book extraction code.. will handle future changes --- common/common-functions | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/common/common-functions b/common/common-functions index 46f433a..aeaf12a 100644 --- a/common/common-functions +++ b/common/common-functions @@ -580,16 +580,18 @@ get_book() { # # sources. if [ -d ${PROGNAME}-$LFSVRS ] ; then cd ${PROGNAME}-$LFSVRS - if LC_ALL=C svn up | grep -q At && test -d $JHALFSDIR/${PROGNAME}-commands && \ - test -f $JHALFSDIR/pkg_tarball_list ; then - echo -ne "done\n" + if LC_ALL=C svn up | grep -q At && \ + test -d $JHALFSDIR/${PROGNAME}-commands && \ + test -f $JHALFSDIR/pkg_tarball_list ; then # Set the canonical book version + echo -ne "done\n" cd $JHALFSDIR - VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@@@'` - # Another work-around, clfs book has a x.x.x-date versioning system - if [ "$PROGNAME" = "clfs" ]; then - VERSION=${VERSION##*-} - fi + case $PROGNAME in + 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/<\/.*//') ;; + esac get_sources else echo -ne "done\n" @@ -603,10 +605,12 @@ get_book() { # echo -ne "done\n" extract_commands fi + else echo -ne "Using $BOOK as book's sources ...\n" extract_commands fi + echo -ne " Document version ${L_arrow}${BOLD}${VERSION}${R_arrow}\n" } #----------------------------# @@ -618,11 +622,12 @@ extract_commands() { # exit 1" cd $JHALFSDIR - VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@@@'` - # Another work-around, clfs book has a x.x.x-date versioning system - if [ "$PROGNAME" = "clfs" ]; then - VERSION=${VERSION##*-} - fi + case $PROGNAME in + 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/<\/.*//') ;; + esac # Start clean if [ -d ${PROGNAME}-commands ]; then