Changeset b789d88


Ignore:
Timestamp:
03/05/2023 02:01:40 AM (14 months ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
12.0, 12.0-rc1, 12.1, 12.1-rc1, bdubbs/gcc13, multilib, renodr/libudev-from-systemd, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/update-glibc
Children:
770e789
Parents:
73e2b9c
Message:

hostreq: Minor script adjustment

  • Remove an extra whitespace breaking shebang (though our instruction does not use the shebang).
  • Adjust the regex to allow several letters after the version number, and match grep version to the text.
  • Raise Coreutils to 7.0 (for the host requirement script itself). It was released in 2008 so I don't think it's a problem.
  • Add a colon after the text "Compiler check" to match "Aliases:".
  • Use grep -o instead of sed to make kernel version check simpler.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter02/hostreqs.xml

    r73e2b9c rb789d88  
    5656
    5757    <listitem>
    58       <para><emphasis role="strong">Coreutils-6.9</emphasis></para>
     58      <para><emphasis role="strong">Coreutils-7.0</emphasis></para>
    5959    </listitem>
    6060
     
    166166
    167167<screen role="nodump"><userinput>cat &gt; version-check.sh &lt;&lt; "EOF"
    168 <literal> #!/bin/bash
     168<literal>#!/bin/bash
    169169# A script to list version numbers of critical development tools
    170170
     
    186186     echo "ERROR: Cannot find $2 ($1)"; return 1;
    187187   fi
    188    v=$($2 --version 2>&amp;1 | grep -E -o '[0-9]+\.[0-9\.]+' | head -n1)
     188   v=$($2 --version 2>&amp;1 | grep -E -o '[0-9]+\.[0-9\.]+[a-z]*' | head -n1)
    189189   if printf '%s\n' $3 $v | sort --version-sort --check &amp;>/dev/null
    190190   then
     
    198198ver_kernel()
    199199{
    200    kver=$(uname -r | sed -E 's/^([0-9\.]+).*/\1/')
     200   kver=$(uname -r | grep -E -o '[0-9\.]+')
    201201   if printf '%s\n' $1 $kver | sort --version-sort --check &amp;>/dev/null
    202202   then
     
    218218ver_check GCC            gcc      5.1
    219219ver_check "GCC (C++)"    g++      5.1
    220 ver_check Grep           grep     2.6.1
     220ver_check Grep           grep     2.5.1a
    221221ver_check Gzip           gzip     1.3.12
    222222ver_check M4             m4       1.4.10
     
    242242alias_check sh Bash
    243243
    244 echo "Compiler check"
     244echo "Compiler check:"
    245245if printf "int main(){}" | g++ -x c++ -
    246246then echo "OK:    g++ works";
Note: See TracChangeset for help on using the changeset viewer.