HOMEBREW_CACHE is now a Pathname object
This is consistent with the other HOMEBREW_* path constants
This commit is contained in:
parent
8ce4e5923f
commit
33b90794e1
@ -20,6 +20,6 @@ require 'utils'
|
||||
|
||||
# TODO if whoami == root then use /Library/Caches/Homebrew instead
|
||||
HOMEBREW_VERSION='0.3'
|
||||
HOMEBREW_CACHE=File.expand_path "~/Library/Caches/Homebrew"
|
||||
HOMEBREW_CACHE=Pathname.new("~/Library/Caches/Homebrew").expand_path
|
||||
HOMEBREW_PREFIX=Pathname.new(__FILE__).dirname.parent.parent.cleanpath
|
||||
HOMEBREW_CELLAR=HOMEBREW_PREFIX+'Cellar'
|
||||
|
@ -96,7 +96,7 @@ public
|
||||
# yields self with current working directory set to the uncompressed tarball
|
||||
def brew
|
||||
ohai "Downloading #{@url}"
|
||||
FileUtils.mkpath HOMEBREW_CACHE
|
||||
HOMEBREW_CACHE.mkpath
|
||||
Dir.chdir HOMEBREW_CACHE do
|
||||
tmp=nil
|
||||
tgz=Pathname.new(fetch()).realpath
|
||||
|
@ -1,7 +1,7 @@
|
||||
def hw_model_output
|
||||
require 'fileutils'
|
||||
FileUtils.mkpath HOMEBREW_CACHE
|
||||
exe=Pathname.new(HOMEBREW_CACHE)+'hw.model'
|
||||
HOMEBREW_CACHE.mkpath
|
||||
exe=HOMEBREW_CACHE+'hw.model'
|
||||
Kernel.system "gcc -Os #{File.dirname __FILE__}/hw.model.c -o #{exe}" unless exe.file?
|
||||
/(.*)(\d+),(\d+)/ =~ `#{exe}`
|
||||
yield $1, $2.to_i, $3.to_i
|
||||
|
@ -9,13 +9,13 @@ require 'utils'
|
||||
# these are defined in env.rb usually, but we don't want to break our actual
|
||||
# homebrew tree, and we do want to test everything :)
|
||||
HOMEBREW_VERSION='0.3t'
|
||||
HOMEBREW_CACHE="/tmp/testbrew"
|
||||
HOMEBREW_CACHE=Pathname.new "/tmp/testbrew"
|
||||
HOMEBREW_PREFIX=Pathname.new(HOMEBREW_CACHE)+'prefix'
|
||||
HOMEBREW_CELLAR=Pathname.new(HOMEBREW_CACHE)+'cellar'
|
||||
|
||||
HOMEBREW_CELLAR.mkpath
|
||||
raise "HOMEBREW_CELLAR couldn't be created!" unless HOMEBREW_CELLAR.directory?
|
||||
at_exit { Pathname.new(HOMEBREW_CACHE).rmtree }
|
||||
at_exit { HOMEBREW_CACHE.rmtree }
|
||||
require 'test/unit' # must be after at_exit
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user