2015-08-03 13:09:07 +01:00
|
|
|
require "extend/module"
|
|
|
|
require "extend/fileutils"
|
|
|
|
require "extend/pathname"
|
|
|
|
require "extend/ARGV"
|
|
|
|
require "extend/string"
|
2015-08-06 17:20:02 +08:00
|
|
|
require "extend/enumerable"
|
2015-08-03 13:09:07 +01:00
|
|
|
require "os"
|
|
|
|
require "utils"
|
|
|
|
require "exceptions"
|
|
|
|
require "set"
|
|
|
|
require "rbconfig"
|
2009-09-04 15:28:18 +01:00
|
|
|
|
2009-10-15 12:36:09 +01:00
|
|
|
ARGV.extend(HomebrewArgvExtension)
|
|
|
|
|
2016-03-10 13:41:02 +00:00
|
|
|
HOMEBREW_VERSION = ENV["HOMEBREW_VERSION"]
|
2015-08-03 13:09:07 +01:00
|
|
|
HOMEBREW_WWW = "http://brew.sh"
|
2009-10-15 12:36:09 +01:00
|
|
|
|
2015-04-28 22:37:26 -04:00
|
|
|
require "config"
|
2013-12-14 09:35:58 -06:00
|
|
|
|
2014-06-09 21:36:36 -05:00
|
|
|
if RbConfig.respond_to?(:ruby)
|
|
|
|
RUBY_PATH = Pathname.new(RbConfig.ruby)
|
|
|
|
else
|
|
|
|
RUBY_PATH = Pathname.new(RbConfig::CONFIG["bindir"]).join(
|
|
|
|
RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
|
|
|
|
)
|
|
|
|
end
|
|
|
|
RUBY_BIN = RUBY_PATH.dirname
|
2013-03-10 17:02:06 +00:00
|
|
|
|
2012-03-16 15:14:20 +13:00
|
|
|
HOMEBREW_USER_AGENT = "Homebrew #{HOMEBREW_VERSION} (Ruby #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}; #{OS_VERSION})"
|
2009-11-05 21:37:51 +00:00
|
|
|
|
2015-08-03 13:09:07 +01:00
|
|
|
HOMEBREW_CURL_ARGS = "-f#LA"
|
2009-11-05 21:37:51 +00:00
|
|
|
|
2015-08-03 13:09:07 +01:00
|
|
|
require "tap_constants"
|
2013-10-21 04:24:54 +01:00
|
|
|
|
2014-06-18 22:41:47 -05:00
|
|
|
module Homebrew
|
2010-09-11 20:22:54 +01:00
|
|
|
include FileUtils
|
2014-06-18 22:41:47 -05:00
|
|
|
extend self
|
2012-03-15 10:57:34 +13:00
|
|
|
|
|
|
|
attr_accessor :failed
|
|
|
|
alias_method :failed?, :failed
|
2010-09-11 20:22:54 +01:00
|
|
|
end
|
|
|
|
|
2015-12-13 01:25:58 +08:00
|
|
|
HOMEBREW_PULL_API_REGEX = %r{https://api\.github\.com/repos/([\w-]+)/homebrew(-[\w-]+)?/pulls/(\d+)}
|
2014-07-21 17:27:37 -05:00
|
|
|
HOMEBREW_PULL_OR_COMMIT_URL_REGEX = %r[https://github\.com/([\w-]+)/homebrew(-[\w-]+)?/(?:pull/(\d+)|commit/[0-9a-fA-F]{4,40})]
|
2011-08-02 12:00:30 +01:00
|
|
|
|
2015-08-03 13:09:07 +01:00
|
|
|
require "compat" unless ARGV.include?("--no-compat") || ENV["HOMEBREW_NO_COMPAT"]
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
|
2015-08-03 13:09:07 +01:00
|
|
|
ORIGINAL_PATHS = ENV["PATH"].split(File::PATH_SEPARATOR).map { |p| Pathname.new(p).expand_path rescue nil }.compact.freeze
|
2015-06-26 15:19:27 +08:00
|
|
|
|
2016-02-15 11:31:10 +00:00
|
|
|
# TODO: remove this as soon as it's removed from commands.rb.
|
2015-06-26 15:19:27 +08:00
|
|
|
HOMEBREW_INTERNAL_COMMAND_ALIASES = {
|
2015-08-03 13:09:07 +01:00
|
|
|
"ls" => "list",
|
|
|
|
"homepage" => "home",
|
|
|
|
"-S" => "search",
|
|
|
|
"up" => "update",
|
|
|
|
"ln" => "link",
|
|
|
|
"instal" => "install", # gem does the same
|
|
|
|
"rm" => "uninstall",
|
|
|
|
"remove" => "uninstall",
|
|
|
|
"configure" => "diy",
|
|
|
|
"abv" => "info",
|
|
|
|
"dr" => "doctor",
|
|
|
|
"--repo" => "--repository",
|
|
|
|
"environment" => "--env",
|
|
|
|
"--config" => "config"
|
2015-06-26 15:19:27 +08:00
|
|
|
}
|