Skip to content

Commit aba8c1f

Browse files
committed
Fix unbound variables.
1 parent 69bff31 commit aba8c1f

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

ci/test.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ main() {
4242
export QEMU_STRACE=1
4343

4444
# test `cross check`
45-
if [ ! -z $STD ]; then
45+
if [[ ! -z ${STD:-} ]]; then
4646
td=$(mktemp -d)
4747
cargo init --lib --name foo $td
4848
pushd $td
@@ -53,7 +53,7 @@ main() {
5353
fi
5454

5555
# `cross build` test for targets where `std` is not available
56-
if [ -z "$STD" ]; then
56+
if [[ -z "${STD:-}" ]]; then
5757
td=$(mktemp -d)
5858

5959
git clone \
@@ -99,9 +99,9 @@ EOF
9999
rm -rf $td
100100
fi
101101

102-
if [ $RUN ]; then
102+
if [[ ${RUN:-} ]]; then
103103
# `cross test` test
104-
if [ $DYLIB ]; then
104+
if [[ ${DYLIB:-} ]]; then
105105
td=$(mktemp -d)
106106

107107
pushd $td
@@ -151,15 +151,15 @@ EOF
151151
fi
152152

153153
# Test C++ support
154-
if [ $CPP ]; then
154+
if [[ ${CPP:-} ]]; then
155155
td=$(mktemp -d)
156156

157157
git clone --depth 1 https://github.com/japaric/hellopp $td
158158

159159
pushd $td
160160
cargo update -p gcc
161161
retry cargo fetch
162-
if [ $RUN ]; then
162+
if [[ ${RUN:-} ]]; then
163163
cross_run --target $TARGET
164164
else
165165
cross build --target $TARGET
@@ -171,7 +171,7 @@ EOF
171171
}
172172

173173
cross_run() {
174-
if [ -z "$RUNNERS" ]; then
174+
if [[ -z "${RUNNERS:-}" ]]; then
175175
cross run "$@"
176176
else
177177
for runner in $RUNNERS; do
@@ -182,7 +182,7 @@ cross_run() {
182182
}
183183

184184
cross_test() {
185-
if [ -z "$RUNNERS" ]; then
185+
if [[ -z "${RUNNERS:-}" ]]; then
186186
cross test "$@"
187187
else
188188
for runner in $RUNNERS; do
@@ -193,7 +193,7 @@ cross_test() {
193193
}
194194

195195
cross_bench() {
196-
if [ -z "$RUNNERS" ]; then
196+
if [[ -z "${RUNNERS:-}" ]]; then
197197
cross bench "$@"
198198
else
199199
for runner in $RUNNERS; do

docker/android-system.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,13 @@ EOF
9090
# FATAL: kernel did not supply AT_SECURE
9191
sed -i -e 's/if (!kernel_supplied_AT_SECURE)/if (false)/g' bionic/linker/linker_environ.cpp
9292

93+
set +u
9394
source build/envsetup.sh
9495
lunch aosp_$arch-user
9596
mmma bionic/
9697
mmma external/mksh/
9798
mmma system/core/toolbox/
99+
set -u
98100

99101
if [ $arch = "arm" ]; then
100102
mv out/target/product/generic/system/ /

docker/linux-image.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ main() {
1313

1414
local dropbear="dropbear-bin"
1515

16+
local deps=
17+
local kernel=
18+
1619
# select debian arch and kernel version
1720
case $arch in
1821
aarch64)

0 commit comments

Comments
 (0)