]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
github: check apt-cache in more robust way (v2)
authorMasatake YAMATO <yamato@redhat.com>
Tue, 15 Aug 2023 11:51:23 +0000 (20:51 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Tue, 15 Aug 2023 12:12:56 +0000 (21:12 +0900)
The original change (86d5c4dbf6e62c52fe9295f4e55eb629d8e26cfb) didn't
consider "set -e" at the beginning of the script.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
.github/workflows/cibuild-setup-ubuntu.sh

index 4c0fdc6b44402254e13ae3b81740a064baa6c6f9..bcd46c719fce7ef12b62964c941724cc55b902c9 100755 (executable)
@@ -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