Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ShellCheck errors and warnings #12

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion scripts/bootstrap-prefix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
printf '\033]2;'"$*"'\007'
}

eerror() { estatus $*; echo "!!! $*" 1>&2; }

Check warning on line 21 in scripts/bootstrap-prefix.sh

View workflow job for this annotation

GitHub Actions / build

Use "$@" (with quotes) to prevent whitespace problems.
einfo() { echo "* $*"; }
v() { echo "$@"; "$@"; }

Expand Down Expand Up @@ -84,7 +84,7 @@

einfo "Fetching ${1##*/}"
estatus "stage1: fetching ${1##*/}"
pushd "${DISTDIR}" > /dev/null

Check warning on line 87 in scripts/bootstrap-prefix.sh

View workflow job for this annotation

GitHub Actions / build

Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails.

# Try for mirrors first, fall back to distfiles, then try given location
local locs=( )
Expand All @@ -105,7 +105,7 @@
eerror "downloading ${1} failed!"
return 1
fi
popd > /dev/null

Check warning on line 108 in scripts/bootstrap-prefix.sh

View workflow job for this annotation

GitHub Actions / build

Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
fi
return 0
}
Expand Down Expand Up @@ -155,6 +155,7 @@
configure_toolchain() {
linker="sys-devel/binutils"
local gcc_deps="dev-libs/gmp dev-libs/mpfr dev-libs/mpc dev-libs/libffi"
local llvm_deps="dev-build/ninja"
compiler="${gcc_deps} sys-devel/gcc-config sys-devel/gcc"
compiler_stage1="${gcc_deps} sys-devel/gcc-config"
compiler_type="gcc"
Expand Down Expand Up @@ -218,7 +219,6 @@
compiler_stage1="sys-apps/darwin-miscutils"
compiler_type="clang"
local ccvers="$(unset CHOST; ${CC} --version 2>/dev/null)"
local llvm_deps="dev-build/ninja"
case "${ccvers}" in
*"Apple clang version "*|*"Apple LLVM version "*)
# this is Clang, recent enough to compile recent clang
Expand Down Expand Up @@ -251,6 +251,28 @@
sys-devel/llvm
sys-devel/clang"
;;
*-openbsd*)
einfo "Triggering OpenBSD with LLVM/Clang toolchain"
linker="sys-devel/lld"
compiler="
dev-libs/libffi
${llvm_deps}
sys-libs/libcxxabi
sys-libs/libcxx
sys-devel/llvm
sys-devel/clang
"
compiler_stage1="
${llvm_deps}
sys-libs/libcxxabi
sys-libs/libcxx
sys-devel/llvm
sys-devel/clang
"
compiler_type="clang"
CC=clang
CXX=clang++
;;
*-linux*)
is-rap && einfo "Triggering Linux RAP bootstrap"
compiler_stage1+=" sys-devel/gcc"
Expand Down
Loading