2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-23 02:17:22 +00:00
criu/scripts/ci/apt-install
Kir Kolyshkin 2166d47482 scripts: fix shellcheck warnings
On my system (shellcheck v0.7.1) make lint shows a few warnings about
needing to quote variables.

Fix those.

PS I am not sure why those are not shown by GHA CI, I assume there is
different shellcheck version used. Add shellcheck -- version to the
appropriate Makefile target to avoid confusion.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-09-03 10:31:00 -07:00

25 lines
668 B
Bash
Executable File

#!/bin/bash
set -e -x
export DEBIAN_FRONTEND=noninteractive
install_retry_counter=0
max_apt_retries=5
# This function loops a couple of times over apt-get, hoping to
# avoid CI errors due to errors during apt-get
# hashsum mismatches, DNS errors and similar things
while true; do
(( install_retry_counter+=1 ))
if [ "${install_retry_counter}" -gt "${max_apt_retries}" ]; then
exit 1
fi
# shellcheck disable=SC2068
apt-get clean -qqy && apt-get update -qqy && apt-get install -qqy --no-install-recommends $@ && break
# In case it is a network error let's wait a bit.
echo "Retrying attempt ${install_retry_counter}"
sleep "${install_retry_counter}"
done