remove homebrew-fork with_system_path method

This commit is contained in:
Roland Walker 2014-12-20 15:57:34 -05:00
parent 8b7936ff41
commit 9f218ee765
2 changed files with 2 additions and 10 deletions

View File

@ -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

View File

@ -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