unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH 1/5] ci/profiles.sh: fix case matching logic
@ 2023-08-28 10:42 Štěpán Němec
  2023-08-28 10:42 ` [PATCH 2/5] watch: remove unused variable Štěpán Němec
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Štěpán Němec @ 2023-08-28 10:42 UTC (permalink / raw)
  To: meta

'-' 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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ci/profiles.sh b/ci/profiles.sh
index 3cd8fa38756a..e58b61d50a13 100755
--- a/ci/profiles.sh
+++ b/ci/profiles.sh
@@ -30,8 +30,8 @@ GNU/Linux)
 		esac
 
 		case $ID--$VERSION_ID in
-		-|*--|--*) continue ;;
-		*--*) break ;;
+		*--|--*) continue ;;
+		*) break ;;
 		esac
 	done
 	;;

base-commit: a036772bdf732d4779f44974095bfdd0b30271ef
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-08-28 21:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-28 10:42 [PATCH 1/5] ci/profiles.sh: fix case matching logic Štěpán Němec
2023-08-28 10:42 ` [PATCH 2/5] watch: remove unused variable Štěpán Němec
2023-08-28 10:42 ` [PATCH 3/5] spawn: remove stray variable $ndc_err Štěpán Němec
2023-08-28 10:42 ` [PATCH 4/5] spawn: remove distracting empty line Štěpán Němec
2023-08-28 10:42 ` [PATCH 5/5] Fix some typos/grammar/errors in docs and comments Štěpán Němec
2023-08-28 21:11   ` Eric Wong
2023-08-28 21:22     ` Štěpán Němec
2023-08-28 21:38       ` Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).