mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-06-18 19:29:21 +01:00
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.
This commit is contained in:
parent
73e2b9c189
commit
b789d88195
@ -55,7 +55,7 @@
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis role="strong">Coreutils-6.9</emphasis></para>
|
||||
<para><emphasis role="strong">Coreutils-7.0</emphasis></para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
@ -165,7 +165,7 @@
|
||||
the ability to compile programs, run the following commands:</para>
|
||||
|
||||
<screen role="nodump"><userinput>cat > version-check.sh << "EOF"
|
||||
<literal> #!/bin/bash
|
||||
<literal>#!/bin/bash
|
||||
# A script to list version numbers of critical development tools
|
||||
|
||||
# If you have tools installed in other directories, adjust PATH here AND
|
||||
@ -185,7 +185,7 @@ ver_check()
|
||||
then
|
||||
echo "ERROR: Cannot find $2 ($1)"; return 1;
|
||||
fi
|
||||
v=$($2 --version 2>&1 | grep -E -o '[0-9]+\.[0-9\.]+' | head -n1)
|
||||
v=$($2 --version 2>&1 | grep -E -o '[0-9]+\.[0-9\.]+[a-z]*' | head -n1)
|
||||
if printf '%s\n' $3 $v | sort --version-sort --check &>/dev/null
|
||||
then
|
||||
printf "OK: %-9s %-6s >= $3\n" "$1" "$v"; return 0;
|
||||
@ -197,7 +197,7 @@ ver_check()
|
||||
|
||||
ver_kernel()
|
||||
{
|
||||
kver=$(uname -r | sed -E 's/^([0-9\.]+).*/\1/')
|
||||
kver=$(uname -r | grep -E -o '[0-9\.]+')
|
||||
if printf '%s\n' $1 $kver | sort --version-sort --check &>/dev/null
|
||||
then
|
||||
printf "OK: Linux Kernel $kver >= $1\n"; return 0;
|
||||
@ -217,7 +217,7 @@ ver_check Findutils find 4.2.31
|
||||
ver_check Gawk gawk 4.0.1
|
||||
ver_check GCC gcc 5.1
|
||||
ver_check "GCC (C++)" g++ 5.1
|
||||
ver_check Grep grep 2.6.1
|
||||
ver_check Grep grep 2.5.1a
|
||||
ver_check Gzip gzip 1.3.12
|
||||
ver_check M4 m4 1.4.10
|
||||
ver_check Make make 4.0
|
||||
@ -241,7 +241,7 @@ alias_check awk GNU
|
||||
alias_check yacc Bison
|
||||
alias_check sh Bash
|
||||
|
||||
echo "Compiler check"
|
||||
echo "Compiler check:"
|
||||
if printf "int main(){}" | g++ -x c++ -
|
||||
then echo "OK: g++ works";
|
||||
else echo "ERROR: g++ does NOT work"; fi
|
||||
|
Loading…
Reference in New Issue
Block a user