Skip to content

Commit 62948e9

Browse files
committed
lib/fetch-{libc++,newlib}: exit on error
1 parent c0202f9 commit 62948e9

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

lib/fetch-libc++.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env bash
22

3+
# Exit on error:
4+
set -e
5+
36
GCC_VERSION=$1
47

58
if [ $GCC_VERSION = "14.1.0" ]; then
@@ -27,7 +30,7 @@ else
2730
CHECK_SHA_CMD="sha256sum -c"
2831
fi
2932

30-
let FOUND=0
33+
FOUND=0
3134

3235
# Try from each mirror until we successfully download a .zip file.
3336
for MIRROR in ${MIRRORS[@]}; do
@@ -39,7 +42,7 @@ for MIRROR in ${MIRRORS[@]}; do
3942
if [ $? -ne 0 ]; then
4043
echo " WARNING: Fetching libc++ from mirror $MIRROR failed!" >&2
4144
else
42-
let FOUND=1
45+
FOUND=1
4346
break
4447
fi
4548
done

lib/fetch-newlib.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env bash
22

3+
# Exit on error:
4+
set -e
5+
36
NEWLIB_VERSION=$1
47

58
if [ $NEWLIB_VERSION = "4.4.0.20231231" ]; then
@@ -25,7 +28,7 @@ else
2528
CHECK_SHA_CMD="sha256sum -c"
2629
fi
2730

28-
let FOUND=0
31+
FOUND=0
2932

3033
# Try from each mirror until we successfully download a .zip file.
3134
for MIRROR in ${MIRRORS[@]}; do
@@ -37,7 +40,7 @@ for MIRROR in ${MIRRORS[@]}; do
3740
if [ $? -ne 0 ]; then
3841
echo " WARNING: Fetching newlib from mirror $MIRROR failed!" >&2
3942
else
40-
let FOUND=1
43+
FOUND=1
4144
break
4245
fi
4346
done

0 commit comments

Comments
 (0)