From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,LOTS_OF_MONEY,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 3FBD328E62; Thu, 10 Nov 2022 13:39:03 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id EE60928DC3; Thu, 10 Nov 2022 13:39:00 +0000 (UTC) Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by atuin.qyliss.net (Postfix) with ESMTPS id 1DED328E5D for ; Thu, 10 Nov 2022 13:38:58 +0000 (UTC) Received: by mail-lf1-x136.google.com with SMTP id c1so3275206lfi.7 for ; Thu, 10 Nov 2022 05:38:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unikie.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0aealfv0HKEYHeC8lUHR3829yGs2On7sOLVwS6QIrGA=; b=DHSx0/x8Z+V/nN/O3HoT6xk5irkORM/7yoGNfAqoqJyEUPr+DtFB4KJmLg/zxquLOr AHRNXKEfecL3XG/gT/gVvrpzbf+8EToskj2uuUqIb6Y8wFMgiSvnkLCFjUTioVBDNzbS gXxPJ5kKZL12BMhWnt60B3gfYaaa68hbvwrdO1YVx4EfT8sV1Zf5a887lfKyTMa6h5mr xtT55JBiohIbKsl2hF5lL8VScziquqjvqFwzzxvgHgIRdoNLwGG++EsINNxTMhI2pN2U qRhnWVjmMiy55nRUKBJ6zaJXzkgQ+8KfNfTLJ2DIMfEbbIMTYQ+Lfx4pcf3D7Nxp7Fz5 hb0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0aealfv0HKEYHeC8lUHR3829yGs2On7sOLVwS6QIrGA=; b=RwuFl2SkfGzsYzfYMbEZGmJX3bCXEbbrVlkhvFKWbXuGJjkx2xqG5LE6Xyzpht1M83 jArbuSaobTCDm6OD8BgrGedMiculFvo1kNJS4FUJmgaetiDqI9V8ycm/DSGJWMPiaK9I qE9a2yySfFOt41m3w1iek07GVukGsJwZfRVEubNGj8CHo7wv2aICErDj2JqBl1kJc+KH tj5vApsmAgYbwBqoaQRq+Uzm2rigQfb1vCJM0z1IZbdDLrQO3wsZZcuLF1y4973WNHMq j3U1m6Hna+LP+KwULx6o5L2qO8xcuZ6T8pcHLEuMBLkHepSozLCWDRtIpcFt9wywo0xd YzOw== X-Gm-Message-State: ACrzQf08X7tRFabymFuL3Ezu4g3fk87QRAwpqjR6MxsBO3dKv5c9yTuy YMXxvVe3gseT6zPjoBCQ5QhjFA== X-Google-Smtp-Source: AMsMyM5mydUUBFBNW+f+JjnNsxD0iZOGgn4n3Uu3pM0q6CESw50Eu94WESgJ8GOCqubtmQFBXBy6kw== X-Received: by 2002:a05:6512:328c:b0:4a2:b387:85fb with SMTP id p12-20020a056512328c00b004a2b38785fbmr20805454lfe.686.1668087535194; Thu, 10 Nov 2022 05:38:55 -0800 (PST) Received: from buamix (86-60-162-79.dynamic.lounea.fi. [86.60.162.79]) by smtp.gmail.com with ESMTPSA id g2-20020a19ee02000000b004a100c21eaesm2760534lfb.97.2022.11.10.05.38.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 05:38:54 -0800 (PST) Date: Thu, 10 Nov 2022 15:38:53 +0200 From: Henri Rosten To: Alyssa Ross Subject: Re: [PATCH 1/2] scripts: fix shellcheck warnings Message-ID: <20221110133853.GA1064381@buamix> References: <20221110112219.459660-1-alyssa.ross@unikie.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221110112219.459660-1-alyssa.ross@unikie.com> Message-ID-Hash: IZOZ33RDAO7KQMDNZ7N24LUG5MLUPIWG X-Message-ID-Hash: IZOZ33RDAO7KQMDNZ7N24LUG5MLUPIWG X-MailFrom: henri.rosten@unikie.com X-Mailman-Rule-Hits: header-match-devel.spectrum-os.org-0 X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1 CC: devel@spectrum-os.org X-Mailman-Version: 3.3.5 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, Nov 10, 2022 at 11:22:19AM +0000, Alyssa Ross wrote: > Signed-off-by: Alyssa Ross Reviewed-by: Henri Rosten > --- > > Henri, I've CCed you on this series, in case you'd like to review. > We have some documentation on reviewing patches here: > > https://spectrum-os.org/doc/development/reviewing-patches.html > > scripts/format-uuid.sh | 12 ++++++------ > scripts/make-gpt.sh | 6 +++--- > 2 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/scripts/format-uuid.sh b/scripts/format-uuid.sh > index 6758088..441ed64 100755 > --- a/scripts/format-uuid.sh > +++ b/scripts/format-uuid.sh > @@ -8,12 +8,12 @@ substr () { > str=$1 > beg=$2 > end=$3 > - echo $str | cut -c $beg-$end > + echo "$str" | cut -c "$beg-$end" > } > > -u1=$(substr $1 1 8) > -u2=$(substr $1 9 12) > -u3=$(substr $1 13 16) > -u4=$(substr $1 17 20) > -u5=$(substr $1 21 32) > +u1=$(substr "$1" 1 8) > +u2=$(substr "$1" 9 12) > +u3=$(substr "$1" 13 16) > +u4=$(substr "$1" 17 20) > +u5=$(substr "$1" 21 32) > printf "%s\n" "$u1-$u2-$u3-$u4-$u5" > diff --git a/scripts/make-gpt.sh b/scripts/make-gpt.sh > index 3215edb..554182f 100755 > --- a/scripts/make-gpt.sh > +++ b/scripts/make-gpt.sh > @@ -23,7 +23,7 @@ sizeMiB() { > fillPartition() { > sfdisk -J "$1" | jq -r --argjson index "$2" \ > '.partitiontable.partitions[$index] | "\(.start) \(.size)"' | > - (read start size; > + (read -r start size; > dd if="$3" of="$1" seek="$start" count="$size" conv=notrunc) > } > > @@ -48,7 +48,7 @@ gptBytes=$TWO_MiB > for partition; do > sizeMiB="$(sizeMiB "$(partitionPath "$partition")")" > table="$table${nl}size=${sizeMiB}MiB,$(awk -f "$scriptsDir/sfdisk-field.awk" -v partition="$partition")" > - gptBytes="$(expr "$gptBytes" + "$sizeMiB" \* $ONE_MiB)" > + gptBytes="$((gptBytes + sizeMiB * ONE_MiB))" > done > > rm -f "$out" > @@ -60,5 +60,5 @@ EOF > n=0 > for partition; do > fillPartition "$out" "$n" "$(partitionPath "$partition")" > - n="$(expr "$n" + 1)" > + n="$((n + 1))" > done > -- > 2.35.1 >