Skip to content

Commit

Permalink
Update get_velox.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixYBW authored Feb 7, 2025
1 parent 6cb0b56 commit 60d7459
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions ep/build-velox/src/get_velox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,26 +145,36 @@ if [ "$VELOX_HOME" == "" ]; then
fi
VELOX_SOURCE_DIR="${VELOX_HOME}"

# checkout code
TARGET_BUILD_COMMIT="$(git ls-remote $VELOX_REPO $VELOX_BRANCH | awk '{print $1;}' | head -n 1)"
if [ -d $VELOX_SOURCE_DIR ]; then
echo "Velox source folder $VELOX_SOURCE_DIR already exists..."
cd $VELOX_SOURCE_DIR
git init .
EXISTS=$(git show-ref refs/tags/build_$TARGET_BUILD_COMMIT || true)
if [ -z "$EXISTS" ]; then
git fetch $VELOX_REPO $TARGET_BUILD_COMMIT:refs/tags/build_$TARGET_BUILD_COMMIT
if git ls-remote $VELOX_REPO $VELOX_BRANCH &> /dev/null; then
# checkout code
TARGET_BUILD_COMMIT="$(git ls-remote $VELOX_REPO $VELOX_BRANCH | awk '{print $1;}' | head -n 1)"
if [ -d $VELOX_SOURCE_DIR ]; then
echo "Velox source folder $VELOX_SOURCE_DIR already exists..."
cd $VELOX_SOURCE_DIR
git init .
EXISTS=$(git show-ref refs/tags/build_$TARGET_BUILD_COMMIT || true)
if [ -z "$EXISTS" ]; then
git fetch $VELOX_REPO $TARGET_BUILD_COMMIT:refs/tags/build_$TARGET_BUILD_COMMIT
fi
git reset --hard HEAD
git checkout refs/tags/build_$TARGET_BUILD_COMMIT
else
git clone $VELOX_REPO -b $VELOX_BRANCH $VELOX_SOURCE_DIR
cd $VELOX_SOURCE_DIR
git checkout $TARGET_BUILD_COMMIT
fi
git reset --hard HEAD
git checkout refs/tags/build_$TARGET_BUILD_COMMIT
#sync submodules
git submodule sync --recursive
git submodule update --init --recursive
else
git clone $VELOX_REPO -b $VELOX_BRANCH $VELOX_SOURCE_DIR
cd $VELOX_SOURCE_DIR
git checkout $TARGET_BUILD_COMMIT
if [ -d $VELOX_SOURCE_DIR ]; then
# if velox repo isn't accessable and velox_home is set
cd $VELOX_SOURCE_DIR
else
echo "download from $VELOX_REPO failed"
exit 1
fi
fi
#sync submodules
git submodule sync --recursive
git submodule update --init --recursive

function apply_compilation_fixes {
current_dir=$1
Expand Down

0 comments on commit 60d7459

Please sign in to comment.