r3130 - jhalfs/branches/experimental

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sun Sep 17 03:26:57 PDT 2006


Author: manuel
Date: 2006-09-17 04:26:55 -0600 (Sun, 17 Sep 2006)
New Revision: 3130

Modified:
   jhalfs/branches/experimental/blfs-tool
   jhalfs/branches/experimental/jhalfs
Log:
Added version checks for DocBook XML dtd and XSL.
Added version checks to ./blfs-tool.
DocBook-XML-DTD and Tidy must be added yet to BLFS_TOOL installation dependencies.

Modified: jhalfs/branches/experimental/blfs-tool
===================================================================
--- jhalfs/branches/experimental/blfs-tool	2006-09-17 08:36:03 UTC (rev 3129)
+++ jhalfs/branches/experimental/blfs-tool	2006-09-17 10:26:55 UTC (rev 3130)
@@ -72,6 +72,11 @@
 [[ $? > 0 ]] && echo "file:configuration did not load.." && exit 1
 [[ $VERBOSITY > 0 ]] && echo "OK"
 
+[[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_check_version.sh>..."
+source $COMMON_DIR/func_check_version.sh
+[[ $? > 0 ]] && echo " function module did not load.." && exit 2
+[[ $VERBOSITY > 0 ]] && echo "OK"
+
 [[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_validate_configs.sh>..."
 source $COMMON_DIR/func_validate_configs.sh
 [[ $? > 0 ]] && echo " function module did not load.." && exit 2
@@ -94,6 +99,45 @@
             * )  TREE=tags/${BRANCH_ID}/BOOK ;;
 esac
 
+# Check for minimun dependencies versions
+xsltprocVer=`xsltproc -V | head -n1 `
+  libxmlVer=$(echo $xsltprocVer | cut -d " " -f3)
+ libxsltVer=$(echo $xsltprocVer | cut -d " " -f5)
+    tidyVer=`tidy -V | cut -d " " -f9`
+
+  # Version numbers are packed strings not xx.yy.zz format.
+check_version "2.06.20"  "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}"     "LIBXML2"
+check_version "1.01.14"  "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}"  "LIBXSLT"
+check_version "2004"     "${tidyVer}"                                             "TIDY"
+
+XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?>
+<?xml-stylesheet type='text/xsl' href='http://docbook.sourceforge.net/release/xsl/1.69.1/xhtml/docbook.xsl'?>
+<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'
+  'http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd'>
+<article>
+  <title>Test file</title>
+  <sect1>
+    <title>Some title</title>
+    <para>Some text</para>
+  </sect1>
+</article>"
+
+if `echo $XML_FILE | xmllint -noout -postvalid - 2>/dev/null` ; then
+  check_version "4.4" "4.4" "DocBook XML DTD"
+else
+  echo "Warning: not found a working DocBook XML DTD 4.4 installation"
+  exit 2
+fi
+
+if `echo $XML_FILE | xsltproc --noout - 2>/dev/null` ; then
+  check_version "1.69.1" "1.69.1" "DocBook XSL"
+else
+  echo "Warning: not found a working DocBook XSL 1.69.1 installation"
+  exit 2
+fi
+
+echo "${SD_BORDER}${nl_}"
+
 # For consistency with other books
 validate_config
 echo "${SD_BORDER}${nl_}"

Modified: jhalfs/branches/experimental/jhalfs
===================================================================
--- jhalfs/branches/experimental/jhalfs	2006-09-17 08:36:03 UTC (rev 3129)
+++ jhalfs/branches/experimental/jhalfs	2006-09-17 10:26:55 UTC (rev 3130)
@@ -249,6 +249,7 @@
 tarVer=`tar --version | head -n1 | cut -d " " -f4`
 check_version "1.15.0"  "${tarVer}"      "TAR"
 
+# Check for minimum sudo version
 SUDO_LOC="`whereis -b sudo | cut -d " " -f2`"
 if [ -x $SUDO_LOC ]; then
   sudoVer=`sudo -V | head -n1 | cut -d " " -f3`
@@ -258,16 +259,57 @@
   exit 1
 fi
 
+# Check for minimum libxml2 and libxslt versions
 xsltprocVer=`xsltproc -V | head -n1 `
   libxmlVer=$(echo $xsltprocVer | cut -d " " -f3)
  libxsltVer=$(echo $xsltprocVer | cut -d " " -f5)
-    tidyVer=`tidy -V | cut -d " " -f9`
-    
-# Version numbers are packed strings not xx.yy.zz format.
+
+  # Version numbers are packed strings not xx.yy.zz format.
 check_version "2.06.20"  "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}"     "LIBXML2"
 check_version "1.01.14"  "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}"  "LIBXSLT"
-check_version "2004"   "${tidyVer}"        "TIDY"
 
+# The next versions checks are required only when BLFS_TOOL is set and
+# this dependencies has not be selected for installation
+if [[ "$BLFS_TOOL" = "y" ]] ; then
+
+  if [[ -z "$DEP_TIDY" ]] ; then
+    tidyVer=`tidy -V | cut -d " " -f9`
+    check_version "2004" "${tidyVer}" "TIDY"
+  fi
+
+# Check if the proper DocBook-XML-DTD and DocBook-XSL are correctly installed
+XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?>
+<?xml-stylesheet type='text/xsl' href='http://docbook.sourceforge.net/release/xsl/1.69.1/xhtml/docbook.xsl'?>
+<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'
+  'http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd'>
+<article>
+  <title>Test file</title>
+  <sect1>
+    <title>Some title</title>
+    <para>Some text</para>
+  </sect1>
+</article>"
+
+  if [[ -z "$DEP_DBXML" ]] ; then
+    if `echo $XML_FILE | xmllint -noout -postvalid - 2>/dev/null` ; then
+      check_version "4.4" "4.4" "DocBook XML DTD"
+    else
+      echo "Warning: not found a working DocBook XML DTD 4.4 installation"
+      exit 2
+    fi
+  fi
+
+  if [[ -z "$DEP_DBXSL" ]] ; then
+    if `echo $XML_FILE | xsltproc --noout - 2>/dev/null` ; then
+      check_version "1.69.1" "1.69.1" "DocBook XSL"
+    else
+      echo "Warning: not found a working DocBook XSL 1.69.1 installation"
+      exit 2
+    fi
+  fi
+
+fi
+
 echo "${SD_BORDER}${nl_}"
 
 validate_config




More information about the alfs-log mailing list