From 9b87484fd271ab5633db0e0ce9e649bd0aa74220 Mon Sep 17 00:00:00 2001 From: deepio Date: Mon, 29 Jul 2019 14:37:54 -0400 Subject: [PATCH 1/4] Added: MacOS compat. https://github.com/myspaghetti/macos-guest-virtualbox/issues/39 --- macos-guest-virtualbox.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/macos-guest-virtualbox.sh b/macos-guest-virtualbox.sh index 6d92108..bb6bd40 100644 --- a/macos-guest-virtualbox.sh +++ b/macos-guest-virtualbox.sh @@ -110,8 +110,9 @@ read function check_dependencies() { # check if running on macOS if [ -n "$(sw_vers 2>/dev/null)" ]; then - printf '\nThis script is not tested on macOS hosts. Exiting.\n' - exit + printf '\nThis script is not completely tested on macOS hosts.\nVisit https://github.com/myspaghetti/macos-guest-virtualbox/issues/39 for more information\n' + read -p "Press enter to continue.\n" + export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" fi # check Bash version From 9a6faff3ded2564aca8566273ae22672d48645ac Mon Sep 17 00:00:00 2001 From: Alex Daigle Date: Wed, 31 Jul 2019 09:49:58 -0400 Subject: [PATCH 2/4] Fixed: Typo, lingering \n --- macos-guest-virtualbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macos-guest-virtualbox.sh b/macos-guest-virtualbox.sh index bb6bd40..4ea44c3 100644 --- a/macos-guest-virtualbox.sh +++ b/macos-guest-virtualbox.sh @@ -111,7 +111,7 @@ function check_dependencies() { # check if running on macOS if [ -n "$(sw_vers 2>/dev/null)" ]; then printf '\nThis script is not completely tested on macOS hosts.\nVisit https://github.com/myspaghetti/macos-guest-virtualbox/issues/39 for more information\n' - read -p "Press enter to continue.\n" + read -p "Press enter to continue." export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" fi From d881bed4a25d40184cdc7aeebb6432ced557435f Mon Sep 17 00:00:00 2001 From: Jack <31696646+myspaghetti@users.noreply.github.com> Date: Wed, 31 Jul 2019 18:11:41 +0300 Subject: [PATCH 3/4] macOS coreutils --- macos-guest-virtualbox.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/macos-guest-virtualbox.sh b/macos-guest-virtualbox.sh index 4ea44c3..f224e0e 100644 --- a/macos-guest-virtualbox.sh +++ b/macos-guest-virtualbox.sh @@ -2,7 +2,7 @@ # Semi-automatic installer of macOS on VirtualBox # (c) myspaghetti, licensed under GPL2.0 or higher # url: https://github.com/img2tab/macos-guest-virtualbox -# version 0.71.7 +# version 0.72.0 # Requirements: 40GB available storage on host # Dependencies: bash >= 4.0, unzip, wget, dmg2img, @@ -108,11 +108,13 @@ read # check dependencies function check_dependencies() { -# check if running on macOS -if [ -n "$(sw_vers 2>/dev/null)" ]; then - printf '\nThis script is not completely tested on macOS hosts.\nVisit https://github.com/myspaghetti/macos-guest-virtualbox/issues/39 for more information\n' - read -p "Press enter to continue." - export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" +# check if running on macOS and non-GNU coreutils +if [ -n "$(sw_vers 2>/dev/null)" -a -z "$(csplit --help 2>/dev/null)" ]; then + printf 'macOS detected. Please use a package manager such as '"${white_on_black}"'homebrew'"${default_color}"', '"${white_on_black}"'nix'"${default_color}"', or '"${white_on_black}"'MacPorts'"${default_color}"'.\n' + echo "Please make sure the following packages are installed and their path is in the PATH variable:" + printf "${white_on_black}"'bash coreutils wget unzip dmg2img'"${default_color}"'\n' + echo "Please make sure bash and coreutils are the GNU variant." + exit fi # check Bash version @@ -126,10 +128,11 @@ fi # check for unzip, coreutils, wget if [ -z "$(unzip -hh 2>/dev/null)" \ - -o -z "$(head --version 2>/dev/null)" \ + -o -z "$(csplit --help 2>/dev/null)" \ -o -z "$(wget --version 2>/dev/null)" ]; then echo "Please make sure the following packages are installed:" echo "coreutils unzip wget" + echo "Please make sure coreutils is the GNU variant." exit fi From b9b95436097566fc93b849d90c36f0cadb39b3f1 Mon Sep 17 00:00:00 2001 From: Jack <31696646+myspaghetti@users.noreply.github.com> Date: Wed, 31 Jul 2019 18:15:18 +0300 Subject: [PATCH 4/4] Update macos-guest-virtualbox.sh --- macos-guest-virtualbox.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/macos-guest-virtualbox.sh b/macos-guest-virtualbox.sh index f224e0e..50e6448 100644 --- a/macos-guest-virtualbox.sh +++ b/macos-guest-virtualbox.sh @@ -111,7 +111,8 @@ function check_dependencies() { # check if running on macOS and non-GNU coreutils if [ -n "$(sw_vers 2>/dev/null)" -a -z "$(csplit --help 2>/dev/null)" ]; then printf 'macOS detected. Please use a package manager such as '"${white_on_black}"'homebrew'"${default_color}"', '"${white_on_black}"'nix'"${default_color}"', or '"${white_on_black}"'MacPorts'"${default_color}"'.\n' - echo "Please make sure the following packages are installed and their path is in the PATH variable:" + echo "Please make sure the following packages are installed and that" + echo "their path is in the PATH variable:" printf "${white_on_black}"'bash coreutils wget unzip dmg2img'"${default_color}"'\n' echo "Please make sure bash and coreutils are the GNU variant." exit