gavinchou commented on code in PR #12691:
URL: https://github.com/apache/doris/pull/12691#discussion_r973590793


##########
thirdparty/build-thirdparty.sh:
##########
@@ -1408,6 +1416,77 @@ build_xxhash() {
     cp libxxhash.a "${TP_INSTALL_DIR}/lib64"
 }
 
+####################################[ Build 
]###################################
+
+# Choose what to compile
+if [[ -d ${TP_INSTALL_DIR} && "${DEPS}" != "" ]]; then
+    for i in `echo ${DEPS}`; do
+        build_${i}
+    done
+    echo "Built specified dependencies: ${DEPS}"
+    exit
+fi
+
+if [[ -f version.txt ]]; then
+    CUR_VERSION=`cat version.txt | grep -v "#"`
+else
+    CUR_VERSION="y"
+fi
+
+if [[ -f ${TP_INSTALL_DIR}/version.txt ]]; then
+    INSTALLED_VERSION=`cat ${TP_INSTALL_DIR}/version.txt | grep -v "#"`
+else
+    INSTALLED_VERSION="x"
+fi
+
+if [[ "${CUR_VERSION}" == "${INSTALLED_VERSION}" && ${BUILD_ALL} -eq 0 ]]; then
+    echo "Installed dependencies are up to date, if you want to rebuild all 
dependencies, use -a option"
+    exit
+fi
+
+# Incremental build
+if [[ -f version.txt && -f ${TP_INSTALL_DIR}/version.txt && ${BUILD_ALL} -eq 0 
]]; then
+    CUR_VERSION=`cat version.txt | grep -v "#" | awk '{print $1; exit}'`
+    INSTALLED_VERSION=`cat ${TP_INSTALL_DIR}/version.txt | grep -v "#" | awk 
'{print $1; exit}'`
+    if [[ "${INSTALLED_VERSION}" -gt "${CUR_VERSION}" ]]; then
+        echo "Installed dependencies are up to date, if you want to downgrade, 
use -a or -d option to rebuild"
+        exit
+    fi
+    VER_DIFF=$[${CUR_VERSION} - ${INSTALLED_VERSION}]
+    if [[ ${VER_DIFF} -lt 2 ]]; then
+        INC_BUILD_DEPS=""
+        CNT=0
+        for i in `cat version.txt | grep -v "#"`; do
+            if [[ ${CNT} -lt 2 ]]; then
+                CNT=$[${CNT} + 1]
+                continue
+            fi
+            INC_BUILD_DEPS="${INC_BUILD_DEPS} ${i}"

Review Comment:
   I suggest making it another individual PR to improve it, downloading is 
actually not a problem, for now, the build is.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to