From 86d5c4dbf6e62c52fe9295f4e55eb629d8e26cfb Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 15 Aug 2023 11:02:43 +0200 Subject: [PATCH] github: check apt-cache in more robust way Reported-by: Masatake YAMATO Signed-off-by: Karel Zak --- .github/workflows/cibuild-setup-ubuntu.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cibuild-setup-ubuntu.sh b/.github/workflows/cibuild-setup-ubuntu.sh index 423e38f998..4c0fdc6b44 100755 --- a/.github/workflows/cibuild-setup-ubuntu.sh +++ b/.github/workflows/cibuild-setup-ubuntu.sh @@ -41,7 +41,9 @@ PACKAGES_OPTIONAL=( if [[ "$QEMU_USER" != "1" ]]; then MODULES_PACKAGE="linux-modules-extra-$(uname -r)" # may not exist anymore - if apt-cache show "$MODULES_PACKAGE" >/dev/null 2>&1; then + APT_CACHE_OUTPUT=$(apt-cache show "$MODULES_PACKAGE") + APT_CACHE_STATUS=$? + if [[ "${APT_CACHE_STATUS}" == 0 && -n "${APT_CACHE_OUTPUT}" ]]; then PACKAGES+=("$MODULES_PACKAGE") fi fi -- 2.47.3