r2806 - jhalfs/trunk/common

georgeb at linuxfromscratch.org georgeb at linuxfromscratch.org
Fri Jun 23 15:25:53 PDT 2006


Author: georgeb
Date: 2006-06-23 16:25:53 -0600 (Fri, 23 Jun 2006)
New Revision: 2806

Modified:
   jhalfs/trunk/common/common-functions
Log:
Reworked book  extraction code.. will handle future changes

Modified: jhalfs/trunk/common/common-functions
===================================================================
--- jhalfs/trunk/common/common-functions	2006-06-23 18:39:04 UTC (rev 2805)
+++ jhalfs/trunk/common/common-functions	2006-06-23 22:25:53 UTC (rev 2806)
@@ -580,16 +580,18 @@
     # 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@<!ENTITY version "@@;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 @@
       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 @@
   exit 1"
 
   cd $JHALFSDIR
-  VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;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




More information about the alfs-log mailing list