1
Fork 0

rustup: simplify downloading packages

This commit is contained in:
Erick Tryzelaar 2014-12-03 15:14:30 -08:00
parent 694500b07d
commit f86737973a

View file

@ -418,10 +418,8 @@ CARGO_LOCAL_INSTALL_SCRIPT="${CARGO_LOCAL_INSTALL_DIR}/install.sh"
# Fetch the package. # Fetch the package.
download_package() { download_package() {
remote_url="$1" remote_tarball="$1"
tarball_name="$2" local_tarball="$2"
remote_tarball="${remote_url}/${tarball_name}"
local_tarball="${CFG_TMP_DIR}/${tarball_name}"
msg "Downloading ${remote_tarball} to ${local_tarball}" msg "Downloading ${remote_tarball} to ${local_tarball}"
@ -469,14 +467,17 @@ install_packages() {
mkdir -p "${CFG_TMP_DIR}" mkdir -p "${CFG_TMP_DIR}"
need_ok "failed to create create temporary installation directory" need_ok "failed to create create temporary installation directory"
RUST_LOCAL_TARBALL="${CFG_TMP_DIR}/${RUST_TARBALL_NAME}"
CARGO_LOCAL_TARBALL="${CFG_TMP_DIR}/${CARGO_TARBALL_NAME}"
download_package \ download_package \
"${RUST_URL}" \ "${RUST_URL}/${RUST_TARBALL_NAME}" \
"${RUST_TARBALL_NAME}" "${RUST_LOCAL_TARBALL}"
if [ -z "${CFG_DISABLE_CARGO}" ]; then if [ -z "${CFG_DISABLE_CARGO}" ]; then
download_package \ download_package \
"${CARGO_URL}" \ "${CARGO_URL}/${CARGO_TARBALL_NAME}" \
"${CARGO_TARBALL_NAME}" "${CARGO_LOCAL_TARBALL}"
fi fi
install_package \ install_package \