@@ -35,6 +35,8 @@ function log_tree() {
3535}
3636
3737function install_dependencies() {
38+ declare extra=" ${1} "
39+
3840 declare -a debian_pkgs=()
3941 declare -a brew_pkgs=()
4042
@@ -48,21 +50,23 @@ function install_dependencies() {
4850 brew_pkgs+=(" pigz" )
4951 }
5052
51- command -v pixz > /dev/null || {
52- debian_pkgs+=(" pixz" )
53- brew_pkgs+=(" pixz" )
54- }
55-
56- command -v pv > /dev/null || {
57- debian_pkgs+=(" pv" )
58- brew_pkgs+=(" pv" )
59- }
60-
6153 command -v envsubst > /dev/null || {
6254 debian_pkgs+=(" gettext-base" )
6355 brew_pkgs+=(" gettext" )
6456 }
6557
58+ if [[ " ${extra} " == " bootable-media" ]]; then
59+ command -v pixz > /dev/null || {
60+ debian_pkgs+=(" pixz" )
61+ brew_pkgs+=(" pixz" )
62+ }
63+
64+ command -v pv > /dev/null || {
65+ debian_pkgs+=(" pv" )
66+ brew_pkgs+=(" pv" )
67+ }
68+ fi
69+
6670 if [[ " $( uname) " == " Darwin" ]]; then
6771 command -v gtar > /dev/null || brew_pkgs+=(" gnu-tar" )
6872 command -v greadlink > /dev/null || brew_pkgs+=(" coreutils" )
@@ -91,11 +95,13 @@ function install_dependencies() {
9195 brew install " ${brew_pkgs[@]} "
9296 fi
9397
94- # Re-export PATH with the gnu-version of coreutils, tar, and sed
95- declare brew_prefix
96- brew_prefix=" $( brew --prefix) "
97- export PATH=" ${brew_prefix} /opt/gnu-sed/libexec/gnubin:${brew_prefix} /opt/gnu-tar/libexec/gnubin:${brew_prefix} /opt/coreutils/libexec/gnubin:${PATH} "
98- log debug " Darwin; PATH is now: ${PATH} "
98+ if [[ " ${extra} " == " " ]]; then # Do not to this if extra dependencies are being installed
99+ # Re-export PATH with the gnu-version of coreutils, tar, and sed
100+ declare brew_prefix
101+ brew_prefix=" $( brew --prefix) "
102+ export PATH=" ${brew_prefix} /opt/gnu-sed/libexec/gnubin:${brew_prefix} /opt/gnu-tar/libexec/gnubin:${brew_prefix} /opt/coreutils/libexec/gnubin:${PATH} "
103+ log debug " Darwin; PATH is now: ${PATH} "
104+ fi
99105 fi
100106
101107 return 0
0 commit comments