Skip to content

Commit 46d3fc7

Browse files
committed
fix bash long lines and replace TODO with FIXME
1 parent 02e9262 commit 46d3fc7

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

src/tools/rust-installer/install-template.sh

+8-5
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,8 @@ uninstall_components() {
468468
verbose_msg "removing component manifest $_component_manifest"
469469
run rm "$_component_manifest"
470470
# This is a hard error because the installation is unrecoverable
471-
critical_need_ok "failed to remove installed manifest for component '$_installed_component'"
471+
local _err_cant_r_manifest="failed to remove installed manifest for component"
472+
critical_need_ok "$_err_cant_r_manifest '$_installed_component'"
472473

473474
# Update the installed component list
474475
local _modified_components="$(sed "/^$_installed_component\$/d" "$_md/components")"
@@ -692,7 +693,9 @@ maybe_configure_ld() {
692693
fi
693694
if [ $? -ne 0 ]
694695
then
695-
warn "failed to run ldconfig. this may happen when not installing as root. run with --verbose to see the error"
696+
local _warn_s="failed to run ldconfig. this may happen when \
697+
not installing as root. run with --verbose to see the error"
698+
warn "$_warn_s"
696699
fi
697700
fi
698701
}
@@ -977,7 +980,9 @@ make_dir_recursive "$abs_libdir/$TEMPLATE_REL_MANIFEST_DIR"
977980
need_ok "failed to create $TEMPLATE_REL_MANIFEST_DIR"
978981

979982
# Drop the version number into the manifest dir
980-
write_to_file "$TEMPLATE_RUST_INSTALLER_VERSION" "$abs_libdir/$TEMPLATE_REL_MANIFEST_DIR/rust-installer-version"
983+
write_to_file "$TEMPLATE_RUST_INSTALLER_VERSION" \
984+
"$abs_libdir/$TEMPLATE_REL_MANIFEST_DIR/rust-installer-version"
985+
981986
critical_need_ok "failed to write installer version"
982987

983988
# Install the uninstaller
@@ -992,5 +997,3 @@ maybe_configure_ld "$abs_libdir"
992997
echo
993998
echo " $TEMPLATE_SUCCESS_MESSAGE"
994999
echo
995-
996-

src/tools/rust-installer/src/scripter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ impl Scripter {
3333
/// Generates the actual installer script
3434
pub fn run(self) -> Result<()> {
3535
// Replace dashes in the success message with spaces (our arg handling botches spaces)
36-
// TODO: still needed? Kept for compatibility for now.
36+
// FIXME: still needed? Kept for compatibility for now.
3737
let product_name = self.product_name.replace('-', " ");
3838

3939
// Replace dashes in the success message with spaces (our arg handling botches spaces)
40-
// TODO: still needed? Kept for compatibility for now.
40+
// FIXME: still needed? Kept for compatibility for now.
4141
let success_message = self.success_message.replace('-', " ");
4242

4343
let script = TEMPLATE

src/tools/rust-installer/test.sh

+8-4
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,8 @@ uninstall_from_installed_script_with_args_fails() {
458458
--output-dir="$OUT_DIR/c1" \
459459
--component-name=rustc
460460
try "$WORK_DIR/c1/package/install.sh" --prefix="$PREFIX_DIR"
461-
expect_output_fail "uninstall.sh does not take any arguments" sh "$PREFIX_DIR/lib/packagelib/uninstall.sh" --prefix=foo
461+
expect_output_fail "uninstall.sh does not take any arguments" \
462+
sh "$PREFIX_DIR/lib/packagelib/uninstall.sh" --prefix=foo
462463
}
463464
runtest uninstall_from_installed_script_with_args_fails
464465

@@ -680,7 +681,8 @@ select_components_to_install() {
680681
try test -e "$PREFIX_DIR/bin/program"
681682
try test -e "$PREFIX_DIR/bin/cargo"
682683
try test ! -e "$PREFIX_DIR/baz"
683-
try "$WORK_DIR/rust/install.sh --uninstall" --prefix="$PREFIX_DIR" --components=rustc,cargo,rust-docs
684+
try "$WORK_DIR/rust/install.sh --uninstall" --prefix="$PREFIX_DIR" \
685+
--components=rustc,cargo,rust-docs
684686
try test ! -e "$PREFIX_DIR/bin/program"
685687
try test ! -e "$PREFIX_DIR/bin/cargo"
686688
try test ! -e "$PREFIX_DIR/baz"
@@ -733,7 +735,8 @@ select_components_to_uninstall() {
733735
try test ! -e "$PREFIX_DIR/bin/cargo"
734736
try test -e "$PREFIX_DIR/baz"
735737
try "$WORK_DIR/rust/install.sh" --prefix="$PREFIX_DIR"
736-
try "$WORK_DIR/rust/install.sh --uninstall" --prefix="$PREFIX_DIR" --components=rustc,cargo,rust-docs
738+
try "$WORK_DIR/rust/install.sh --uninstall" --prefix="$PREFIX_DIR" \
739+
--components=rustc,cargo,rust-docs
737740
try test ! -e "$PREFIX_DIR/bin/program"
738741
try test ! -e "$PREFIX_DIR/bin/cargo"
739742
try test ! -e "$PREFIX_DIR/baz"
@@ -765,7 +768,8 @@ invalid_component() {
765768
--output-dir="$OUT_DIR" \
766769
--package-name=rust \
767770
--input-tarballs="$OUT_DIR/rustc.tar.gz,$OUT_DIR/cargo.tar.gz,$OUT_DIR/rust-docs.tar.gz"
768-
expect_output_fail "unknown component" "$WORK_DIR/rust/install.sh" --prefix="$PREFIX_DIR" --components=foo
771+
expect_output_fail "unknown component" "$WORK_DIR/rust/install.sh" --prefix="$PREFIX_DIR" \
772+
--components=foo
769773
}
770774
runtest invalid_component
771775

0 commit comments

Comments
 (0)