fold/scripts/vendor/fetch_analysis_libs.sh

25 lines
954 B
Bash
Executable file

#!/usr/bin/env bash
# Fetch optional analysis-library vendor sources at the pinned refs documented in
# third_party/*/VENDOR.md. This script intentionally keeps sources under
# third_party/<name>/src, which each package's .gitignore excludes until we make
# a deliberate import decision.
set -euo pipefail
fetch_repo() {
local name="$1" repo="$2" ref="$3"
local dst="third_party/${name}/src"
if [[ -d "${dst}/.git" ]]; then
echo "[vendor] updating ${name} (${ref})"
git -C "${dst}" fetch --depth 1 origin "${ref}"
git -C "${dst}" checkout --detach FETCH_HEAD
else
echo "[vendor] cloning ${name} (${ref})"
rm -rf "${dst}"
git clone --filter=blob:none --depth 1 --branch "${ref}" "${repo}" "${dst}"
fi
}
fetch_repo souffle https://github.com/souffle-lang/souffle.git 2.5
fetch_repo lief https://github.com/lief-project/LIEF.git 0.17.6
echo "[vendor] done. Sources are local-only until import strategy is finalized."