Rollup merge of #78666 - sasurau4:fix/shellcheck-error, r=jyn514
Fix shellcheck error ## Overview Helps with #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
This commit is contained in:
commit
7931b2454d
38 changed files with 47 additions and 23 deletions
|
@ -10,7 +10,7 @@ cmd=$1
|
||||||
shift || true
|
shift || true
|
||||||
|
|
||||||
if [[ "$cmd" = "jit" ]]; then
|
if [[ "$cmd" = "jit" ]]; then
|
||||||
cargo +${TOOLCHAIN} rustc $@ -- --jit
|
cargo +${TOOLCHAIN} rustc "$@" -- --jit
|
||||||
else
|
else
|
||||||
cargo +${TOOLCHAIN} $cmd $@
|
cargo +${TOOLCHAIN} $cmd "$@"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
unamestr=`uname`
|
unamestr=`uname`
|
||||||
|
|
|
@ -3,13 +3,13 @@ set -e
|
||||||
|
|
||||||
export RUSTFLAGS="-Zrun_dsymutil=no"
|
export RUSTFLAGS="-Zrun_dsymutil=no"
|
||||||
|
|
||||||
./build.sh --without-sysroot $@
|
./build.sh --without-sysroot "$@"
|
||||||
|
|
||||||
rm -r target/out || true
|
rm -r target/out || true
|
||||||
|
|
||||||
scripts/tests.sh no_sysroot
|
scripts/tests.sh no_sysroot
|
||||||
|
|
||||||
./build.sh $@
|
./build.sh "$@"
|
||||||
|
|
||||||
scripts/tests.sh base_sysroot
|
scripts/tests.sh base_sysroot
|
||||||
scripts/tests.sh extended_sysroot
|
scripts/tests.sh extended_sysroot
|
||||||
|
|
|
@ -17,7 +17,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
set -x
|
set -x
|
||||||
|
|
|
@ -22,7 +22,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
set -x
|
set -x
|
||||||
|
|
|
@ -11,7 +11,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
rm /tmp/build.log
|
rm /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
|
|
|
@ -12,7 +12,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
rm /tmp/build.log
|
rm /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
|
|
|
@ -12,7 +12,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
rm /tmp/build.log
|
rm /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
|
|
|
@ -12,7 +12,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
rm /tmp/build.log
|
rm /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
|
|
|
@ -11,7 +11,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
rm /tmp/build.log
|
rm /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
hide_output() {
|
hide_output() {
|
||||||
set +x
|
set +x
|
||||||
on_err="
|
on_err="
|
||||||
|
@ -8,7 +9,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
set -x
|
set -x
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
hide_output() {
|
hide_output() {
|
||||||
set +x
|
set +x
|
||||||
on_err="
|
on_err="
|
||||||
|
@ -8,7 +9,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
set -x
|
set -x
|
||||||
|
|
|
@ -12,7 +12,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
rm /tmp/build.log
|
rm /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# Mirrored from https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.24.0.tar.gz
|
# Mirrored from https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.24.0.tar.gz
|
||||||
|
|
|
@ -11,7 +11,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
rm /tmp/build.log
|
rm /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
|
|
|
@ -11,7 +11,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
rm /tmp/build.log
|
rm /tmp/build.log
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
mkdir /usr/local/mips-linux-musl
|
mkdir /usr/local/mips-linux-musl
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
mkdir /usr/local/mipsel-linux-musl
|
mkdir /usr/local/mipsel-linux-musl
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
hide_output() {
|
hide_output() {
|
||||||
{ set +x; } 2>/dev/null
|
{ set +x; } 2>/dev/null
|
||||||
on_err="
|
on_err="
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
hide_output() {
|
hide_output() {
|
||||||
set +x
|
set +x
|
||||||
on_err="
|
on_err="
|
||||||
|
@ -8,7 +9,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
set -x
|
set -x
|
||||||
|
|
|
@ -13,7 +13,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
rm /tmp/build.log
|
rm /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
apt-get update
|
apt-get update
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
URL=https://dl.google.com/android/repository
|
URL=https://dl.google.com/android/repository
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
export ANDROID_HOME=/android/sdk
|
export ANDROID_HOME=/android/sdk
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
apt-get update && apt-get install -y --no-install-recommends \
|
apt-get update && apt-get install -y --no-install-recommends \
|
||||||
automake \
|
automake \
|
||||||
bison \
|
bison \
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# Mirrored from https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.24.0.tar.gz
|
# Mirrored from https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.24.0.tar.gz
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
url="https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.22.0.tar.gz"
|
url="https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.22.0.tar.gz"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
hide_output() {
|
hide_output() {
|
||||||
|
@ -10,7 +11,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
rm -f /tmp/build.log
|
rm -f /tmp/build.log
|
||||||
|
|
|
@ -19,7 +19,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
local ping_loop_pid=$!
|
local ping_loop_pid=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $ping_loop_pid
|
kill $ping_loop_pid
|
||||||
set -x
|
set -x
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
curl -f https://ftp.gnu.org/gnu/make/make-3.81.tar.gz | tar xzf -
|
curl -f https://ftp.gnu.org/gnu/make/make-3.81.tar.gz | tar xzf -
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
# This script runs `musl-cross-make` to prepare C toolchain (Binutils, GCC, musl itself)
|
# This script runs `musl-cross-make` to prepare C toolchain (Binutils, GCC, musl itself)
|
||||||
# and builds static libunwind that we distribute for static target.
|
# and builds static libunwind that we distribute for static target.
|
||||||
#
|
#
|
||||||
|
@ -19,7 +20,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
rm /tmp/build.log
|
rm /tmp/build.log
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
hide_output() {
|
hide_output() {
|
||||||
|
@ -10,7 +11,7 @@ exit 1
|
||||||
trap "$on_err" ERR
|
trap "$on_err" ERR
|
||||||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
|
||||||
PING_LOOP_PID=$!
|
PING_LOOP_PID=$!
|
||||||
$@ &> /tmp/build.log
|
"$@" &> /tmp/build.log
|
||||||
trap - ERR
|
trap - ERR
|
||||||
kill $PING_LOOP_PID
|
kill $PING_LOOP_PID
|
||||||
rm /tmp/build.log
|
rm /tmp/build.log
|
||||||
|
@ -32,7 +33,7 @@ if [ ! -d $MUSL ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $MUSL
|
cd $MUSL
|
||||||
./configure --enable-optimize --enable-debug --disable-shared --prefix=/musl-$TAG $@
|
./configure --enable-optimize --enable-debug --disable-shared --prefix=/musl-$TAG "$@"
|
||||||
if [ "$TAG" = "i586" -o "$TAG" = "i686" ]; then
|
if [ "$TAG" = "i586" -o "$TAG" = "i686" ]; then
|
||||||
hide_output make -j$(nproc) AR=ar RANLIB=ranlib
|
hide_output make -j$(nproc) AR=ar RANLIB=ranlib
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
groupadd -r rustbuild && useradd -m -r -g rustbuild rustbuild
|
groupadd -r rustbuild && useradd -m -r -g rustbuild rustbuild
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
case "$(uname -m)" in
|
case "$(uname -m)" in
|
||||||
|
|
|
@ -53,6 +53,7 @@ modules=($modules)
|
||||||
use_git=""
|
use_git=""
|
||||||
urls="$(git config --file .gitmodules --get-regexp '\.url$' | cut -d' ' -f2)"
|
urls="$(git config --file .gitmodules --get-regexp '\.url$' | cut -d' ' -f2)"
|
||||||
urls=($urls)
|
urls=($urls)
|
||||||
|
# shellcheck disable=SC2068
|
||||||
for i in ${!modules[@]}; do
|
for i in ${!modules[@]}; do
|
||||||
module=${modules[$i]}
|
module=${modules[$i]}
|
||||||
if [[ " $included " = *" $module "* ]]; then
|
if [[ " $included " = *" $module "* ]]; then
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/false
|
#!/bin/false
|
||||||
|
# shellcheck shell=bash
|
||||||
|
|
||||||
# This file is intended to be sourced with `. shared.sh` or
|
# This file is intended to be sourced with `. shared.sh` or
|
||||||
# `source shared.sh`, hence the invalid shebang and not being
|
# `source shared.sh`, hence the invalid shebang and not being
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
set -exuo pipefail
|
set -exuo pipefail
|
||||||
|
|
||||||
CRATE=example
|
CRATE=example
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
set -exuo pipefail
|
set -exuo pipefail
|
||||||
|
|
||||||
function build {
|
function build {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue