From d6a3989c7c7601b6bd90d3526e1bbef2860e62b6 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Tue, 16 Feb 2021 09:36:27 +0100 Subject: [PATCH] Allow skipping apt update - environment variable TRAVIS_SKIP_APT_UPDATE can be set to non-empty to skip apt update when running travis2bash.sh --- travis2bash.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/travis2bash.sh b/travis2bash.sh index 6c7f568..f8f7ab9 100755 --- a/travis2bash.sh +++ b/travis2bash.sh @@ -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"