Skip to content

Commit 7931b24

Browse files
authored
Rollup merge of rust-lang#78666 - sasurau4:fix/shellcheck-error, r=jyn514
Fix shellcheck error ## Overview Helps with rust-lang#77290 This pr fix only errors of shellcheck, the result of `git ls-files '*.sh' | xargs shellcheck --severity=error`. Fixing error are following. - https://github.com/koalaman/shellcheck/wiki/SC2148 - https://github.com/koalaman/shellcheck/wiki/SC1008 Disable error following. - https://github.com/koalaman/shellcheck/wiki/SC2068
2 parents c990a38 + 5ea028e commit 7931b24

File tree

38 files changed

+47
-23
lines changed

38 files changed

+47
-23
lines changed

compiler/rustc_codegen_cranelift/scripts/cargo.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cmd=$1
1010
shift || true
1111

1212
if [[ "$cmd" = "jit" ]]; then
13-
cargo +${TOOLCHAIN} rustc $@ -- --jit
13+
cargo +${TOOLCHAIN} rustc "$@" -- --jit
1414
else
15-
cargo +${TOOLCHAIN} $cmd $@
15+
cargo +${TOOLCHAIN} $cmd "$@"
1616
fi

compiler/rustc_codegen_cranelift/scripts/config.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env bash
12
set -e
23

34
unamestr=`uname`

compiler/rustc_codegen_cranelift/test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ set -e
33

44
export RUSTFLAGS="-Zrun_dsymutil=no"
55

6-
./build.sh --without-sysroot $@
6+
./build.sh --without-sysroot "$@"
77

88
rm -r target/out || true
99

1010
scripts/tests.sh no_sysroot
1111

12-
./build.sh $@
12+
./build.sh "$@"
1313

1414
scripts/tests.sh base_sysroot
1515
scripts/tests.sh extended_sysroot

src/ci/docker/host-x86_64/disabled/dist-x86_64-dragonfly/build-toolchain.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exit 1
1717
trap "$on_err" ERR
1818
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
1919
PING_LOOP_PID=$!
20-
$@ &> /tmp/build.log
20+
"$@" &> /tmp/build.log
2121
trap - ERR
2222
kill $PING_LOOP_PID
2323
set -x

src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/build-toolchain.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ exit 1
2222
trap "$on_err" ERR
2323
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
2424
PING_LOOP_PID=$!
25-
$@ &> /tmp/build.log
25+
"$@" &> /tmp/build.log
2626
trap - ERR
2727
kill $PING_LOOP_PID
2828
set -x

src/ci/docker/host-x86_64/dist-aarch64-linux/build-toolchains.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exit 1
1111
trap "$on_err" ERR
1212
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
1313
PING_LOOP_PID=$!
14-
$@ &> /tmp/build.log
14+
"$@" &> /tmp/build.log
1515
rm /tmp/build.log
1616
trap - ERR
1717
kill $PING_LOOP_PID

src/ci/docker/host-x86_64/dist-arm-linux/build-toolchains.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exit 1
1212
trap "$on_err" ERR
1313
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
1414
PING_LOOP_PID=$!
15-
$@ &> /tmp/build.log
15+
"$@" &> /tmp/build.log
1616
rm /tmp/build.log
1717
trap - ERR
1818
kill $PING_LOOP_PID

src/ci/docker/host-x86_64/dist-armhf-linux/build-toolchains.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exit 1
1212
trap "$on_err" ERR
1313
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
1414
PING_LOOP_PID=$!
15-
$@ &> /tmp/build.log
15+
"$@" &> /tmp/build.log
1616
rm /tmp/build.log
1717
trap - ERR
1818
kill $PING_LOOP_PID

src/ci/docker/host-x86_64/dist-armv7-linux/build-toolchains.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exit 1
1212
trap "$on_err" ERR
1313
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
1414
PING_LOOP_PID=$!
15-
$@ &> /tmp/build.log
15+
"$@" &> /tmp/build.log
1616
rm /tmp/build.log
1717
trap - ERR
1818
kill $PING_LOOP_PID

src/ci/docker/host-x86_64/dist-powerpc-linux/build-powerpc-toolchain.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exit 1
1111
trap "$on_err" ERR
1212
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
1313
PING_LOOP_PID=$!
14-
$@ &> /tmp/build.log
14+
"$@" &> /tmp/build.log
1515
rm /tmp/build.log
1616
trap - ERR
1717
kill $PING_LOOP_PID

src/ci/docker/host-x86_64/dist-powerpc64-linux/shared.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
hide_output() {
23
set +x
34
on_err="
@@ -8,7 +9,7 @@ exit 1
89
trap "$on_err" ERR
910
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
1011
PING_LOOP_PID=$!
11-
$@ &> /tmp/build.log
12+
"$@" &> /tmp/build.log
1213
trap - ERR
1314
kill $PING_LOOP_PID
1415
set -x

src/ci/docker/host-x86_64/dist-powerpc64le-linux/shared.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
hide_output() {
23
set +x
34
on_err="
@@ -8,7 +9,7 @@ exit 1
89
trap "$on_err" ERR
910
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
1011
PING_LOOP_PID=$!
11-
$@ &> /tmp/build.log
12+
"$@" &> /tmp/build.log
1213
trap - ERR
1314
kill $PING_LOOP_PID
1415
set -x

src/ci/docker/host-x86_64/dist-riscv64-linux/build-toolchains.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exit 1
1212
trap "$on_err" ERR
1313
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
1414
PING_LOOP_PID=$!
15-
$@ &> /tmp/build.log
15+
"$@" &> /tmp/build.log
1616
rm /tmp/build.log
1717
trap - ERR
1818
kill $PING_LOOP_PID

src/ci/docker/host-x86_64/dist-riscv64-linux/crosstool-ng.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
set -ex
23

34
# Mirrored from https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.24.0.tar.gz

src/ci/docker/host-x86_64/dist-s390x-linux/build-s390x-toolchain.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exit 1
1111
trap "$on_err" ERR
1212
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
1313
PING_LOOP_PID=$!
14-
$@ &> /tmp/build.log
14+
"$@" &> /tmp/build.log
1515
rm /tmp/build.log
1616
trap - ERR
1717
kill $PING_LOOP_PID

src/ci/docker/host-x86_64/dist-various-1/build-rumprun.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exit 1
1111
trap "$on_err" ERR
1212
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
1313
PING_LOOP_PID=$!
14-
$@ &> /tmp/build.log
14+
"$@" &> /tmp/build.log
1515
trap - ERR
1616
kill $PING_LOOP_PID
1717
rm /tmp/build.log

src/ci/docker/host-x86_64/dist-various-1/install-mips-musl.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
set -ex
23

34
mkdir /usr/local/mips-linux-musl

src/ci/docker/host-x86_64/dist-various-1/install-mipsel-musl.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
set -ex
23

34
mkdir /usr/local/mipsel-linux-musl

src/ci/docker/host-x86_64/dist-various-2/shared.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env bash
12
hide_output() {
23
{ set +x; } 2>/dev/null
34
on_err="

src/ci/docker/host-x86_64/dist-x86_64-linux/shared.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
hide_output() {
23
set +x
34
on_err="
@@ -8,7 +9,7 @@ exit 1
89
trap "$on_err" ERR
910
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
1011
PING_LOOP_PID=$!
11-
$@ &> /tmp/build.log
12+
"$@" &> /tmp/build.log
1213
trap - ERR
1314
kill $PING_LOOP_PID
1415
set -x

src/ci/docker/host-x86_64/dist-x86_64-netbsd/build-netbsd-toolchain.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exit 1
1313
trap "$on_err" ERR
1414
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
1515
PING_LOOP_PID=$!
16-
$@ &> /tmp/build.log
16+
"$@" &> /tmp/build.log
1717
rm /tmp/build.log
1818
trap - ERR
1919
kill $PING_LOOP_PID

src/ci/docker/scripts/android-base-apt-get.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
set -ex
23

34
apt-get update

src/ci/docker/scripts/android-ndk.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
set -ex
23

34
URL=https://dl.google.com/android/repository

src/ci/docker/scripts/android-sdk.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
set -ex
23

34
export ANDROID_HOME=/android/sdk

src/ci/docker/scripts/cross-apt-packages.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
apt-get update && apt-get install -y --no-install-recommends \
23
automake \
34
bison \

src/ci/docker/scripts/crosstool-ng-1.24.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
set -ex
23

34
# Mirrored from https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.24.0.tar.gz

src/ci/docker/scripts/crosstool-ng.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
set -ex
23

34
url="https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.22.0.tar.gz"

src/ci/docker/scripts/emscripten.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
set -ex
23

34
hide_output() {
@@ -10,7 +11,7 @@ exit 1
1011
trap "$on_err" ERR
1112
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
1213
PING_LOOP_PID=$!
13-
$@ &> /tmp/build.log
14+
"$@" &> /tmp/build.log
1415
trap - ERR
1516
kill $PING_LOOP_PID
1617
rm -f /tmp/build.log

src/ci/docker/scripts/freebsd-toolchain.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ exit 1
1919
trap "$on_err" ERR
2020
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
2121
local ping_loop_pid=$!
22-
$@ &> /tmp/build.log
22+
"$@" &> /tmp/build.log
2323
trap - ERR
2424
kill $ping_loop_pid
2525
set -x

src/ci/docker/scripts/make3.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
set -ex
23

34
curl -f https://ftp.gnu.org/gnu/make/make-3.81.tar.gz | tar xzf -

src/ci/docker/scripts/musl-toolchain.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
# This script runs `musl-cross-make` to prepare C toolchain (Binutils, GCC, musl itself)
23
# and builds static libunwind that we distribute for static target.
34
#
@@ -19,7 +20,7 @@ exit 1
1920
trap "$on_err" ERR
2021
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
2122
PING_LOOP_PID=$!
22-
$@ &> /tmp/build.log
23+
"$@" &> /tmp/build.log
2324
trap - ERR
2425
kill $PING_LOOP_PID
2526
rm /tmp/build.log

src/ci/docker/scripts/musl.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
set -ex
23

34
hide_output() {
@@ -10,7 +11,7 @@ exit 1
1011
trap "$on_err" ERR
1112
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
1213
PING_LOOP_PID=$!
13-
$@ &> /tmp/build.log
14+
"$@" &> /tmp/build.log
1415
trap - ERR
1516
kill $PING_LOOP_PID
1617
rm /tmp/build.log
@@ -32,7 +33,7 @@ if [ ! -d $MUSL ]; then
3233
fi
3334

3435
cd $MUSL
35-
./configure --enable-optimize --enable-debug --disable-shared --prefix=/musl-$TAG $@
36+
./configure --enable-optimize --enable-debug --disable-shared --prefix=/musl-$TAG "$@"
3637
if [ "$TAG" = "i586" -o "$TAG" = "i686" ]; then
3738
hide_output make -j$(nproc) AR=ar RANLIB=ranlib
3839
else

src/ci/docker/scripts/rustbuild-setup.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
set -ex
23

34
groupadd -r rustbuild && useradd -m -r -g rustbuild rustbuild

src/ci/docker/scripts/sccache.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
set -ex
23

34
case "$(uname -m)" in

src/ci/init_repo.sh

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ modules=($modules)
5353
use_git=""
5454
urls="$(git config --file .gitmodules --get-regexp '\.url$' | cut -d' ' -f2)"
5555
urls=($urls)
56+
# shellcheck disable=SC2068
5657
for i in ${!modules[@]}; do
5758
module=${modules[$i]}
5859
if [[ " $included " = *" $module "* ]]; then

src/ci/shared.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/false
2+
# shellcheck shell=bash
23

34
# This file is intended to be sourced with `. shared.sh` or
45
# `source shared.sh`, hence the invalid shebang and not being

src/test/run-make/thumb-none-qemu/script.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
set -exuo pipefail
23

34
CRATE=example

src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
set -exuo pipefail
23

34
function build {

0 commit comments

Comments
 (0)