aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/build.rb3
-rw-r--r--Library/Homebrew/formula_installer.rb3
2 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb
index 8442801a7..d226cf9bd 100644
--- a/Library/Homebrew/build.rb
+++ b/Library/Homebrew/build.rb
@@ -168,9 +168,6 @@ begin
error_pipe = UNIXSocket.open(ENV["HOMEBREW_ERROR_PIPE"], &:recv_io)
error_pipe.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
- # Invalidate the current sudo timestamp in case a build script calls sudo
- system "/usr/bin/sudo", "-k"
-
trap("INT", old_trap)
formula = ARGV.formulae.first
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index c3de16cfd..72ae9a87e 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -547,6 +547,9 @@ class FormulaInstaller
end
Utils.safe_fork do
+ # Invalidate the current sudo timestamp in case a build script calls sudo
+ system "/usr/bin/sudo", "-k"
+
if Sandbox.available? && ARGV.sandbox? && !Sandbox.auto_disable?
sandbox = Sandbox.new
formula.logs.mkpath