Changeset f445e26


Ignore:
Timestamp:
03/19/2013 01:01:30 AM (11 years ago)
Author:
Thomas Pegg <thomasp@…>
Branches:
2.4, ablfs-more, legacy, new_features, trunk
Children:
b170025
Parents:
c80aa1f
Message:

Fix bug where if xmllint is not installed, book version information is not extracted to be used for lfs-release,lsb-release and SBU reports.

Added checks in the code to ensure both xmllint and xstlproc are available prior to use.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/libs/func_check_version.sh

    rc80aa1f rf445e26  
    130130  fi
    131131
     132  # Before checking libmxl2 and libxslt version information, ensure tools needed from those
     133  # packages are actually available. Avoids a small cosmetic bug of book version information
     134  # not being retrieved if xmllint is unavailable, especially when on recent non-LFS hosts.
     135
     136  XMLLINT_LOC="$(whereis -b xmllint | cut -d" " -f2)"
     137  XSLTPROC_LOC="$(whereis -b xsltproc | cut -d" " -f2)"
     138  XML_NOTE_MSG="${nl_} ${BOLD} This can happen when running jhalfs on non-LFS hosts. ${OFF}"
     139 
     140  if [ ! -x $XMLLINT_LOC ]; then
     141    echo "${nl_}\"${RED}xmllint${OFF}\" ${BOLD}must be installed on your system for jhalfs to run"
     142    echo ${XML_NOTE_MSG}
     143    exit 1
     144  fi
     145
     146  if [ -x $XSLTPROC_LOC ]; then
     147
    132148  # Check for minimum libxml2 and libxslt versions
    133149  xsltprocVer=$(xsltproc -V | head -n1 )
     
    138154  check_version "2.06.20"  "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}"     "LIBXML2"
    139155  check_version "1.01.14"  "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}"  "LIBXSLT"
    140 
     156 
     157  else
     158    echo "${nl_}\"${RED}xsltproc${OFF}\" ${BOLD}must be installed on your system for jhalfs to run"
     159    echo ${XML_NOTE_MSG}
     160    exit 1
     161  fi
    141162  # The next versions checks are required only when BLFS_TOOL is set and
    142163  # this dependencies has not be selected for installation
Note: See TracChangeset for help on using the changeset viewer.