Skip to content

Commit 54b22d4

Browse files
committed
update.sh: install xpack-m4
1 parent cc21bda commit 54b22d4

1 file changed

Lines changed: 45 additions & 10 deletions

File tree

scripts/tests/update.sh

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,73 @@
1212
function tests_update_system()
1313
{
1414
local image_name="$1"
15-
set -x
15+
1616
# Make sure that the minimum prerequisites are met.
1717
if [[ ${image_name} == github-actions-ubuntu* ]]
1818
then
1919
run_verbose sudo apt-get update
2020
# To make 32-bit tests possible.
21-
run_verbose sudo apt-get -qq install --yes m4 g++
21+
run_verbose sudo apt-get -qq install --yes g++
2222
elif [[ ${image_name} == *ubuntu* ]] || [[ ${image_name} == *debian* ]]
2323
then
24-
run_verbose apt-get -qq install --yes m4 g++
24+
run_verbose apt-get -qq install --yes g++
2525
elif [[ ${image_name} == *raspbian* ]]
2626
then
27-
run_verbose apt-get -qq install --yes m4 g++
27+
run_verbose apt-get -qq install --yes g++
2828
elif [[ ${image_name} == *centos* ]] || [[ ${image_name} == *redhat* ]] || [[ ${image_name} == *fedora* ]]
2929
then
30-
run_verbose yum install --assumeyes --quiet m4 gcc-c++
30+
run_verbose yum install --assumeyes --quiet gcc-c++
3131
elif [[ ${image_name} == *suse* ]]
3232
then
33-
run_verbose zypper --quiet --no-gpg-checks install --no-confirm m4 gcc-c++
33+
run_verbose zypper --quiet --no-gpg-checks install --no-confirm gcc-c++
3434
elif [[ ${image_name} == *manjaro* ]]
3535
then
36-
run_verbose pacman -S --quiet --noconfirm --noprogressbar m4 g++
36+
run_verbose pacman -S --quiet --noconfirm --noprogressbar g++
3737
elif [[ ${image_name} == *archlinux* ]]
3838
then
39-
run_verbose pacman -S --quiet --noconfirm --noprogressbar m4 gcc
39+
run_verbose pacman -S --quiet --noconfirm --noprogressbar gcc
4040
fi
4141
}
4242

4343
function tests_install_dependencies()
4444
{
45-
echo baburiba
46-
env | sort
45+
echo
46+
echo "[${FUNCNAME[0]} $@]"
47+
48+
local tests_folder_path="$1"
49+
local tests_archive_suffix="$2"
50+
51+
mkdir -pv "${tests_folder_path}/downloads"
52+
53+
# https://github.com/xpack-dev-tools/m4-xpack/releases/download/v1.4.19-2/xpack-m4-1.4.19-2-darwin-arm64.tar.gz
54+
m4_url_base="https://github.com/xpack-dev-tools/m4-xpack/releases/download/"
55+
m4_version="1.4.19-2"
56+
57+
echo
58+
echo "Downloading xpack-m4-${m4_version}-${tests_archive_suffix}..."
59+
run_verbose curl \
60+
--fail \
61+
--location\
62+
--output "${tests_folder_path}/downloads/xpack-m4-${m4_version}-${tests_archive_suffix}" \
63+
"${m4_url_base}/v${m4_version}/xpack-m4-${m4_version}-${tests_archive_suffix}"
64+
65+
run_verbose cd "${tests_folder_path}"
66+
67+
echo
68+
echo "Extracting xpack-m4-${m4_version}-${tests_archive_suffix}..."
69+
70+
# This does not run on Windows, so no need to process .zip archives differently.
71+
run_verbose tar xf "${tests_folder_path}/downloads/xpack-m4-${m4_version}-${tests_archive_suffix}"
72+
73+
echo
74+
export PATH="${tests_folder_path}/xpack-m4-${m4_version}/bin:${PATH}"
75+
echo "PATH=${PATH}"
76+
77+
export M4="$(which m4)"
78+
echo "M4=${M4}"
79+
80+
echo
81+
echo "[${FUNCNAME[0]} done]"
4782
}
4883

4984
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)