Skip to content

Commit 58c3ffa

Browse files
committed
---
yaml --- r: 162782 b: refs/heads/try c: 8ca8e6f h: refs/heads/master v: v3
1 parent f6b614a commit 58c3ffa

File tree

2 files changed

+15
-28
lines changed

2 files changed

+15
-28
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cafe2966770ff377aad6dd9fd808e68055587c58
5-
refs/heads/try: b388dc61a54de4b8d62fa069dfde0c67a469841a
5+
refs/heads/try: 8ca8e6fa4d3a7dc1a40e958cfa4ca62096bfa509
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/etc/rustup.sh

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,18 @@ download_and_extract_package() {
443443
fi
444444
}
445445

446+
# Wrap all the commands needed to install a package.
447+
install_package() {
448+
install_script="$1"
449+
450+
sh "${install_script}" "${CFG_INSTALL_FLAGS}"
451+
if [ $? -ne 0 ]
452+
then
453+
rm -Rf "${CFG_TMP_DIR}"
454+
err "failed to install Rust"
455+
fi
456+
}
457+
446458
rm -Rf "${CFG_TMP_DIR}"
447459
need_ok "failed to remove temporary installation directory"
448460

@@ -459,35 +471,10 @@ if [ -z "${CFG_DISABLE_CARGO}" ]; then
459471
"${CARGO_TARBALL_NAME}"
460472
fi
461473

462-
463-
(cd "${CFG_TMP_DIR}" && ${CFG_TAR} xzf "${RUST_TARBALL_NAME}")
464-
if [ $? -ne 0 ]
465-
then
466-
rm -Rf "${CFG_TMP_DIR}"
467-
err "failed to unpack installer"
468-
fi
469-
470-
sh "${RUST_LOCAL_INSTALL_SCRIPT}" "${CFG_INSTALL_FLAGS}"
471-
if [ $? -ne 0 ]
472-
then
473-
rm -Rf "${CFG_TMP_DIR}"
474-
err "failed to install Rust"
475-
fi
474+
install_package "${RUST_LOCAL_INSTALL_SCRIPT}"
476475

477476
if [ -z "${CFG_DISABLE_CARGO}" ]; then
478-
(cd "${CFG_TMP_DIR}" && ${CFG_TAR} xzf "${CARGO_TARBALL_NAME}")
479-
if [ $? -ne 0 ]
480-
then
481-
rm -Rf "${CFG_TMP_DIR}"
482-
err "failed to unpack cargo installer"
483-
fi
484-
485-
sh "${CARGO_LOCAL_INSTALL_SCRIPT}" "${CFG_INSTALL_FLAGS}"
486-
if [ $? -ne 0 ]
487-
then
488-
rm -Rf "${CFG_TMP_DIR}"
489-
err "failed to install Cargo"
490-
fi
477+
install_package "${CARGO_LOCAL_INSTALL_SCRIPT}"
491478
fi
492479

493480
rm -Rf "${CFG_TMP_DIR}"

0 commit comments

Comments
 (0)