Skip to content

Commit cf063ad

Browse files
committed
Bail out of shallow cloning if it fails, and do full clone instead
1 parent dc495f9 commit cf063ad

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

configure

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@ while getopts t OPT; do
1212
done
1313
shift $(($OPTIND - 1))
1414

15-
# Shallow clonning saves a considerable ammount of time, specially because of the linux kernel.
16-
# However, git submodules are buggy as usual, and this is the best way i've found to get it done:
17-
# https://stackoverflow.com/questions/2144406/git-shallow-submodules/47374702#47374702
18-
# In particular:
19-
# - `shallow = true` on the submodule has no effect for the non default educational branches of our submodules
20-
# - QEMU's submodules point to commits that are neither under branches nor tags, and so `--shallow-submodules` fails
21-
git submodule update --depth 1 --jobs 4 --init
22-
cd qemu
23-
git submodule update --init
15+
(
16+
set -e
17+
# Shallow clonning saves a considerable ammount of time, specially because of the linux kernel.
18+
# However, git submodules are buggy as usual, and this is the best way i've found to get it done:
19+
# https://stackoverflow.com/questions/2144406/git-shallow-submodules/47374702#47374702
20+
# In particular:
21+
# - `shallow = true` on the submodule has no effect for the non default educational branches of our submodules
22+
# - QEMU's submodules point to commits that are neither under branches nor tags, and so `--shallow-submodules` fails
23+
git submodule update --depth 1 --jobs 4 --init
24+
cd qemu
25+
git submodule update --init
26+
) &
27+
wait $! || git submodule update --init
2428

2529
pkgs="\
2630
automake \
@@ -37,6 +41,7 @@ gcc-arm-linux-gnueabi \
3741
libgoogle-perftools-dev \
3842
protobuf-compiler \
3943
"
44+
4045
command -v apt-get >/dev/null 2>&1 || {
4146
cat <<EOF
4247
apt-get not found. You're on your own for installing dependencies.

0 commit comments

Comments
 (0)