Skip to content

Commit 324d1cf

Browse files
committed
---
yaml --- r: 161473 b: refs/heads/snap-stage3 c: 8ca8e6f h: refs/heads/master i: 161471: a3d9f69 v: v3
1 parent af8dd99 commit 324d1cf

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 4eb72d268f337a8f117c86a2ac1b98336cab9e9d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: b388dc61a54de4b8d62fa069dfde0c67a469841a
4+
refs/heads/snap-stage3: 8ca8e6fa4d3a7dc1a40e958cfa4ca62096bfa509
55
refs/heads/try: 0f0d21c1eb5c7be04d323e0b06faf252ad790af6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/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)