diff options
| author | Xu Cheng | 2015-07-31 17:53:42 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-07-31 19:52:36 +0800 |
| commit | 2ebd1c974beb072d11defa368a85bbe0746c1135 (patch) | |
| tree | dc71abd2771721498acf3e9ddf826cbbca5a1512 /Library | |
| parent | 8054161153b598d392b0be25a882ae87a5455726 (diff) | |
| download | brew-2ebd1c974beb072d11defa368a85bbe0746c1135.tar.bz2 | |
print sandbox message
Closes Homebrew/homebrew#42293.
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/postinstall.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/test.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/sandbox.rb | 11 |
4 files changed, 27 insertions, 8 deletions
diff --git a/Library/Homebrew/cmd/postinstall.rb b/Library/Homebrew/cmd/postinstall.rb index 337fc62be..6630afba1 100644 --- a/Library/Homebrew/cmd/postinstall.rb +++ b/Library/Homebrew/cmd/postinstall.rb @@ -15,8 +15,12 @@ module Homebrew #{formula.path} ].concat(ARGV.options_only) - if Sandbox.available? && ARGV.sandbox? && Sandbox.auto_disable? - Sandbox.print_autodisable_warning + if Sandbox.available? && ARGV.sandbox? + if Sandbox.auto_disable? + Sandbox.print_autodisable_warning + else + Sandbox.print_sandbox_message + end end Utils.safe_fork do diff --git a/Library/Homebrew/cmd/test.rb b/Library/Homebrew/cmd/test.rb index d298452ff..7c3641426 100644 --- a/Library/Homebrew/cmd/test.rb +++ b/Library/Homebrew/cmd/test.rb @@ -35,8 +35,12 @@ module Homebrew #{f.path} ].concat(ARGV.options_only) - if Sandbox.available? && ARGV.sandbox? && Sandbox.auto_disable? - Sandbox.print_autodisable_warning + if Sandbox.available? && ARGV.sandbox? + if Sandbox.auto_disable? + Sandbox.print_autodisable_warning + else + Sandbox.print_sandbox_message + end end Utils.safe_fork do diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 355517e49..c372ba287 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -486,8 +486,12 @@ class FormulaInstaller #{formula.path} ].concat(build_argv) - if Sandbox.available? && ARGV.sandbox? && Sandbox.auto_disable? - Sandbox.print_autodisable_warning + if Sandbox.available? && ARGV.sandbox? + if Sandbox.auto_disable? + Sandbox.print_autodisable_warning + else + Sandbox.print_sandbox_message + end end Utils.safe_fork do diff --git a/Library/Homebrew/sandbox.rb b/Library/Homebrew/sandbox.rb index 3affa4f95..7ad845d5e 100644 --- a/Library/Homebrew/sandbox.rb +++ b/Library/Homebrew/sandbox.rb @@ -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 |
