From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 4D8C65C0E; Sun, 09 Nov 2025 11:28:19 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 50B595C07; Sun, 09 Nov 2025 11:28:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fout-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) by atuin.qyliss.net (Postfix) with ESMTPS id 6B2FC5C05 for ; Sun, 09 Nov 2025 11:28:15 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 5BD0FEC00A5; Sun, 9 Nov 2025 06:28:14 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Sun, 09 Nov 2025 06:28:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1762687694; x=1762774094; bh=Gn1yx73X+v Merp5N59VQNKoB/MLou+5Sl9LZyNvyWSM=; b=l+p/AAq/nSmAMLz7ydVuNzFAIm S96Bo0SIuOnJmqQ4S4CpgNkqnRUfsj99sfjRXASdxtTDiFdggNasGLw6KstfOuiI wQrLab0vMWYel6XeYu9ZrK9hicCeLDZoa4og2Ebl4GAsAtfYSHSBPeayYZIwt1dE lNfMN/J1i1hkT+ZpBLb021kt1WftVhKYcXbu70tNWGU9l1SiYGHd7S8J0HhP/0q1 rWKqLXxaXByXQzoOLIfO6PhZM9j18rTSS+38IRmx2boXE0a1LLnEPt5FcDGn+SHj sDIiYmqfSfogaNBqol5YSgJ0IYRr4ilot7zaSZDHvdVKFsk90hRQnOZ8tSFQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1762687694; x=1762774094; bh=Gn1yx73X+vMerp5N59VQNKoB/MLou+5Sl9L ZyNvyWSM=; b=JSNCK71/y64Tf6wxPIgpzz7fV/U/tWWMv3Kvc2uWHUXOFgVGrI6 ybvR/pOCriqvmhS58QSy8dn3Zn3c2VMW5ZtZtb2K4BWcQHAUGo0ilxzXqqRgEHNB hqBqdMIoQsuiVbyv3rwtGQeVEXharHGs2LP5Y9OqxcZTNbYxYFz+NUUhIzlAnrqb L8OsIukqcPGnLQdVEqdbtXDJcZdKQkp2uZJHCh6be68B8Nd5KihpDc6jxOBwg3Tn iKBDydysN8CDfq05zkV/lMUan/Ukk2oBw8u6Yn5JH4up0HNJuscHZqrU2IyoT5Rc BD5JIYUoDj6uHOgiPTF57DbEnfddx4nGPzg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdduleehfedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefujghffffkgggtsehgtderredttddtnecuhfhrohhmpeetlhihshhsrgcu tfhoshhsuceohhhisegrlhihshhsrgdrihhsqeenucggtffrrghtthgvrhhnpeevjeeike ehffeuheejvedtkeellefhhefhleegffeiieduvdeuieefteekleffvdenucffohhmrghi nhepshhpvggtthhruhhmqdhoshdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehhihesrghlhihsshgrrdhishdpnhgspghrtghpthht ohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepuggvmhhiohgsvghnohhurh esghhmrghilhdrtghomhdprhgtphhtthhopeguvghvvghlsehsphgvtghtrhhumhdqohhs rdhorhhg X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 9 Nov 2025 06:28:13 -0500 (EST) Received: by mbp.qyliss.net (Postfix, from userid 1000) id 5F8526914665; Sun, 09 Nov 2025 12:28:12 +0100 (CET) From: Alyssa Ross To: Demi Marie Obenour Subject: Re: [PATCH 1/4] scripts/run-qemu.sh: better error checks & formatting In-Reply-To: <20251107-simple-sh-quote-fix-v1-1-5f2d35260c4d@gmail.com> References: <20251107-simple-sh-quote-fix-v1-0-5f2d35260c4d@gmail.com> <20251107-simple-sh-quote-fix-v1-1-5f2d35260c4d@gmail.com> Date: Sun, 09 Nov 2025 12:28:09 +0100 Message-ID: <871pm74f92.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: KF6WSQEMAE3UAHBXZU37GC4AQHUW4XJJ X-Message-ID-Hash: KF6WSQEMAE3UAHBXZU37GC4AQHUW4XJJ X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Spectrum OS Development X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Demi Marie Obenour writes: > No other functional change intended. > > Signed-off-by: Demi Marie Obenour > --- > scripts/run-qemu.sh | 24 ++++++++++++++---------- > 1 file changed, 14 insertions(+), 10 deletions(-) If we're doing formatting changes like this it's definitely time to adopt a shell script formatter, so I'm going to apply my previous series for that[1]. If you can find a shell formatter that does matched parentheses for case statements, we can switch. :) [1]: https://spectrum-os.org/lists/archives/spectrum-devel/20251001102838.7= 086-1-hi@alyssa.is > diff --git a/scripts/run-qemu.sh b/scripts/run-qemu.sh > index 64fd29259ab108bc547cb7c74623ae9dc288b3b7..9c6c8193bbeba5916038c82d8= f76992051719c19 100755 > --- a/scripts/run-qemu.sh > +++ b/scripts/run-qemu.sh > @@ -1,11 +1,15 @@ > -#!/bin/sh -ue > +#!/bin/sh -- > # SPDX-FileCopyrightText: 2023-2025 Alyssa Ross > # SPDX-License-Identifier: EUPL-1.2+ >=20=20 > # This script wraps around QEMU to paper over platform differences, > # which can't be handled portably in Make language. > +set -uef > +if [ -n ${ARCH+test} ]; then > + ARCH=3D$(uname -m) > +fi >=20=20 > -case "${ARCH:=3D"$(uname -m)"}" in > +case $ARCH in > aarch64) > machine=3Dvirt,accel=3Dkvm:tcg,gic-version=3D3,iommu=3Dsmmuv3 > ;; > @@ -17,13 +21,13 @@ case "${ARCH:=3D"$(uname -m)"}" in > esac >=20=20 > i=3D0 > -while [ $i -lt $# ]; do > - arg=3D"$1" > +while [ "$i" -lt "$#" ]; do > + arg=3D$1 > shift >=20=20 > - case "$arg" in > + case $arg in > -append) > - set -- "$@" -append "${append:+$append }$1" > + set -- "$@" -append ${append:+"$append "}"$1" > i=3D$((i + 2)) > shift > continue > @@ -31,10 +35,10 @@ while [ $i -lt $# ]; do > -device) > IFS=3D, > for opt in $1; do > - case "$opt" in > - *-iommu) > - unset iommu > - ;; > + case $opt in > + *-iommu) > + unset iommu > + ;; > esac > break > done > > --=20 > 2.51.2 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRV/neXydHjZma5XLJbRZGEIw/wogUCaRB6yQAKCRBbRZGEIw/w ovUMAQDN7eodkE+vqfuexIBdvnTHy+qB+Jr8GU1+icgVrHbogAD/dFOfL4PSlkX8 R14SNo4pILUOe9kK88wRH7gkh9Dn5Aw= =1XJ8 -----END PGP SIGNATURE----- --=-=-=--