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}
|
||||
].concat(ARGV.options_only)
|
||||
|
||||
if Sandbox.available? && ARGV.sandbox? && Sandbox.auto_disable?
|
||||
if Sandbox.available? && ARGV.sandbox?
|
||||
if Sandbox.auto_disable?
|
||||
Sandbox.print_autodisable_warning
|
||||
else
|
||||
Sandbox.print_sandbox_message
|
||||
end
|
||||
end
|
||||
|
||||
Utils.safe_fork do
|
||||
|
||||
@ -35,8 +35,12 @@ module Homebrew
|
||||
#{f.path}
|
||||
].concat(ARGV.options_only)
|
||||
|
||||
if Sandbox.available? && ARGV.sandbox? && Sandbox.auto_disable?
|
||||
if Sandbox.available? && ARGV.sandbox?
|
||||
if Sandbox.auto_disable?
|
||||
Sandbox.print_autodisable_warning
|
||||
else
|
||||
Sandbox.print_sandbox_message
|
||||
end
|
||||
end
|
||||
|
||||
Utils.safe_fork do
|
||||
|
||||
@ -486,8 +486,12 @@ class FormulaInstaller
|
||||
#{formula.path}
|
||||
].concat(build_argv)
|
||||
|
||||
if Sandbox.available? && ARGV.sandbox? && Sandbox.auto_disable?
|
||||
if Sandbox.available? && ARGV.sandbox?
|
||||
if Sandbox.auto_disable?
|
||||
Sandbox.print_autodisable_warning
|
||||
else
|
||||
Sandbox.print_sandbox_message
|
||||
end
|
||||
end
|
||||
|
||||
Utils.safe_fork do
|
||||
|
||||
@ -14,9 +14,16 @@ class Sandbox
|
||||
end
|
||||
|
||||
def self.print_autodisable_warning
|
||||
unless @print_autodisable_warning
|
||||
unless @printed_autodisable_warning
|
||||
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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user