]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
github: check apt-cache in more robust way
authorKarel Zak <kzak@redhat.com>
Tue, 15 Aug 2023 09:02:43 +0000 (11:02 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 15 Aug 2023 09:02:43 +0000 (11:02 +0200)
Reported-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
.github/workflows/cibuild-setup-ubuntu.sh

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