Skip to content

Commit

Permalink
30.1
Browse files Browse the repository at this point in the history
  • Loading branch information
grahampugh committed Jul 28, 2023
1 parent 6cd5a4a commit 4d5ace5
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 18 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

No date

## [30.1]

28.07.2023

- (Hopefully temporary) fix for a bug in mist-cli where it isn't setting the permissions of the Install application properly.
- Remove ANSI formatting from mist-cli output when listing installers.
- Output stderr from swiftDialog to dev/null to avoid occasional Xfont error warnings in logs
- Minor fixes.

## [30.0]

18.07.2023
Expand Down
44 changes: 27 additions & 17 deletions erase-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ script_name="erase-install"
pkg_label="com.github.grahampugh.erase-install"

# Version of this script
version="30.0"
version="30.1"

# Directory in which to place the macOS installer. Overridden with --path
installer_directory="/Applications"
Expand Down Expand Up @@ -127,7 +127,7 @@ ask_for_credentials() {
fi

# run the dialog command
"$dialog_bin" "${dialog_args[@]}" > "$dialog_output"
"$dialog_bin" "${dialog_args[@]}" 2>/dev/null > "$dialog_output"
}

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -168,7 +168,7 @@ check_fmm() {
"${fmm_wait_timer}"
)
# run the dialog command
"$dialog_bin" "${dialog_args[@]}" & sleep 0.1
"$dialog_bin" "${dialog_args[@]}" 2>/dev/null & sleep 0.1

# now count down while checking for power
while [[ "$fmm_wait_timer" -gt 0 ]]; do
Expand Down Expand Up @@ -203,7 +203,7 @@ check_fmm() {
"${(P)dialog_fmmenabled_desc}"
)
# run the dialog command
"$dialog_bin" "${dialog_args[@]}"
"$dialog_bin" "${dialog_args[@]}" 2>/dev/null

writelog "[wait_for_power] ERROR - Finy My still enabled after waiting for ${fmm_wait_timer}s, cannot continue."
echo
Expand Down Expand Up @@ -328,7 +328,7 @@ check_free_space() {
"${(P)dialog_cancel_button}"
)
# run the dialog command
"$dialog_bin" "${dialog_args[@]}"
"$dialog_bin" "${dialog_args[@]}" 2>/dev/null
exit 1
fi
}
Expand Down Expand Up @@ -487,6 +487,9 @@ check_newer_available() {
mist_args+=("--include-betas")
fi

# run in no-ansi mode which is less pretty but better for our logs
mist_args+=("--no-ansi")

# run mist with --list and then interrogate the plist
if "$mist_bin" "${mist_args[@]}" ; then
newer_build_found="no"
Expand Down Expand Up @@ -569,8 +572,8 @@ check_power_status() {
"--timer"
"${power_wait_timer}"
)
# run the dialog command
"$dialog_bin" "${dialog_args[@]}" & sleep 0.1
# run the dialog command (stderr to dev/null to prevent Xfont errors)
"$dialog_bin" "${dialog_args[@]}" 2>/dev/null & sleep 0.1

# now count down while checking for power
while [[ "$power_wait_timer" -gt 0 ]]; do
Expand Down Expand Up @@ -605,7 +608,7 @@ check_power_status() {
"${(P)dialog_nopower_desc}"
)
# run the dialog command
"$dialog_bin" "${dialog_args[@]}"
"$dialog_bin" "${dialog_args[@]}" 2>/dev/null

writelog "[wait_for_power] ERROR - No AC power detected after waiting for ${power_wait_timer}s, cannot continue."
echo
Expand Down Expand Up @@ -736,7 +739,7 @@ confirm() {
"${(P)dialog_cancel_button}"
)
# run the dialog command
"$dialog_bin" "${dialog_args[@]}"
"$dialog_bin" "${dialog_args[@]}" 2>/dev/null
confirmation=$?

if [[ "$confirmation" == "2" ]]; then
Expand Down Expand Up @@ -1171,6 +1174,7 @@ get_mist_list() {
if [[ "$skip_validation" != "yes" ]]; then
mist_args+=("--compatible")
fi

mist_args+=("--export")
mist_args+=("$mist_export_file")

Expand All @@ -1193,6 +1197,9 @@ get_mist_list() {
mist_args+=("--include-betas")
fi

# run in no-ansi mode which is less pretty but better for our logs
mist_args+=("--no-ansi")

# run the command
if ! "$mist_bin" "${mist_args[@]}" ; then
writelog "[get_mist_list] An error occurred running mist. Cannot continue."
Expand Down Expand Up @@ -1539,7 +1546,7 @@ post_prep_work() {
"$rebootdelay"
)
# run the dialog command
"$dialog_bin" "${dialog_args[@]}" & sleep 0.1
"$dialog_bin" "${dialog_args[@]}" 2>/dev/null & sleep 0.1

dialog_progress reboot-delay >/dev/null 2>&1 &
fi
Expand Down Expand Up @@ -2374,7 +2381,7 @@ user_is_invalid() {
"${(P)dialog_invalid_user}"
)
# run the dialog command
"$dialog_bin" "${dialog_args[@]}"
"$dialog_bin" "${dialog_args[@]}" 2>/dev/null
fi
}

Expand Down Expand Up @@ -2402,7 +2409,7 @@ password_is_invalid() {
"${(P)dialog_invalid_password} $user"
)
# run the dialog command
"$dialog_bin" "${dialog_args[@]}"
"$dialog_bin" "${dialog_args[@]}" 2>/dev/null
fi
}

Expand Down Expand Up @@ -2431,7 +2438,7 @@ user_not_volume_owner() {
"$account_shortname ${(P)dialog_not_volume_owner}: ${enabled_users}"
)
# run the dialog command
"$dialog_bin" "${dialog_args[@]}"
"$dialog_bin" "${dialog_args[@]}" 2>/dev/null
fi
}

Expand Down Expand Up @@ -3068,7 +3075,7 @@ if [[ ! -d "$working_macos_app" && ! -f "$working_installer_pkg" ]]; then
"100"
)
# run the dialog command
"$dialog_bin" "${dialog_args[@]}" & sleep 0.1
"$dialog_bin" "${dialog_args[@]}" 2>/dev/null & sleep 0.1
fi

if [[ $ffi ]]; then
Expand Down Expand Up @@ -3249,7 +3256,7 @@ if [[ $erase == "yes" && ! $silent ]]; then
"100"
)
# run the dialog command
"$dialog_bin" "${dialog_args[@]}" & sleep 0.1
"$dialog_bin" "${dialog_args[@]}" 2>/dev/null & sleep 0.1

dialog_progress startosinstall >/dev/null 2>&1 &

Expand All @@ -3269,7 +3276,7 @@ elif [[ $reinstall == "yes" && ! $silent ]]; then
"100"
)
# run the dialog command
"$dialog_bin" "${dialog_args[@]}" & sleep 0.1
"$dialog_bin" "${dialog_args[@]}" 2>/dev/null & sleep 0.1

dialog_progress startosinstall >/dev/null 2>&1 &
fi
Expand Down Expand Up @@ -3331,6 +3338,9 @@ if [[ "$arch" == "arm64" ]]; then
fi
fi

# fix for a bug in mist-cli to correct the installer app permissions
/bin/chmod -R 755 "$working_macos_app"

# now actually run startosinstall
launch_startosinstall

Expand All @@ -3350,5 +3360,5 @@ fi
wait $pipePID

# we are not supposed to end up here due to USR1 signalling, so something went wrong.
writelog "[$script_name] Reached end of script unexpectedly. This probably means startosinstall failed to complete within $(sleep_time/60) minutes."
writelog "[$script_name] Reached end of script unexpectedly. This probably means startosinstall failed to complete within $((sleep_time/60)) minutes."
exit 42
2 changes: 1 addition & 1 deletion pkg/erase-install/build-info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<key>suppress_bundle_relocation</key>
<true/>
<key>version</key>
<string>30.0</string>
<string>30.1</string>
</dict>
</plist>

0 comments on commit 4d5ace5

Please sign in to comment.