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 B8ACA2828C; Thu, 10 Nov 2022 11:23:45 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id 6D98028227; Thu, 10 Nov 2022 11:23:43 +0000 (UTC) Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by atuin.qyliss.net (Postfix) with ESMTPS id 64CD6281F3 for ; Thu, 10 Nov 2022 11:23:39 +0000 (UTC) Received: by mail-ed1-x542.google.com with SMTP id a5so2558102edb.11 for ; Thu, 10 Nov 2022 03:23:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unikie.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=83Y+ScBn/NgPywTSdKAQCqUi0a/oMZuIShsTStYBWto=; b=armPKTXE6+xMIgpQiuT9SAt7CSsMXXtUGrRuZDsl+IT/NqG2FaRxs5IOonR1w9uEc4 arDq0VYRWY0Sr9Zbm0fCCqCEPE8qUWXQ0PEFTfqwUNokuOeM8065JPNznuDMmaAxSDjv DSU9gxMq2L5aVzodq5gzpzBfzn0yqTJKKylZg22KidC5aFD6oA47WLevj2qY0ZY27k5R we6GsJr5TN05xJfj5NspQN5JJ5d8P5HTCFHOFqvbqG0BAVNet0QYzcJR5W8HEAAoCBin ZXR1wqEWy5uaMHayIz544mzhTxi0TBMu0AW7JVvOjO8WDzHHAUrzFqwjbXKTUCfDY6vA NCfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=83Y+ScBn/NgPywTSdKAQCqUi0a/oMZuIShsTStYBWto=; b=YudwFygeV21EyBvZF6e9Oqp2zal49q93Kf8QTmpeEuTtb97L35aWW8pyk34Sp8SKvb wCCQG4wAlZIS5TR0xbLlDr/glJqwL8NQiIl7UpBs0bNEVsX+DVjIQs1OIyRhlvA0pzSV VcThpgPRB4+epNXTVngNZB+9o8j/kvXuov2bdA0UnAAmGp/hRptVxvYp23eb2xbDzEIO PhotWtQQX0hU+crXgWRs8rvWOdIoyBykXR2D3Pu5pcwwScHtzqKhNOtX9LBO+kVWLNVX I+LBnkgnvPAxEbyJu+UX5VSihicX6fphKf3YE/LyHs3BKFwDkYJ64bwgvaftMcH+AzN/ raHQ== X-Gm-Message-State: ACrzQf2zjedd4e2oUvZSUn8HFnKfDUqi/UHwimvCbmgYJVv8x2i/33Bg Jn40TiG86zGPd0pJAM8LhJL/r/k0Iw3vaIez X-Google-Smtp-Source: AMsMyM7EoqWY80MDDc8WtHdSrJ4t08i9q13aBslApICdUCHtpgWPfFgSJBZZCt/TAbNTZT4FaMiZAQ== X-Received: by 2002:a05:6402:430a:b0:462:2e05:30b5 with SMTP id m10-20020a056402430a00b004622e0530b5mr61554365edc.246.1668079418167; Thu, 10 Nov 2022 03:23:38 -0800 (PST) Received: from x220.qyliss.net (p200300ed671d2d010000000000000001.dip0.t-ipconnect.de. [2003:ed:671d:2d01::1]) by smtp.gmail.com with ESMTPSA id r7-20020a1709062cc700b007806c1474e1sm6974466ejr.127.2022.11.10.03.23.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 03:23:34 -0800 (PST) Received: by x220.qyliss.net (Postfix, from userid 1000) id 5F6E2D26; Thu, 10 Nov 2022 11:23:32 +0000 (UTC) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH 1/2] scripts: fix shellcheck warnings Date: Thu, 10 Nov 2022 11:22:19 +0000 Message-Id: <20221110112219.459660-1-alyssa.ross@unikie.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: W3X2WDHBZ62W6C2AN3HATDKSUOSAEAYZ X-Message-ID-Hash: W3X2WDHBZ62W6C2AN3HATDKSUOSAEAYZ X-MailFrom: alyssa.ross@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: Henri Rosten 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: Signed-off-by: Alyssa Ross --- 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