Changeset 3f1d46c for common


Ignore:
Timestamp:
09/25/2006 04:54:31 PM (18 years ago)
Author:
George Boudreau <georgeb@…>
Branches:
experimental
Children:
41b5665
Parents:
928ee4d
Message:

Update test for book prerequisites

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/func_check_version.sh

    r928ee4d r3f1d46c  
    6060}
    6161
     62#----------------------------#
     63check_prerequisites() {      #
     64#----------------------------#
     65
     66  # LFS/HLFS/CLFS prerequisites
     67  if [ ! "${PROGNAME}" = "hlfs" ]; then
     68    check_version "2.6.2"    "`uname -r`"                                       "KERNEL"
     69    check_version "2.0.5"    "$BASH_VERSION"                                    "BASH"
     70    check_version "3.0.0"    "`gcc -dumpversion`"                               "GCC"
     71    check_version "1.14"     "`tar --version | head -n1 | cut -d \" \" -f4`"    "TAR"
     72    check_version "1.12"     "`ld --version | head -n1 | cut -d\" \" -f4`"      "BINUTILS"
     73    bzip2Ver="`bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d\" \" -f8`"
     74    check_version "1.0.3"    "${bzip2Ver%%,*}"                                  "BZIP2"
     75    check_version "5.0"      "`chown --version | head -n1 | cut -d\")\" -f2`"   "COREUTILS"
     76    check_version "2.8"      "`diff --version | head -n1 | cut -d \" \" -f4`"   "DIFF"
     77    check_version "4.1.20"   "`find --version | head -n1 | cut -d \" \" -f4`"   "FIND"
     78    check_version "3.0"      "`gawk --version | head -n1 | cut -d \" \" -f3`"   "GAWK"
     79#  /lib/libc.so.6 | head -n1 | cut -d" " -f1-7
     80    check_version "2.5"      "`grep --version | head -n1 | cut -d \" \" -f4`"   "GREP"
     81#  #echo -n "gzip: ";  gzip --version | head -n1
     82    check_version "3.79.1"    "`make --version | head -n1 | cut -d \" \" -f3`"  "MAKE"
     83    check_version "2.5.4"    "`patch --version | head -n1 | cut -d \" \" -f2`"  "PATCH"
     84    check_version "3.0.2"    "`sed --version | head -n1 | cut -d \" \" -f4`"    "SED"
     85  else
     86    # LFS/HLFS/CLFS prerequisites
     87    check_version "2.6.2" "`uname -r`"         "KERNEL"
     88    check_version "3.0"   "$BASH_VERSION"      "BASH"
     89    check_version "3.0"   "`gcc -dumpversion`" "GCC"
     90    check_version "1.1"   "`tar --version | head -n1 | cut -d \" \" -f4`"   "TAR"
     91  fi
     92
     93  # Check for minimum sudo version
     94  SUDO_LOC="`whereis -b sudo | cut -d " " -f2`"
     95  if [ -x $SUDO_LOC ]; then
     96    sudoVer=`sudo -V | head -n1 | cut -d " " -f3`
     97    check_version "1.6.8"  "${sudoVer}"      "SUDO"
     98  else
     99    echo "${nl_}\"${RED}sudo${OFF}\" ${BOLD}must be installed on your system for jhalfs to run"
     100    exit 1
     101  fi
     102
     103  # Check for minimum libxml2 and libxslt versions
     104  xsltprocVer=`xsltproc -V | head -n1 `
     105  libxmlVer=$(echo $xsltprocVer | cut -d " " -f3)
     106  libxsltVer=$(echo $xsltprocVer | cut -d " " -f5)
     107
     108  # Version numbers are packed strings not xx.yy.zz format.
     109  check_version "2.06.20"  "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}"     "LIBXML2"
     110  check_version "1.01.14"  "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}"  "LIBXSLT"
     111
     112  # The next versions checks are required only when BLFS_TOOL is set and
     113  # this dependencies has not be selected for installation
     114  if [[ "$BLFS_TOOL" = "y" ]] ; then
     115
     116    if [[ -z "$DEP_TIDY" ]] ; then
     117      tidyVer=`tidy -V | cut -d " " -f9`
     118      check_version "2004" "${tidyVer}" "TIDY"
     119    fi
     120
     121    # Check if the proper DocBook-XML-DTD and DocBook-XSL are correctly installed
     122XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?>
     123<?xml-stylesheet type='text/xsl' href='http://docbook.sourceforge.net/release/xsl/1.69.1/xhtml/docbook.xsl'?>
     124<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'
     125  'http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd'>
     126<article>
     127  <title>Test file</title>
     128  <sect1>
     129    <title>Some title</title>
     130    <para>Some text</para>
     131  </sect1>
     132</article>"
     133
     134    if [[ -z "$DEP_DBXML" ]] ; then
     135      if `echo $XML_FILE | xmllint -noout -postvalid - 2>/dev/null` ; then
     136        check_version "4.4" "4.4" "DocBook XML DTD"
     137      else
     138        echo "Warning: not found a working DocBook XML DTD 4.4 installation"
     139        exit 2
     140      fi
     141    fi
     142
     143    if [[ -z "$DEP_DBXSL" ]] ; then
     144      if `echo $XML_FILE | xsltproc --noout - 2>/dev/null` ; then
     145        check_version "1.69.1" "1.69.1" "DocBook XSL"
     146      else
     147        echo "Warning: not found a working DocBook XSL 1.69.1 installation"
     148        exit 2
     149      fi
     150    fi
     151
     152  fi # end BLFS_TOOL=Y
     153
     154}
Note: See TracChangeset for help on using the changeset viewer.