Files
cpp-build-system/grab_packages.sh
Scott E. Graves fda2ed99ee
Some checks are pending
sgraves/cpp-build-system_msys2/pipeline/head Build queued...
sgraves/cpp-build-system_mac/pipeline/head Build queued...
sgraves/cpp-build-system/pipeline/head Build queued...
extract common download
2026-01-10 17:01:19 -06:00

38 lines
1001 B
Bash
Executable File

#!/usr/bin/env bash
CURRENT_DIR=$(realpath "$0")
CURRENT_DIR=$(dirname "${CURRENT_DIR}")
. "${CURRENT_DIR}/scripts/download.sh"
. "${CURRENT_DIR}/src/scripts/versions.sh"
. "${CURRENT_DIR}/src/scripts/libraries.sh"
function download_package() {
local NAME=$1
local ITEM_LIST=(${PROJECT_DOWNLOADS[${NAME}]//;/ })
if [ ! -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}" ]; then
if ! download_file "${ITEM_LIST[0]}" "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}"; then
echo "failed $NAME"
exit 1
fi
pushd "${CURRENT_DIR}/support/${ITEM_LIST[2]}/"
if ! sha256sum -c "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}.sha256"; then
rm -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}"
echo "failed sha256 validation: $NAME"
exit 1
fi
popd
fi
}
function download_packages() {
for NAME in "${!PROJECT_DOWNLOADS[@]}"; do
download_package $NAME
done
}
pushd "${CURRENT_DIR}"
download_packages
popd