diff --git a/lib/homebrew-fork/Library/Homebrew/resource.rb b/lib/homebrew-fork/Library/Homebrew/resource.rb index 815700d1238..c1d10b68a4c 100644 --- a/lib/homebrew-fork/Library/Homebrew/resource.rb +++ b/lib/homebrew-fork/Library/Homebrew/resource.rb @@ -37,7 +37,7 @@ class Resource # /tmp volume to the other volume. So we let the user override the tmp # prefix if they need to. - tempd = with_system_path { `mktemp -d #{HOMEBREW_TEMP}/#{prefix}-XXXXXX` }.chomp + tempd = `/usr/bin/mktemp -d #{HOMEBREW_TEMP}/#{prefix}-XXXXXX`.chomp raise "Failed to create sandbox" if tempd.empty? prevd = pwd cd tempd diff --git a/lib/homebrew-fork/Library/Homebrew/utils.rb b/lib/homebrew-fork/Library/Homebrew/utils.rb index dcb2e1e4e66..3d77ed6df7d 100644 --- a/lib/homebrew-fork/Library/Homebrew/utils.rb +++ b/lib/homebrew-fork/Library/Homebrew/utils.rb @@ -73,14 +73,6 @@ module Homebrew end end -def with_system_path - old_path = ENV['PATH'] - ENV['PATH'] = '/usr/bin:/bin' - yield -ensure - ENV['PATH'] = old_path -end - # Kernel.system but with exceptions def safe_system cmd, *args Homebrew.system(cmd, *args) or raise ErrorDuringExecution.new(cmd, args) @@ -169,7 +161,7 @@ end # GZips the given paths, and returns the gzipped paths def gzip *paths paths.collect do |path| - with_system_path { safe_system 'gzip', path } + safe_system '/usr/bin/gzip', path Pathname.new("#{path}.gz") end end