]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
ci/profiles.sh: fix case matching logic
authorŠtěpán Němec <stepnem@smrk.net>
Mon, 28 Aug 2023 10:42:42 +0000 (12:42 +0200)
committerEric Wong <e@80x24.org>
Mon, 28 Aug 2023 21:32:27 +0000 (21:32 +0000)
'-' could never match, remove that alternative (it might have been a
typo of '--', but that is already covered by '*--|--*' ('*' matches
the null string)).

Replace '*--*' with the equivalent '*' ('--' is always present).

It would seem clearer to just replace the whole case command with
something like '[ "$ID" -a "$VERSION_ID" ] && break' (or the
POSIX-non-deprecated equivalent '[ "$ID" ] && [ "$VERSION_ID" ]' ); I
assume a preference of using case here (e.g., to avoid syscall
overhead in case [ is not implemented as a shell builtin (which seems
far-fetched given the context, though)).

ci/profiles.sh

index 3cd8fa38756a4e4aae9a4fd735e0eae91f7e1ab2..e58b61d50a132e576e2ed62324cd8cef57897e76 100755 (executable)
@@ -30,8 +30,8 @@ GNU/Linux)
                esac
 
                case $ID--$VERSION_ID in
-               -|*--|--*) continue ;;
-               *--*) break ;;
+               *--|--*) continue ;;
+               *) break ;;
                esac
        done
        ;;