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

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git

commit c78a4e4f3930a37502ef0493d1dcb091400e7628
Author: airborne12 <airborn...@gmail.com>
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 b2f226ee22..d2600224bb 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: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to