Changeset b86876a


Ignore:
Timestamp:
09/21/2013 06:52:02 PM (11 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
2.4, ablfs-more, legacy, new_features, trunk
Children:
7ce6de2
Parents:
897416c
Message:

Adapted host requirements checks for CLFS

Location:
common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • common/hostreqs.xsl

    r897416c rb86876a  
    1818
    1919  <xsl:template match="emphasis">
     20<!-- We assume that what is emphasized is in the form:
     21aa...aa-dccsaaa (a anything except @, - "dash", d digit,
     22                 c anything except space, s space)
     23or
     24aa...aasdccsaaa
     25This means we have to replace digits with @, and look for '-@'
     26or ' @' -->
     27    <xsl:variable name="normalized-string"
     28                  select="translate(normalize-space(string()),
     29                                                    '0123456789',
     30                                                    '@@@@@@@@@@')"/>
     31    <xsl:variable name="begin-ver">
     32      <xsl:choose>
     33        <xsl:when test="contains($normalized-string,' @')">
     34          <xsl:value-of select="string-length(substring-before($normalized-string,' @'))+1"/>
     35        </xsl:when>
     36        <xsl:otherwise>
     37          <xsl:value-of select="string-length(substring-before($normalized-string,'-@'))+1"/>
     38        </xsl:otherwise>
     39      </xsl:choose>
     40    </xsl:variable>
     41
     42    <xsl:variable name="remaining-part"
     43                  select="substring($normalized-string,number($begin-ver)+1)"/>
     44
     45    <xsl:variable name="end-ver">
     46      <xsl:choose>
     47        <xsl:when test="contains($remaining-part,' ')">
     48           <xsl:value-of
     49             select="string-length(substring-before($remaining-part,' '))"/>
     50        </xsl:when>
     51        <xsl:otherwise>
     52           <xsl:value-of
     53             select="string-length($remaining-part)"/>
     54        </xsl:otherwise>
     55      </xsl:choose>
     56    </xsl:variable>
     57
    2058    <xsl:text>local MIN_</xsl:text>
    2159    <xsl:choose>
    22       <xsl:when test="contains(string(),' ')">
    23         <xsl:value-of select=
    24            "substring-before(substring-after(normalize-space(string()),
    25                                              ' '),
    26                              '-')"/>
     60      <xsl:when test="contains(string(),'Kernel')">
     61        <xsl:text>Linux</xsl:text>
     62      </xsl:when>
     63      <xsl:when test="contains(string(),'GLIBC')">
     64        <xsl:text>Glibc</xsl:text>
     65      </xsl:when>
     66      <xsl:when test="contains(string(),'XZ')">
     67        <xsl:text>Xz</xsl:text>
    2768      </xsl:when>
    2869      <xsl:otherwise>
    29         <xsl:value-of select="substring-before(string(),'-')"/>
     70<!-- We assume that there are no dash nor space in other names -->
     71        <xsl:value-of select="substring(string(),1,number($begin-ver)-1)"/>
    3072      </xsl:otherwise>
    3173    </xsl:choose>
    3274    <xsl:text>_VER=</xsl:text>
    33     <xsl:value-of select="substring-after(string(),'-')"/>
     75    <xsl:value-of select="substring(string(),number($begin-ver)+1,$end-ver)"/>
    3476    <xsl:text>
    3577</xsl:text>
  • common/libs/func_check_version.sh

    r897416c rb86876a  
    5555
    5656#  echo -ne "$TXT:\t${L_arrow}${BOLD}${tst_version}${OFF}${R_arrow}"
    57   IFS=".-(pa"   # Split up w.x.y.z as well as w.x.y-rc  (catch release candidates)
     57  IFS=".-(pab"   # Split up w.x.y.z as well as w.x.y-rc  (catch release candidates)
    5858  set -- $ref_version # set positional parameters to minimum ver values
    5959  ref_major=$1; ref_minor=$2; ref_revision=$3
     
    101101
    102102  # LFS/HLFS/CLFS prerequisites
    103   check_version "$MIN_Kernel_VER"    "`uname -r`"          "KERNEL"
     103  check_version "$MIN_Linux_VER"     "`uname -r`"          "KERNEL"
    104104  check_version "$MIN_Bash_VER"      "$BASH_VERSION"       "BASH"
    105105  if [ ! -z $MIN_GCC_VER ]; then
     
    129129  check_version "$MIN_Xz_VER"        "$(xz --version | head -n1 | cut -d" " -f4)"         "XZ"
    130130  # Check for minimum sudo version
     131  if [ -z $MIN_Sudo_VER ]; then MIN_Sudo_VER=1.7.0; fi
    131132  SUDO_LOC="$(whereis -b sudo | cut -d" " -f2)"
    132133  if [ -x $SUDO_LOC ]; then
    133134    sudoVer="$(sudo -V | head -n1 | cut -d" " -f3)"
    134     check_version "1.7.0"  "${sudoVer}"      "SUDO"
     135    check_version "$MIN_Sudo_VER"  "${sudoVer}"      "SUDO"
    135136  else
    136137    echo "${nl_}\"${RED}sudo${OFF}\" ${BOLD}must be installed on your system for jhalfs to run"
Note: See TracChangeset for help on using the changeset viewer.