This is an automated email from the ASF dual-hosted git repository.

jianliangqi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 7727535b91 [Enhancement](build) try to download commit specific source 
code when git submodule failed (#23846)
7727535b91 is described below

commit 7727535b91869e0803375f354a34f28e2ffa4b51
Author: airborne12 <[email protected]>
AuthorDate: Mon Sep 4 20:12:46 2023 +0800

    [Enhancement](build) try to download commit specific source code when git 
submodule failed (#23846)
---
 build.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/build.sh b/build.sh
index 28d2cb04f2..2444d39053 100755
--- a/build.sh
+++ b/build.sh
@@ -282,9 +282,14 @@ update_submodule() {
     exit_code=$?
     set -e
     if [[ "${exit_code}" -ne 0 ]]; then
-        echo "Update ${submodule_name} submodule failed, start to download and 
extract ${submodule_name} package ..."
+        # try to get submodule's current commit
+        submodule_commit=$(git ls-tree HEAD "${submodule_path}" | awk '{print 
$3}')
+
+        commit_specific_url=$(echo "${archive_url}" | sed 
"s/refs\/heads/${submodule_commit}/")
+        echo "Update ${submodule_name} submodule failed, start to download and 
extract ${commit_specific_url}"
+
         mkdir -p "${DORIS_HOME}/${submodule_path}"
-        curl -L "${archive_url}" | tar -xz -C 
"${DORIS_HOME}/${submodule_path}" --strip-components=1
+        curl -L "${commit_specific_url}" | tar -xz -C 
"${DORIS_HOME}/${submodule_path}" --strip-components=1
     fi
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to