From 229eef56b53cd14673379ce35faf9bd4148e3aa1 Mon Sep 17 00:00:00 2001 From: Meg Cassidy Date: Fri, 11 Nov 2016 13:13:27 -0800 Subject: [PATCH] Fixed update.sh to work with Sierra This section would hang at the "Searching for Software Updates" prompt and never finish. To fix it, I had to add the --verbose and --force flags to be compatible with 10.12, as well as triggering a background scan. It would then fail during the vboxmanage_post command for the IDE Controller, because the shutdown was failing to complete properly (the background scan didn't seem to be finished). The sleep line fixes this. Signed-off-by: Meg Cassidy --- scripts/macosx/update.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/macosx/update.sh b/scripts/macosx/update.sh index b4cd8ff93..e1415eb01 100644 --- a/scripts/macosx/update.sh +++ b/scripts/macosx/update.sh @@ -1,3 +1,16 @@ #!/bin/sh -eux -softwareupdate --install --all; +MACOS_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}') + +if [ "$MACOS_VERS" -le 11 ] ; then + softwareupdate --install --all; +fi + +# --force became an option in 10.12 (Sierra) and will fail on other versions +if [ "$MACOS_VERS" -ge 12 ] ; then + softwareupdate --background --force --verbose; + softwareupdate --install --all --force --verbose; + # vboxmanage_post commands fail without this sleep because the system + # is not done with the softwareupdate background checks + sleep 3; +fi