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