Allow skipping apt update

- environment variable TRAVIS_SKIP_APT_UPDATE can be set to non-empty to
  skip apt update when running travis2bash.sh
This commit is contained in:
Peter Šurda 2021-02-16 09:36:27 +01:00
parent 9efd0556e6
commit d6a3989c7c
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -65,8 +65,10 @@ function aptinstall() {
# apt install
# shellcheck disable=SC2154
if [[ "$(declare -p travis_addons_apt_packages)" =~ "declare -a" ]]; then
echo -e "\nsudo apt -y update\n"
sudo apt -y update
if [ -z "$TRAVIS_SKIP_APT_UPDATE" ]; then
echo -e "\nsudo apt -y update\n"
sudo apt -y update
fi
for ((i = 0; i < ${#travis_addons_apt_packages[@]}; i++))
do
echo -e "\napt-get -yq --no-install-suggests --no-install-recommends install ${travis_addons_apt_packages[$i]}\n"