ENV: protect against environment being reset
We cannot really recover from this, but at least we'll provide a clearer error message than trying to call `exec` with an empty string.
This commit is contained in:
parent
f9efa18be1
commit
5f049637d9
@ -2,6 +2,11 @@
|
|||||||
# Make sure this shim uses the same Ruby interpreter that is used by Homebrew.
|
# Make sure this shim uses the same Ruby interpreter that is used by Homebrew.
|
||||||
unset RUBYLIB
|
unset RUBYLIB
|
||||||
unset RUBYOPT
|
unset RUBYOPT
|
||||||
|
if [ -z "$HOMEBREW_RUBY_PATH" ]
|
||||||
|
then
|
||||||
|
echo "${0##*/}: The build tool has reset ENV; --env=std required." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
exec "$HOMEBREW_RUBY_PATH" -x "$0" "$@"
|
exec "$HOMEBREW_RUBY_PATH" -x "$0" "$@"
|
||||||
#!/usr/bin/env ruby -W0
|
#!/usr/bin/env ruby -W0
|
||||||
|
|
||||||
@ -308,7 +313,6 @@ end
|
|||||||
|
|
||||||
if __FILE__ == $PROGRAM_NAME
|
if __FILE__ == $PROGRAM_NAME
|
||||||
##################################################################### sanity
|
##################################################################### sanity
|
||||||
abort "The build-tool has reset ENV. --env=std required." unless ENV["HOMEBREW_BREW_FILE"]
|
|
||||||
|
|
||||||
if (cc = ENV["HOMEBREW_CC"]).nil? || cc.empty? || cc == "cc"
|
if (cc = ENV["HOMEBREW_CC"]).nil? || cc.empty? || cc == "cc"
|
||||||
# those values are not allowed
|
# those values are not allowed
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
# Make sure this shim uses the same Ruby interpreter that is used by Homebrew.
|
# Make sure this shim uses the same Ruby interpreter that is used by Homebrew.
|
||||||
unset RUBYLIB
|
unset RUBYLIB
|
||||||
unset RUBYOPT
|
unset RUBYOPT
|
||||||
|
if [ -z "$HOMEBREW_RUBY_PATH" ]
|
||||||
|
then
|
||||||
|
echo "${0##*/}: The build tool has reset ENV; --env=std required." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
exec "$HOMEBREW_RUBY_PATH" -x "$0" "$@"
|
exec "$HOMEBREW_RUBY_PATH" -x "$0" "$@"
|
||||||
#!/usr/bin/env ruby -W0
|
#!/usr/bin/env ruby -W0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user