From: Masatake YAMATO Date: Tue, 15 Aug 2023 11:51:23 +0000 (+0900) Subject: github: check apt-cache in more robust way (v2) X-Git-Tag: v2.40-rc1~279 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3119a8060102ed7dd04d4a782932494c386f72a6;p=thirdparty%2Futil-linux.git github: check apt-cache in more robust way (v2) The original change (86d5c4dbf6e62c52fe9295f4e55eb629d8e26cfb) didn't consider "set -e" at the beginning of the script. Signed-off-by: Masatake YAMATO --- diff --git a/.github/workflows/cibuild-setup-ubuntu.sh b/.github/workflows/cibuild-setup-ubuntu.sh index 4c0fdc6b44..bcd46c719f 100755 --- a/.github/workflows/cibuild-setup-ubuntu.sh +++ b/.github/workflows/cibuild-setup-ubuntu.sh @@ -41,9 +41,7 @@ PACKAGES_OPTIONAL=( if [[ "$QEMU_USER" != "1" ]]; then MODULES_PACKAGE="linux-modules-extra-$(uname -r)" # may not exist anymore - APT_CACHE_OUTPUT=$(apt-cache show "$MODULES_PACKAGE") - APT_CACHE_STATUS=$? - if [[ "${APT_CACHE_STATUS}" == 0 && -n "${APT_CACHE_OUTPUT}" ]]; then + if APT_CACHE_OUTPUT=$(apt-cache show "$MODULES_PACKAGE") && [[ -n "$APT_CACHE_OUTPUT" ]]; then PACKAGES+=("$MODULES_PACKAGE") fi fi