basic version checking

This commit is contained in:
Chris Punches
2024-02-10 09:14:54 -05:00
parent 5ddeaeeacb
commit c0ef3d4bf6
28 changed files with 727 additions and 17 deletions

View File

@@ -4,7 +4,10 @@ set -u
export LC_ALL=C
expected_version="$1"
real_name="bash"
app="bash"
ver_check $app $expected_version || echofail "$app $expected_version check failed."
ver_check $real_name $app $expected_version || \
echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="binutils"
app="ld"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="bison"
app="bison"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -4,7 +4,8 @@ set -u
export LC_ALL=C
expected_version="$1"
real_name="coreutils"
app="sort"
ver_check $app $expected_version || echofail "$app $expected_version check failed."
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="diffutils"
app="diff"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="findutils"
app="find"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="GCC (G++)"
app="g++"
ver_check "$real_name" "$app" "$expected_version" || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="gawk"
app="gawk"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="coreutils"
app="sort"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="grep"
app="grep"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="gzip"
app="gzip"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="coreutils"
app="sort"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="m4"
app="m4"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="make"
app="make"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="patch"
app="patch"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="perl"
app="perl"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="python3"
app="python3"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,27 @@
#!/bin/bash
set -u
export LC_ALL=C
real_name="bison"
app="bison"
dialog \
--title "Install ${real_name}?" \
--backtitle "Requirements Remediations" \
--yesno "Do you want to install ${real_name} on the build host?" 7 60
response=$?
# this is distro-specific and distro-specific function routing should
# account for things like this
case $response in
0) dnf -y install $app; install_result=$?;;
1) echo "Canceled. You need $real_name to run this.";;
255) echo "Canceled. You need $real_name to run this.";;
esac
exit $install_result

View File

@@ -0,0 +1,27 @@
#!/bin/bash
set -u
export LC_ALL=C
real_name="patch"
app="patch"
dialog \
--title "Install ${real_name}?" \
--backtitle "Requirements Remediations" \
--yesno "Do you want to install ${real_name} on the build host?" 7 60
response=$?
# this is distro-specific and distro-specific function routing should
# account for things like this
case $response in
0) dnf -y install $app; install_result=$?;;
1) echo "Canceled. You need $real_name to run this.";;
255) echo "Canceled. You need $real_name to run this.";;
esac
exit $install_result

View File

@@ -0,0 +1,27 @@
#!/bin/bash
set -u
export LC_ALL=C
real_name="texinfo"
app="texinfo"
dialog \
--title "Install ${real_name}?" \
--backtitle "Requirements Remediations" \
--yesno "Do you want to install ${real_name} on the build host?" 7 60
response=$?
# this is distro-specific and distro-specific function routing should
# account for things like this
case $response in
0) dnf -y install $app; install_result=$?;;
1) echo "Canceled. You need $real_name to run this.";;
255) echo "Canceled. You need $real_name to run this.";;
esac
exit $install_result

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="sed"
app="sed"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="tar"
app="tar"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="texinfo"
app="texi2any"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -u
export LC_ALL=C
expected_version="$1"
real_name="xz"
app="xz"
ver_check $real_name $app $expected_version || echofail "$real_name $expected_version check failed."
exit $?