aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/brew.sh3
-rw-r--r--Library/Homebrew/build.rb2
-rw-r--r--Library/Homebrew/cask/test/cask/artifact/suite_test.rb2
-rw-r--r--Library/Homebrew/cmd/install.rb3
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb14
-rw-r--r--Library/Homebrew/dev-cmd/create.rb6
-rw-r--r--Library/Homebrew/download_strategy.rb104
-rw-r--r--Library/Homebrew/extend/ENV/shared.rb2
-rw-r--r--Library/Homebrew/formula.rb12
-rw-r--r--Library/Homebrew/formula_installer.rb7
-rw-r--r--Library/Homebrew/formula_support.rb47
-rw-r--r--Library/Homebrew/manpages/brew.1.md.erb2
-rw-r--r--Library/Homebrew/requirement.rb36
-rw-r--r--Library/Homebrew/test/download_strategies_test.rb76
-rw-r--r--Library/Homebrew/test/formula_test.rb38
-rw-r--r--docs/Formula-Cookbook.md2
-rw-r--r--docs/Versions.md2
-rw-r--r--docs/brew.1.html7
-rw-r--r--manpages/brew.15
19 files changed, 310 insertions, 60 deletions
diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh
index 92953001d..81a52f474 100644
--- a/Library/Homebrew/brew.sh
+++ b/Library/Homebrew/brew.sh
@@ -82,6 +82,9 @@ unset GEM_PATH
# bash processes inside builds
unset BASH_ENV
+# Users may have this set, breaking grep's output.
+unset GREP_OPTIONS
+
HOMEBREW_SYSTEM="$(uname -s)"
case "$HOMEBREW_SYSTEM" in
Darwin) HOMEBREW_MACOS="1" ;;
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb
index c4e903642..c0f15158d 100644
--- a/Library/Homebrew/build.rb
+++ b/Library/Homebrew/build.rb
@@ -48,7 +48,7 @@ class Build
Requirement.prune
elsif req.build? && dependent != formula
Requirement.prune
- elsif req.satisfied? && req.default_formula? && (dep = req.to_dependency).installed?
+ elsif req.satisfied? && (dep = req.to_dependency) && dep.installed?
deps << dep
Requirement.prune
end
diff --git a/Library/Homebrew/cask/test/cask/artifact/suite_test.rb b/Library/Homebrew/cask/test/cask/artifact/suite_test.rb
index b2949950e..ed151e45c 100644
--- a/Library/Homebrew/cask/test/cask/artifact/suite_test.rb
+++ b/Library/Homebrew/cask/test/cask/artifact/suite_test.rb
@@ -13,6 +13,8 @@ describe Hbc::Artifact::Suite do
end
it "moves the suite to the proper directory" do
+ skip("flaky test")
+
shutup do
install_phase.call
end
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb
index 6f578caf6..fbfe46e71 100644
--- a/Library/Homebrew/cmd/install.rb
+++ b/Library/Homebrew/cmd/install.rb
@@ -44,9 +44,6 @@
#: If `--keep-tmp` is passed, the temporary files created during installation
#: are not deleted.
#:
-#: To install a newer version of HEAD use
-#: `brew rm <foo> && brew install --HEAD <foo>`.
-#:
#: * `install` `--interactive` [`--git`] <formula>:
#: Download and patch <formula>, then open a shell. This allows the user to
#: run `./configure --help` and otherwise determine how to turn the software
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 88d9a535c..281839621 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -459,6 +459,14 @@ class FormulaAuditor
end
def audit_conflicts
+ if formula.versioned_formula?
+ problem <<-EOS
+ Versioned formulae should not use `conflicts_with`.
+ Use `keg_only :versioned_formula` instead.
+ EOS
+ return
+ end
+
formula.conflicts.each do |c|
begin
Formulary.factory(c.name)
@@ -481,6 +489,10 @@ class FormulaAuditor
next unless @strict
+ if o.name == "universal"
+ problem "macOS has been 64-bit only since 10.6 so universal options are deprecated."
+ end
+
if o.name !~ /with(out)?-/ && o.name != "c++11" && o.name != "universal"
problem "Options should begin with with/without. Migrate '--#{o.name}' with `deprecated_option`."
end
@@ -493,7 +505,7 @@ class FormulaAuditor
return unless @new_formula
return if formula.deprecated_options.empty?
- return if formula.name.include?("@")
+ return if formula.versioned_formula?
problem "New formulae should not use `deprecated_option`."
end
diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb
index 07dd1b322..b4cda0fad 100644
--- a/Library/Homebrew/dev-cmd/create.rb
+++ b/Library/Homebrew/dev-cmd/create.rb
@@ -142,12 +142,10 @@ class FormulaCreator
def generate!
raise "#{path} already exists" if path.exist?
- if version.nil?
+ if version.nil? || version.null?
opoo "Version cannot be determined from URL."
puts "You'll need to add an explicit 'version' to the formula."
- end
-
- if fetch? && version
+ elsif fetch?
r = Resource.new
r.url(url)
r.version(version)
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 9f9b2abab..bd036067d 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -532,6 +532,110 @@ class S3DownloadStrategy < CurlDownloadStrategy
end
end
+# GitHubPrivateRepositoryDownloadStrategy downloads contents from GitHub
+# Private Repository. To use it, add
+# ":using => GitHubPrivateRepositoryDownloadStrategy" to the URL section of
+# your formula. This download strategy uses GitHub access tokens (in the
+# environment variables HOMEBREW_GITHUB_API_TOKEN) to sign the request. This
+# strategy is suitable for corporate use just like S3DownloadStrategy, because
+# it lets you use a private GttHub repository for internal distribution. It
+# works with public one, but in that case simply use CurlDownloadStrategy.
+class GitHubPrivateRepositoryDownloadStrategy < CurlDownloadStrategy
+ require "utils/formatter"
+ require "utils/github"
+
+ def initialize(name, resource)
+ super
+ parse_url_pattern
+ set_github_token
+ end
+
+ def parse_url_pattern
+ url_pattern = %r{https://github.com/([^/]+)/([^/]+)/(\S+)}
+ unless @url =~ url_pattern
+ raise CurlDownloadStrategyError, "Invalid url pattern for GitHub Repository."
+ end
+
+ _, @owner, @repo, @filepath = *@url.match(url_pattern)
+ end
+
+ def download_url
+ "https://#{@github_token}@github.com/#{@owner}/#{@repo}/#{@filepath}"
+ end
+
+ def _fetch
+ curl download_url, "-C", downloaded_size, "-o", temporary_path
+ end
+
+ private
+
+ def set_github_token
+ @github_token = ENV["HOMEBREW_GITHUB_API_TOKEN"]
+ unless @github_token
+ raise CurlDownloadStrategyError, "Environmental variable HOMEBREW_GITHUB_API_TOKEN is required."
+ end
+ validate_github_repository_access!
+ end
+
+ def validate_github_repository_access!
+ # Test access to the repository
+ GitHub.repository(@owner, @repo)
+ rescue GitHub::HTTPNotFoundError
+ # We only handle HTTPNotFoundError here,
+ # becase AuthenticationFailedError is handled within util/github.
+ message = <<-EOS.undent
+ HOMEBREW_GITHUB_API_TOKEN can not access the repository: #{@owner}/#{@repo}
+ This token may not have permission to access the repository or the url of formula may be incorrect.
+ EOS
+ raise CurlDownloadStrategyError, message
+ end
+end
+
+# GitHubPrivateRepositoryReleaseDownloadStrategy downloads tarballs from GitHub
+# Release assets. To use it, add
+# ":using => GitHubPrivateRepositoryReleaseDownloadStrategy" to the URL section
+# of your formula. This download strategy uses GitHub access tokens (in the
+# environment variables HOMEBREW_GITHUB_API_TOKEN) to sign the request.
+class GitHubPrivateRepositoryReleaseDownloadStrategy < GitHubPrivateRepositoryDownloadStrategy
+ def parse_url_pattern
+ url_pattern = %r{https://github.com/([^/]+)/([^/]+)/releases/download/([^/]+)/(\S+)}
+ unless @url =~ url_pattern
+ raise CurlDownloadStrategyError, "Invalid url pattern for GitHub Release."
+ end
+
+ _, @owner, @repo, @tag, @filename = *@url.match(url_pattern)
+ end
+
+ def download_url
+ "https://#{@github_token}@api.github.com/repos/#{@owner}/#{@repo}/releases/assets/#{asset_id}"
+ end
+
+ def _fetch
+ # HTTP request header `Accept: application/octet-stream` is required.
+ # Without this, the GitHub API will respond with metadata, not binary.
+ curl download_url, "-C", downloaded_size, "-o", temporary_path, "-H", "Accept: application/octet-stream"
+ end
+
+ private
+
+ def asset_id
+ @asset_id ||= resolve_asset_id
+ end
+
+ def resolve_asset_id
+ release_metadata = fetch_release_metadata
+ assets = release_metadata["assets"].select { |a| a["name"] == @filename }
+ raise CurlDownloadStrategyError, "Asset file not found." if assets.empty?
+
+ assets.first["id"]
+ end
+
+ def fetch_release_metadata
+ release_url = "https://api.github.com/repos/#{@owner}/#{@repo}/releases/tags/#{@tag}"
+ GitHub.open(release_url)
+ end
+end
+
class SubversionDownloadStrategy < VCSDownloadStrategy
def initialize(name, resource)
super
diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb
index a93c1ee1f..7b468574a 100644
--- a/Library/Homebrew/extend/ENV/shared.rb
+++ b/Library/Homebrew/extend/ENV/shared.rb
@@ -17,7 +17,7 @@ module SharedEnvExtension
FC_FLAG_VARS = %w[FCFLAGS FFLAGS].freeze
# @private
SANITIZED_VARS = %w[
- CDPATH GREP_OPTIONS CLICOLOR_FORCE
+ CDPATH CLICOLOR_FORCE
CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH
CC CXX OBJC OBJCXX CPP MAKE LD LDSHARED
CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS LDFLAGS CPPFLAGS
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 91a3e8150..77688840c 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -382,6 +382,11 @@ class Formula
PkgVersion.new(version, revision)
end
+ # If this is a `@`-versioned formula.
+ def versioned_formula?
+ name.include?("@")
+ end
+
# A named Resource for the currently active {SoftwareSpec}.
# Additional downloads can be defined as {#resource}s.
# {Resource#stage} will create a temporary directory and yield to a block.
@@ -1519,10 +1524,15 @@ class Formula
# Returns a list of Dependency objects that are required at runtime.
# @private
def runtime_dependencies
- recursive_dependencies do |_dependent, dependency|
+ runtime_dependencies = recursive_dependencies do |_, dependency|
Dependency.prune if dependency.build?
Dependency.prune if !dependency.required? && build.without?(dependency)
end
+ runtime_requirement_deps = recursive_requirements do |_, requirement|
+ Requirement.prune if requirement.build?
+ Requirement.prune if !requirement.required? && build.without?(requirement)
+ end.map(&:to_dependency).compact
+ runtime_dependencies + runtime_requirement_deps
end
# Returns a list of formulae depended on by this formula that aren't
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 24c068460..55e983264 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -370,8 +370,8 @@ class FormulaInstaller
raise UnsatisfiedRequirements, fatals
end
- def install_requirement_default_formula?(req, dependent, build)
- return false unless req.default_formula?
+ def install_requirement_formula?(req, dependent, build)
+ return false unless req.to_dependency
return true unless req.satisfied?
return false if req.run?
install_bottle_for?(dependent, build) || build_bottle?
@@ -390,7 +390,7 @@ class FormulaInstaller
Requirement.prune
elsif req.build? && install_bottle_for?(dependent, build)
Requirement.prune
- elsif install_requirement_default_formula?(req, dependent, build)
+ elsif install_requirement_formula?(req, dependent, build)
dep = req.to_dependency
deps.unshift(dep)
formulae.unshift(dep.to_formula)
@@ -808,6 +808,7 @@ class FormulaInstaller
tab.poured_from_bottle = true
tab.time = Time.now.to_i
tab.head = HOMEBREW_REPOSITORY.git_head
+ tab.source["path"] = formula.specified_path.to_s
tab.write
end
diff --git a/Library/Homebrew/formula_support.rb b/Library/Homebrew/formula_support.rb
index e4f800364..dcb995a6b 100644
--- a/Library/Homebrew/formula_support.rb
+++ b/Library/Homebrew/formula_support.rb
@@ -29,27 +29,32 @@ class KegOnlyReason
def to_s
return @explanation unless @explanation.empty?
case @reason
- when :provided_by_macos, :provided_by_osx then <<-EOS
-macOS already provides this software and installing another version in
-parallel can cause all kinds of trouble.
-EOS
- when :shadowed_by_macos, :shadowed_by_osx then <<-EOS
-macOS provides similar software and installing this software in
-parallel can cause all kinds of trouble.
-EOS
- when :provided_pre_mountain_lion then <<-EOS
-macOS already provides this software in versions before Mountain Lion.
-EOS
- when :provided_pre_mavericks then <<-EOS
-macOS already provides this software in versions before Mavericks.
-EOS
- when :provided_pre_el_capitan then <<-EOS
-macOS already provides this software in versions before El Capitan.
-EOS
- when :provided_until_xcode43
- "Xcode provides this software prior to version 4.3."
- when :provided_until_xcode5
- "Xcode provides this software prior to version 5."
+ when :versioned_formula then <<-EOS.undent
+ This is an alternate version of another formula.
+ EOS
+ when :provided_by_macos, :provided_by_osx then <<-EOS.undent
+ macOS already provides this software and installing another version in
+ parallel can cause all kinds of trouble.
+ EOS
+ when :shadowed_by_macos, :shadowed_by_osx then <<-EOS.undent
+ macOS provides similar software and installing this software in
+ parallel can cause all kinds of trouble.
+ EOS
+ when :provided_pre_mountain_lion then <<-EOS.undent
+ macOS already provides this software in versions before Mountain Lion.
+ EOS
+ when :provided_pre_mavericks then <<-EOS.undent
+ macOS already provides this software in versions before Mavericks.
+ EOS
+ when :provided_pre_el_capitan then <<-EOS.undent
+ macOS already provides this software in versions before El Capitan.
+ EOS
+ when :provided_until_xcode43 then <<-EOS.undent
+ Xcode provides this software prior to version 4.3.
+ EOS
+ when :provided_until_xcode5 then <<-EOS.undent
+ Xcode provides this software prior to version 5.
+ EOS
else
@reason
end.strip
diff --git a/Library/Homebrew/manpages/brew.1.md.erb b/Library/Homebrew/manpages/brew.1.md.erb
index 2266f3e7a..a7f099e9d 100644
--- a/Library/Homebrew/manpages/brew.1.md.erb
+++ b/Library/Homebrew/manpages/brew.1.md.erb
@@ -31,7 +31,7 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
* `install` <formula>:
Install <formula>.
- * `remove` <formula>:
+ * `uninstall` <formula>:
Uninstall <formula>.
* `update`:
diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb
index fe1a3c020..49108ca75 100644
--- a/Library/Homebrew/requirement.rb
+++ b/Library/Homebrew/requirement.rb
@@ -15,6 +15,7 @@ class Requirement
@default_formula = self.class.default_formula
@cask ||= self.class.cask
@download ||= self.class.download
+ @formula = nil
tags.each do |tag|
next unless tag.is_a? Hash
@cask ||= tag[:cask]
@@ -56,7 +57,14 @@ class Requirement
def satisfied?
result = self.class.satisfy.yielder { |p| instance_eval(&p) }
@satisfied_result = result
- result ? true : false
+ return false unless result
+
+ if parent = satisfied_result_parent
+ parent.to_s =~ %r{(#{Regexp.escape(HOMEBREW_CELLAR)}|#{Regexp.escape(HOMEBREW_PREFIX)}/opt)/([\w+-.@]+)}
+ @formula = $2
+ end
+
+ true
end
# Overriding #fatal? is deprecated.
@@ -69,6 +77,11 @@ class Requirement
self.class.default_formula || false
end
+ def satisfied_result_parent
+ return unless @satisfied_result.is_a?(Pathname)
+ @satisfied_result.resolved_path.parent
+ end
+
# Overriding #modify_build_environment is deprecated.
# Pass a block to the env DSL method instead.
# Note: #satisfied? should be called before invoking this method
@@ -81,11 +94,8 @@ class Requirement
# satisfy { which("executable") }
# work, even under superenv where "executable" wouldn't normally be on the
# PATH.
- # This is undocumented magic and it should be removed, but we need to add
- # a way to declare path-based requirements that work with superenv first.
- return unless @satisfied_result.is_a?(Pathname)
- parent = @satisfied_result.parent
-
+ parent = satisfied_result_parent
+ return unless parent
return if ENV["PATH"].split(File::PATH_SEPARATOR).include?(parent.to_s)
ENV.append_path("PATH", parent)
end
@@ -111,13 +121,15 @@ class Requirement
"#<#{self.class.name}: #{name.inspect} #{tags.inspect}>"
end
+ def formula
+ @formula || self.class.default_formula
+ end
+
def to_dependency
- f = self.class.default_formula
- raise "No default formula defined for #{inspect}" if f.nil?
- if f =~ HOMEBREW_TAP_FORMULA_REGEX
- TapDependency.new(f, tags, method(:modify_build_environment), name)
- else
- Dependency.new(f, tags, method(:modify_build_environment), name)
+ if formula =~ HOMEBREW_TAP_FORMULA_REGEX
+ TapDependency.new(formula, tags, method(:modify_build_environment), name)
+ elsif formula
+ Dependency.new(formula, tags, method(:modify_build_environment), name)
end
end
diff --git a/Library/Homebrew/test/download_strategies_test.rb b/Library/Homebrew/test/download_strategies_test.rb
index 87218fb12..2b64abbf9 100644
--- a/Library/Homebrew/test/download_strategies_test.rb
+++ b/Library/Homebrew/test/download_strategies_test.rb
@@ -2,11 +2,12 @@ require "testing_env"
require "download_strategy"
class ResourceDouble
- attr_reader :url, :specs, :version
+ attr_reader :url, :specs, :version, :mirrors
def initialize(url = "http://example.com/foo.tar.gz", specs = {})
@url = url
@specs = specs
+ @mirrors = []
end
end
@@ -60,6 +61,79 @@ class VCSDownloadStrategyTests < Homebrew::TestCase
end
end
+class GitHubPrivateRepositoryDownloadStrategyTests < Homebrew::TestCase
+ def setup
+ resource = ResourceDouble.new("https://github.com/owner/repo/archive/1.1.5.tar.gz")
+ ENV["HOMEBREW_GITHUB_API_TOKEN"] = "token"
+ GitHub.stubs(:repository).returns {}
+ @strategy = GitHubPrivateRepositoryDownloadStrategy.new("foo", resource)
+ end
+
+ def test_set_github_token
+ assert_equal "token", @strategy.instance_variable_get(:@github_token)
+ end
+
+ def test_parse_url_pattern
+ assert_equal "owner", @strategy.instance_variable_get(:@owner)
+ assert_equal "repo", @strategy.instance_variable_get(:@repo)
+ assert_equal "archive/1.1.5.tar.gz", @strategy.instance_variable_get(:@filepath)
+ end
+
+ def test_download_url
+ expected = "https://token@github.com/owner/repo/archive/1.1.5.tar.gz"
+ assert_equal expected, @strategy.download_url
+ end
+end
+
+class GitHubPrivateRepositoryReleaseDownloadStrategyTests < Homebrew::TestCase
+ def setup
+ resource = ResourceDouble.new("https://github.com/owner/repo/releases/download/tag/foo_v0.1.0_darwin_amd64.tar.gz")
+ ENV["HOMEBREW_GITHUB_API_TOKEN"] = "token"
+ GitHub.stubs(:repository).returns {}
+ @strategy = GitHubPrivateRepositoryReleaseDownloadStrategy.new("foo", resource)
+ end
+
+ def test_parse_url_pattern
+ assert_equal "owner", @strategy.instance_variable_get(:@owner)
+ assert_equal "repo", @strategy.instance_variable_get(:@repo)
+ assert_equal "tag", @strategy.instance_variable_get(:@tag)
+ assert_equal "foo_v0.1.0_darwin_amd64.tar.gz", @strategy.instance_variable_get(:@filename)
+ end
+
+ def test_download_url
+ @strategy.stubs(:resolve_asset_id).returns(456)
+ expected = "https://token@api.github.com/repos/owner/repo/releases/assets/456"
+ assert_equal expected, @strategy.download_url
+ end
+
+ def test_resolve_asset_id
+ release_metadata = {
+ "assets" => [
+ {
+ "id" => 123,
+ "name" => "foo_v0.1.0_linux_amd64.tar.gz",
+ },
+ {
+ "id" => 456,
+ "name" => "foo_v0.1.0_darwin_amd64.tar.gz",
+ },
+ ],
+ }
+ @strategy.stubs(:fetch_release_metadata).returns(release_metadata)
+ assert_equal 456, @strategy.send(:resolve_asset_id)
+ end
+
+ def test_fetch_release_metadata
+ expected_release_url = "https://api.github.com/repos/owner/repo/releases/tags/tag"
+ github_mock = MiniTest::Mock.new
+ github_mock.expect :call, {}, [expected_release_url]
+ GitHub.stub :open, github_mock do
+ @strategy.send(:fetch_release_metadata)
+ end
+ github_mock.verify
+ end
+end
+
class GitDownloadStrategyTests < Homebrew::TestCase
include FileUtils
diff --git a/Library/Homebrew/test/formula_test.rb b/Library/Homebrew/test/formula_test.rb
index 81022d220..2d2136a05 100644
--- a/Library/Homebrew/test/formula_test.rb
+++ b/Library/Homebrew/test/formula_test.rb
@@ -689,6 +689,44 @@ class FormulaTests < Homebrew::TestCase
assert_equal %w[foo/bar/f1 baz/qux/f2], f3.runtime_dependencies.map(&:name)
end
+ def test_requirements
+ f1 = formula("f1") do
+ url "f1-1"
+
+ depends_on :python
+ depends_on x11: :recommended
+ depends_on xcode: ["1.0", :optional]
+ end
+ stub_formula_loader f1
+
+ python = PythonRequirement.new
+ x11 = X11Requirement.new("x11", [:recommended])
+ xcode = XcodeRequirement.new(["1.0", :optional])
+
+ # Default block should filter out deps that aren't being used
+ assert_equal Set[python, x11], Set.new(f1.recursive_requirements)
+
+ f1.build = BuildOptions.new(["--with-xcode", "--without-x11"], f1.options)
+ assert_equal Set[python, xcode], Set.new(f1.recursive_requirements)
+ f1.build = f1.stable.build
+
+ f2 = formula("f2") do
+ url "f2-1"
+ depends_on "f1"
+ end
+
+ assert_equal Set[python, x11], Set.new(f2.recursive_requirements)
+
+ # Empty block should allow all requirements
+ assert_equal Set[python, x11, xcode], Set.new(f2.recursive_requirements {})
+
+ # Requirements can be pruned
+ requirements = f2.recursive_requirements do |_dependent, requirement|
+ Requirement.prune if requirement.is_a?(PythonRequirement)
+ end
+ assert_equal Set[x11, xcode], Set.new(requirements)
+ end
+
def test_to_hash
f1 = formula("foo") do
url "foo-1.0"
diff --git a/docs/Formula-Cookbook.md b/docs/Formula-Cookbook.md
index df86be92f..bb3ad33dc 100644
--- a/docs/Formula-Cookbook.md
+++ b/docs/Formula-Cookbook.md
@@ -1,6 +1,6 @@
# Formula Cookbook
-A formula is a package definition written in Ruby. It can be created with `brew create $URL`, installed with `brew install $FORMULA`, and debugged with `brew install --debug --verbose $FORMULA`. Formulae use the [Formula API](http://www.rubydoc.info/github/Homebrew/brew/master/Formula) which provides various Homebrew-specific helpers.
+A formula is a package definition written in Ruby. It can be created with `brew create $URL` where `$URL` is a zip or tarball, installed with `brew install $FORMULA`, and debugged with `brew install --debug --verbose $FORMULA`. Formulae use the [Formula API](http://www.rubydoc.info/github/Homebrew/brew/master/Formula) which provides various Homebrew-specific helpers.
## Homebrew Terminology
diff --git a/docs/Versions.md b/docs/Versions.md
index 9e679db7d..bd3ef8a5f 100644
--- a/docs/Versions.md
+++ b/docs/Versions.md
@@ -11,6 +11,6 @@ Versioned formulae we include must meet the following standards:
* Versioned formulae should differ in major/minor (not patch) versions from the current stable release. This is because patch versions indicate bug or security updates and we want to ensure you apply security updates.
* Formulae that depend on versioned formulae must not depend on the same formulae at two different versions twice in their recursive dependencies. For example, if you depend on `openssl@1.0` and `foo`, and `foo` depends on `openssl` then you must instead use `openssl`.
-* Versioned formulae should strive to be linked at the same time as their non-versioned counterpart (without patching). If this is not possible, favour either `conflicts_with` or `keg_only` depending on whether users expect to have multiple versions installed at once or not.
+* Versioned formulae should only be linkable at the same time as their non-versioned counterpart if the upstream project provides support for e.g. suffixed binaries. If this is not possible, use `keg_only :versioned_formula` to allow users to have multiple versions installed at once.
You should create your own [tap](https://github.com/Homebrew/brew/blob/master/docs/How-to-Create-and-Maintain-a-Tap.md) for formulae you or your organisation wishes to control the versioning of or those that do not meet the above standards.
diff --git a/docs/brew.1.html b/docs/brew.1.html
index ba65157cb..2e036eb55 100644
--- a/docs/brew.1.html
+++ b/docs/brew.1.html
@@ -22,7 +22,7 @@ didn't include with macOS.</p>
<dl>
<dt><code>install</code> <var>formula</var></dt><dd><p>Install <var>formula</var>.</p></dd>
-<dt><code>remove</code> <var>formula</var></dt><dd><p>Uninstall <var>formula</var>.</p></dd>
+<dt><code>uninstall</code> <var>formula</var></dt><dd><p>Uninstall <var>formula</var>.</p></dd>
<dt class="flush"><code>update</code></dt><dd><p>Fetch the newest version of Homebrew from GitHub using <code>git</code>(1).</p></dd>
<dt class="flush"><code>list</code></dt><dd><p>List all installed formulae.</p></dd>
<dt><code>search</code> <var>text</var>|<code>/</code><var>text</var><code>/</code></dt><dd><p>Perform a substring search of formula names for <var>text</var>. If <var>text</var> is
@@ -196,10 +196,7 @@ for installation.</p>
aka master, trunk, unstable.</p>
<p>If <code>--keep-tmp</code> is passed, the temporary files created during installation
-are not deleted.</p>
-
-<p>To install a newer version of HEAD use
-<code>brew rm &lt;foo> &amp;&amp; brew install --HEAD &lt;foo></code>.</p></dd>
+are not deleted.</p></dd>
<dt><code>install</code> <code>--interactive</code> [<code>--git</code>] <var>formula</var></dt><dd><p>Download and patch <var>formula</var>, then open a shell. This allows the user to
run <code>./configure --help</code> and otherwise determine how to turn the software
package into a Homebrew formula.</p>
diff --git a/manpages/brew.1 b/manpages/brew.1
index aa1d1c1d0..f122337fb 100644
--- a/manpages/brew.1
+++ b/manpages/brew.1
@@ -26,7 +26,7 @@ With \fB\-\-verbose\fR or \fB\-v\fR, many commands print extra debugging informa
Install \fIformula\fR\.
.
.TP
-\fBremove\fR \fIformula\fR
+\fBuninstall\fR \fIformula\fR
Uninstall \fIformula\fR\.
.
.TP
@@ -258,9 +258,6 @@ If \fB\-\-HEAD\fR is passed, and \fIformula\fR defines it, install the HEAD vers
.IP
If \fB\-\-keep\-tmp\fR is passed, the temporary files created during installation are not deleted\.
.
-.IP
-To install a newer version of HEAD use \fBbrew rm <foo> && brew install \-\-HEAD <foo>\fR\.
-.
.TP
\fBinstall\fR \fB\-\-interactive\fR [\fB\-\-git\fR] \fIformula\fR
Download and patch \fIformula\fR, then open a shell\. This allows the user to run \fB\./configure \-\-help\fR and otherwise determine how to turn the software package into a Homebrew formula\.