From 1a4eaa62341b42a272b73d0ea27a3a68eccb91c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Vallv=C3=A9=20Navarro?= <jvallve@iri.upc.edu>
Date: Thu, 20 Jan 2022 14:26:42 +0100
Subject: [PATCH] git clone --depth 1 -b in some deps

---
 install_wolf.sh | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/install_wolf.sh b/install_wolf.sh
index df588df..fe62746 100755
--- a/install_wolf.sh
+++ b/install_wolf.sh
@@ -186,10 +186,8 @@ fi
 # ceres
 func_echo "Installing ceres 2.0 via source..."
 cd $DEPS_PATH
-git clone https://ceres-solver.googlesource.com/ceres-solver
+git clone --depth 1 -b 2.0.0 https://ceres-solver.googlesource.com/ceres-solver
 cd ceres-solver
-git checkout 2.0
-git pull
 mkdir -p build && cd build
 cmake -DCMAKE_BUILD_TYPE=Release ..
 make -j$CORES
@@ -199,10 +197,8 @@ func_make_install
 # spdlog
 func_echo "Installing spdlog 0.17 via source..."
 cd $DEPS_PATH
-git clone https://github.com/gabime/spdlog.git
+git clone --depth 1 -b v0.17.0 https://github.com/gabime/spdlog.git
 cd spdlog
-git checkout v0.17.0
-git pull
 mkdir -p build && cd build
 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fPIC" ..
 make -j$CORES
@@ -228,7 +224,6 @@ func_echo "Cloning wolf core..."
 cd $WOLF_PATH
 git clone -b master https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/wolf.git
 cd wolf
-git pull
 
 func_echo "Compiling wolf core..."
 mkdir -p build && cd build
@@ -253,7 +248,6 @@ if [ $INSTALL_IMU == "y" ]; then
    cd $WOLF_PATH
    git clone -b master https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/plugins/imu.git
    cd imu
-   git pull
    
    func_echo "Compiling plugin imu..."
    mkdir -p build && cd build
@@ -291,7 +285,6 @@ if [ $INSTALL_GNSS == "y" ]; then
    cd $WOLF_PATH
    git clone -b master https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/plugins/gnss.git
    cd gnss
-   git pull
 
    func_echo "Compiling plugin gnss..."
    mkdir -p build && cd build
@@ -374,7 +367,6 @@ if [ $INSTALL_LASER == "y" ]; then
    ldconfig
    git clone -b master https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/plugins/laser.git
    cd laser
-   git pull
 
    func_echo "Compiling plugin laser..."
    mkdir -p build && cd build
@@ -406,10 +398,7 @@ if [ $INSTALL_VISION == "y" ]; then
    unzip temp.zip
    rm temp.zip
    cd opencv-3.3.0
-   git clone https://github.com/opencv/opencv_contrib.git
-   cd opencv_contrib
-   git checkout 3.3.0
-   cd ..
+   git clone --depth 1 -b 3.3.0 https://github.com/opencv/opencv_contrib.git
    mkdir build
    cd build
    cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_CXX_FLAGS="-fPIC -std=c++14" -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ..
@@ -420,7 +409,6 @@ if [ $INSTALL_VISION == "y" ]; then
    cd $WOLF_PATH
    git clone -b master https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/plugins/vision.git
    cd vision
-   git pull
 
    func_echo "Compiling plugin vision..."
    mkdir -p build && cd build
@@ -458,7 +446,6 @@ if [ $INSTALL_VISION == "y" ]; then
       cd $WOLF_PATH
       git clone -b master https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/plugins/apriltag.git
       cd apriltag
-      git pull
 
       func_echo "Compiling plugin apriltag..."
       mkdir -p build && cd build
@@ -489,7 +476,6 @@ if [ $INSTALL_IMU == "y" ]; then
       cd $WOLF_PATH
       git clone -b master https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/plugins/bodydynamics.git
       cd bodydynamics
-      git pull
 
       func_echo "Compiling plugin bodydynamics..."
       mkdir -p build && cd build
-- 
GitLab