2015-04-28 22:37:26 -04:00
|
|
|
def cache
|
2015-06-15 21:18:12 -04:00
|
|
|
if ENV["HOMEBREW_CACHE"]
|
|
|
|
Pathname.new(ENV["HOMEBREW_CACHE"]).expand_path
|
2015-04-28 22:37:26 -04:00
|
|
|
else
|
|
|
|
# we do this for historic reasons, however the cache *should* be the same
|
|
|
|
# directory whichever user is used and whatever instance of brew is executed
|
|
|
|
home_cache = Pathname.new("~/Library/Caches/Homebrew").expand_path
|
2015-08-06 15:45:52 +08:00
|
|
|
if home_cache.directory? && home_cache.writable_real?
|
2015-04-28 22:37:26 -04:00
|
|
|
home_cache
|
|
|
|
else
|
|
|
|
Pathname.new("/Library/Caches/Homebrew").extend Module.new {
|
|
|
|
def mkpath
|
|
|
|
unless exist?
|
|
|
|
super
|
|
|
|
chmod 0775
|
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
HOMEBREW_CACHE = cache
|
|
|
|
undef cache
|
|
|
|
|
|
|
|
# Where brews installed via URL are cached
|
|
|
|
HOMEBREW_CACHE_FORMULA = HOMEBREW_CACHE+"Formula"
|
|
|
|
|
2016-01-27 10:29:58 +00:00
|
|
|
HOMEBREW_BREW_FILE = ENV["HOMEBREW_BREW_FILE"]
|
|
|
|
unless HOMEBREW_BREW_FILE
|
|
|
|
odie "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!"
|
2015-04-28 22:37:26 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
# Where we link under
|
2015-12-25 22:42:00 +00:00
|
|
|
HOMEBREW_PREFIX = Pathname.new(ENV["HOMEBREW_PREFIX"])
|
2015-04-28 22:37:26 -04:00
|
|
|
|
|
|
|
# Where .git is found
|
2015-12-25 22:42:00 +00:00
|
|
|
HOMEBREW_REPOSITORY = Pathname.new(ENV["HOMEBREW_REPOSITORY"])
|
2015-04-28 22:37:26 -04:00
|
|
|
|
2015-12-25 22:42:00 +00:00
|
|
|
HOMEBREW_LIBRARY = Pathname.new(ENV["HOMEBREW_LIBRARY"])
|
2015-04-28 22:37:26 -04:00
|
|
|
HOMEBREW_CONTRIB = HOMEBREW_REPOSITORY/"Library/Contributions"
|
|
|
|
|
2015-12-25 22:42:00 +00:00
|
|
|
# Where we store built products
|
|
|
|
HOMEBREW_CELLAR = Pathname.new(ENV["HOMEBREW_CELLAR"])
|
2015-04-28 22:37:26 -04:00
|
|
|
|
2015-08-03 13:09:07 +01:00
|
|
|
HOMEBREW_LOGS = Pathname.new(ENV["HOMEBREW_LOGS"] || "~/Library/Logs/Homebrew/").expand_path
|
2015-04-28 22:37:26 -04:00
|
|
|
|
2016-01-30 21:40:26 -05:00
|
|
|
# Must use /tmp instead of $TMPDIR because long paths break Unix domain sockets
|
2015-08-03 13:09:07 +01:00
|
|
|
HOMEBREW_TEMP = Pathname.new(ENV.fetch("HOMEBREW_TEMP", "/tmp"))
|
2015-04-28 22:37:27 -04:00
|
|
|
|
2015-08-03 13:09:07 +01:00
|
|
|
unless defined? HOMEBREW_LIBRARY_PATH
|
2015-04-28 22:37:27 -04:00
|
|
|
HOMEBREW_LIBRARY_PATH = Pathname.new(__FILE__).realpath.parent.join("Homebrew")
|
|
|
|
end
|
|
|
|
|
|
|
|
HOMEBREW_LOAD_PATH = HOMEBREW_LIBRARY_PATH
|