Changeset 4abc9ec


Ignore:
Timestamp:
09/17/2006 10:26:55 AM (18 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
experimental
Children:
2020b1b
Parents:
6ef1f44
Message:

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.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • blfs-tool

    r6ef1f44 r4abc9ec  
    7373[[ $VERBOSITY > 0 ]] && echo "OK"
    7474
     75[[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_check_version.sh>..."
     76source $COMMON_DIR/func_check_version.sh
     77[[ $? > 0 ]] && echo " function module did not load.." && exit 2
     78[[ $VERBOSITY > 0 ]] && echo "OK"
     79
    7580[[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_validate_configs.sh>..."
    7681source $COMMON_DIR/func_validate_configs.sh
     
    9499            * )  TREE=tags/${BRANCH_ID}/BOOK ;;
    95100esac
     101
     102# Check for minimun dependencies versions
     103xsltprocVer=`xsltproc -V | head -n1 `
     104  libxmlVer=$(echo $xsltprocVer | cut -d " " -f3)
     105 libxsltVer=$(echo $xsltprocVer | cut -d " " -f5)
     106    tidyVer=`tidy -V | cut -d " " -f9`
     107
     108  # Version numbers are packed strings not xx.yy.zz format.
     109check_version "2.06.20"  "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}"     "LIBXML2"
     110check_version "1.01.14"  "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}"  "LIBXSLT"
     111check_version "2004"     "${tidyVer}"                                             "TIDY"
     112
     113XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?>
     114<?xml-stylesheet type='text/xsl' href='http://docbook.sourceforge.net/release/xsl/1.69.1/xhtml/docbook.xsl'?>
     115<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'
     116  'http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd'>
     117<article>
     118  <title>Test file</title>
     119  <sect1>
     120    <title>Some title</title>
     121    <para>Some text</para>
     122  </sect1>
     123</article>"
     124
     125if `echo $XML_FILE | xmllint -noout -postvalid - 2>/dev/null` ; then
     126  check_version "4.4" "4.4" "DocBook XML DTD"
     127else
     128  echo "Warning: not found a working DocBook XML DTD 4.4 installation"
     129  exit 2
     130fi
     131
     132if `echo $XML_FILE | xsltproc --noout - 2>/dev/null` ; then
     133  check_version "1.69.1" "1.69.1" "DocBook XSL"
     134else
     135  echo "Warning: not found a working DocBook XSL 1.69.1 installation"
     136  exit 2
     137fi
     138
     139echo "${SD_BORDER}${nl_}"
    96140
    97141# For consistency with other books
  • jhalfs

    r6ef1f44 r4abc9ec  
    250250check_version "1.15.0"  "${tarVer}"      "TAR"
    251251
     252# Check for minimum sudo version
    252253SUDO_LOC="`whereis -b sudo | cut -d " " -f2`"
    253254if [ -x $SUDO_LOC ]; then
     
    259260fi
    260261
     262# Check for minimum libxml2 and libxslt versions
    261263xsltprocVer=`xsltproc -V | head -n1 `
    262264  libxmlVer=$(echo $xsltprocVer | cut -d " " -f3)
    263265 libxsltVer=$(echo $xsltprocVer | cut -d " " -f5)
    264     tidyVer=`tidy -V | cut -d " " -f9`
    265    
    266 # Version numbers are packed strings not xx.yy.zz format.
     266
     267  # Version numbers are packed strings not xx.yy.zz format.
    267268check_version "2.06.20"  "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}"     "LIBXML2"
    268269check_version "1.01.14"  "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}"  "LIBXSLT"
    269 check_version "2004"   "${tidyVer}"        "TIDY"
     270
     271# The next versions checks are required only when BLFS_TOOL is set and
     272# this dependencies has not be selected for installation
     273if [[ "$BLFS_TOOL" = "y" ]] ; then
     274
     275  if [[ -z "$DEP_TIDY" ]] ; then
     276    tidyVer=`tidy -V | cut -d " " -f9`
     277    check_version "2004" "${tidyVer}" "TIDY"
     278  fi
     279
     280# Check if the proper DocBook-XML-DTD and DocBook-XSL are correctly installed
     281XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?>
     282<?xml-stylesheet type='text/xsl' href='http://docbook.sourceforge.net/release/xsl/1.69.1/xhtml/docbook.xsl'?>
     283<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'
     284  'http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd'>
     285<article>
     286  <title>Test file</title>
     287  <sect1>
     288    <title>Some title</title>
     289    <para>Some text</para>
     290  </sect1>
     291</article>"
     292
     293  if [[ -z "$DEP_DBXML" ]] ; then
     294    if `echo $XML_FILE | xmllint -noout -postvalid - 2>/dev/null` ; then
     295      check_version "4.4" "4.4" "DocBook XML DTD"
     296    else
     297      echo "Warning: not found a working DocBook XML DTD 4.4 installation"
     298      exit 2
     299    fi
     300  fi
     301
     302  if [[ -z "$DEP_DBXSL" ]] ; then
     303    if `echo $XML_FILE | xsltproc --noout - 2>/dev/null` ; then
     304      check_version "1.69.1" "1.69.1" "DocBook XSL"
     305    else
     306      echo "Warning: not found a working DocBook XSL 1.69.1 installation"
     307      exit 2
     308    fi
     309  fi
     310
     311fi
    270312
    271313echo "${SD_BORDER}${nl_}"
Note: See TracChangeset for help on using the changeset viewer.