contrib: Remove dependency directories. (#5367)
authorAina Niemetz <aina.niemetz@gmail.com>
Mon, 2 Nov 2020 22:10:34 +0000 (14:10 -0800)
committerGitHub <noreply@github.com>
Mon, 2 Nov 2020 22:10:34 +0000 (14:10 -0800)
This automatically removes dependency directories for scripts that get
external dependencies instead of aborting with an error.

contrib/get-abc
contrib/get-cadical
contrib/get-cryptominisat
contrib/get-drat2er
contrib/get-glpk-cut-log
contrib/get-gmp-dev
contrib/get-kissat
contrib/get-lfsc-checker
contrib/get-poly
contrib/get-script-header.sh
contrib/get-symfpu

index 108720066e8a3ffa52017f4039240bf6a3fdd95e..9f37a69e3cf1c6c3bfcc418a3ffdcdfde5e3bf2e 100755 (executable)
@@ -5,7 +5,6 @@ source "$(dirname "$0")/get-script-header.sh"
 ABC_DIR="$DEPS_DIR/abc"
 commit=3d7034bf619aada30b0ba1e8afcb151d304ab556
 
-check_dep_dir "$ABC_DIR"
 setup_dep "https://github.com/berkeley-abc/abc/archive/$commit.tar.gz" "$ABC_DIR"
 cd "$ABC_DIR"
 
index a253514e86a78991508ad36deee29613457a07f4..bb3fab2fa41d6acf6d44497728103bb8ae2d5519 100755 (executable)
@@ -5,7 +5,6 @@ source "$(dirname "$0")/get-script-header.sh"
 CADICAL_DIR="$DEPS_DIR/cadical"
 version="rel-1.2.1"
 
-check_dep_dir "$CADICAL_DIR"
 setup_dep \
   "https://github.com/arminbiere/cadical/archive/$version.tar.gz" "$CADICAL_DIR"
 cd "$CADICAL_DIR"
index 476d1ff10b38eec457e33bd61c42308ca7448d18..263939bcc312be739e186a84e740c697a15a0b63 100755 (executable)
@@ -5,7 +5,6 @@ source "$(dirname "$0")/get-script-header.sh"
 CMS_DIR="$DEPS_DIR/cryptominisat5"
 version="5.8.0"
 
-check_dep_dir "$CMS_DIR"
 setup_dep \
   "https://github.com/msoos/cryptominisat/archive/$version.tar.gz" \
   "$CMS_DIR"
index f043658904004d51c5798f1af6321d3a57edffed..318de1b832398af07f8189f2f316c9fbf9e0da2f 100755 (executable)
@@ -5,7 +5,6 @@ source "$(dirname "$0")/get-script-header.sh"
 DRAT2ER_DIR="$DEPS_DIR/drat2er"
 commit=521caf16149df3dfa46f700ec1fab56f8cc12a18
 
-check_dep_dir "$DRAT2ER_DIR"
 setup_dep \
   "https://github.com/alex-ozdemir/drat2er/archive/$commit.tar.gz" \
   "$DRAT2ER_DIR"
index 17ace0dcde090a87ff7d7107f1dd7c28dff0bba2..f8eff85bb8a290d77b9d0f92fe488c64e3ff5716 100755 (executable)
@@ -12,7 +12,6 @@ patch_file=${contrib_dir}/glpk-cut-log.patch
 GLPK_DIR="$DEPS_DIR/glpk-cut-log"
 version="4.52"
 
-check_dep_dir "$GLPK_DIR"
 setup_dep \
   "https://ftp.gnu.org/gnu/glpk/glpk-${version}.tar.gz" \
   "$GLPK_DIR"
index ef2023d04faa6d05a807099e576a602b62115385..3fc913a7d6f51781c3b95213450ac24ff10f01d9 100755 (executable)
@@ -17,8 +17,6 @@ source "$(dirname "$0")/get-script-header.sh"
 
 GMP_DIR="$DEPS_DIR/gmp-$GMPVERSION"
 
-check_dep_dir "$GMP_DIR"
-
 echo =============================================================================
 echo
 echo "This script should only be used if your distribution does not ship with the"
index 7b513caef1e5d8bcab7920d34c287b574dd06536..2e21bb69bc400ac0ea4263c248b65ece22b6c616 100755 (executable)
@@ -7,8 +7,6 @@ source "$(dirname "$0")/get-script-header.sh"
 KISSAT_DIR="${DEPS_DIR}/kissat"
 version="sc2020-039805f2"
 
-check_dep_dir "${KISSAT_DIR}"
-
 # Download and build Kissat
 setup_dep \
   "http://fmv.jku.at/kissat/kissat-$version.tar.xz" "$KISSAT_DIR"
index e7bee86c037a192a1d54fb1e40795f2078f95201..0db781b4aacf50ef9bfda0e6402ef48ca440b713 100755 (executable)
@@ -5,7 +5,6 @@ source "$(dirname "$0")/get-script-header.sh"
 LFSC_DIR="$DEPS_DIR/lfsc-checker"
 version="master"
 
-check_dep_dir "$LFSC_DIR"
 setup_dep "https://github.com/CVC4/LFSC/archive/$version.tar.gz" "$LFSC_DIR"
 cd "$LFSC_DIR"
 
index a0bc181ed778d6c7f1965cae8b6b5d2c1b16bd8c..d2e0935b641b852d427d34449e32eaf2a788a251 100755 (executable)
@@ -5,7 +5,6 @@ source "$(dirname "$0")/get-script-header.sh"
 POLY_DIR="$DEPS_DIR/poly"
 version="v0.1.8"
 
-check_dep_dir "$POLY_DIR"
 setup_dep \
   "https://github.com/SRI-CSL/libpoly/archive/master.tar.gz" "$POLY_DIR"
 # TODO(Gereon, #4706): Go back to fixed version with the next release
index 7a88b3be200b83e32d1bd4bd96edbcf7a1d1caad..64ef5440131d5937722348e79008787b0a74a6c6 100644 (file)
@@ -50,6 +50,7 @@ function setup_dep
   url="$1"
   directory="$2"
   echo "Setting up $directory ..."
+  rm -rf "$directory"
   mkdir -p "$directory"
   cd "$directory"
   webget "$url" archive
@@ -57,15 +58,6 @@ function setup_dep
   rm archive
 }
 
-function check_dep_dir
-{
-  if [ -e "$1" ]; then
-    echo "error: file or directory '$1' exists; please move it out of the way." >&2
-    exit 1
-  fi
-}
-
-
 # Some of our dependencies do not provide a make install rule. Use the
 # following helper functions to copy libraries/headers/binaries into the
 # corresponding directories in deps/install.
index 885bad62e683ae0e19e143320f459cd5eb0f4264..383a620d91582489791ecff49bb0ca93b09a6cda 100755 (executable)
@@ -5,7 +5,6 @@ source "$(dirname "$0")/get-script-header.sh"
 SYMFPU_DIR="$DEPS_DIR/symfpu-CVC4"
 commit="8fbe139bf0071cbe0758d2f6690a546c69ff0053"
 
-check_dep_dir "$SYMFPU_DIR"
 setup_dep \
   "https://github.com/martin-cs/symfpu/archive/$commit.tar.gz" "$SYMFPU_DIR"
 cd "$SYMFPU_DIR"