print sandbox message
Closes Homebrew/homebrew#42293. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
8054161153
commit
2ebd1c974b
@ -15,8 +15,12 @@ module Homebrew
|
|||||||
#{formula.path}
|
#{formula.path}
|
||||||
].concat(ARGV.options_only)
|
].concat(ARGV.options_only)
|
||||||
|
|
||||||
if Sandbox.available? && ARGV.sandbox? && Sandbox.auto_disable?
|
if Sandbox.available? && ARGV.sandbox?
|
||||||
Sandbox.print_autodisable_warning
|
if Sandbox.auto_disable?
|
||||||
|
Sandbox.print_autodisable_warning
|
||||||
|
else
|
||||||
|
Sandbox.print_sandbox_message
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Utils.safe_fork do
|
Utils.safe_fork do
|
||||||
|
|||||||
@ -35,8 +35,12 @@ module Homebrew
|
|||||||
#{f.path}
|
#{f.path}
|
||||||
].concat(ARGV.options_only)
|
].concat(ARGV.options_only)
|
||||||
|
|
||||||
if Sandbox.available? && ARGV.sandbox? && Sandbox.auto_disable?
|
if Sandbox.available? && ARGV.sandbox?
|
||||||
Sandbox.print_autodisable_warning
|
if Sandbox.auto_disable?
|
||||||
|
Sandbox.print_autodisable_warning
|
||||||
|
else
|
||||||
|
Sandbox.print_sandbox_message
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Utils.safe_fork do
|
Utils.safe_fork do
|
||||||
|
|||||||
@ -486,8 +486,12 @@ class FormulaInstaller
|
|||||||
#{formula.path}
|
#{formula.path}
|
||||||
].concat(build_argv)
|
].concat(build_argv)
|
||||||
|
|
||||||
if Sandbox.available? && ARGV.sandbox? && Sandbox.auto_disable?
|
if Sandbox.available? && ARGV.sandbox?
|
||||||
Sandbox.print_autodisable_warning
|
if Sandbox.auto_disable?
|
||||||
|
Sandbox.print_autodisable_warning
|
||||||
|
else
|
||||||
|
Sandbox.print_sandbox_message
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Utils.safe_fork do
|
Utils.safe_fork do
|
||||||
|
|||||||
@ -14,9 +14,16 @@ class Sandbox
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.print_autodisable_warning
|
def self.print_autodisable_warning
|
||||||
unless @print_autodisable_warning
|
unless @printed_autodisable_warning
|
||||||
opoo "The sandbox cannot be used in debug or interactive mode."
|
opoo "The sandbox cannot be used in debug or interactive mode."
|
||||||
@print_autodisable_warning = true
|
@printed_autodisable_warning = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.print_sandbox_message
|
||||||
|
unless @printed_sandbox_message
|
||||||
|
ohai "Using the sandbox"
|
||||||
|
@printed_sandbox_message = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user