Skip to content

Commit 43169d9

Browse files
author
Junxian.Xiao
committed
make sure git submodule update successfully
1 parent c4d1166 commit 43169d9

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

client/cpp_occlum/occlum_build_prepare.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ TRYGET() {
6262
fi
6363
}
6464

65+
REQUIRE_SUCCESS() {
66+
local count=1
67+
while ! $@ ; do
68+
let count+=1
69+
echo "[Try again: $count] $@"
70+
done
71+
}
72+
6573
GITGET_GRPC() {
6674
GRPC_SRC_DIR=$DEPSDIR/$GRPCDIR
6775
if [ -d $GRPC_SRC_DIR/third_party/protobuf/cmake ] ; then
@@ -72,17 +80,17 @@ GITGET_GRPC() {
7280
LOG_DEBUG "Preparing source code: grpc ..."
7381
#rm -rf $GRPC_SRC_DIR && \
7482
mkdir -p $GRPC_SRC_DIR && cd $GRPC_SRC_DIR
75-
git clone https://github.com/grpc/grpc.git .
83+
REQUIRE_SUCCESS git clone https://github.com/grpc/grpc.git .
7684
git checkout tags/v1.24.3
7785
#git submodule update --init --recursive
7886
cd $GRPC_SRC_DIR/third_party/cares/cares
79-
git submodule update --init .
87+
REQUIRE_SUCCESS git submodule update --init .
8088
git checkout tags/cares-1_15_0
8189
cd $GRPC_SRC_DIR/third_party/protobuf
82-
git submodule update --init .
90+
REQUIRE_SUCCESS git submodule update --init .
8391
git checkout tags/v3.21.6
8492
cd $GRPC_SRC_DIR/third_party/abseil-cpp
85-
git submodule update --init .
93+
REQUIRE_SUCCESS git submodule update --init .
8694
return 0
8795
}
8896

0 commit comments

Comments
 (0)