From 961b5fff9d4426a1b53da332c8016dcd61eae48a Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Tue, 13 Dec 2016 00:37:40 +0000
Subject: formula_installer: prevent version mismatched deps
Don't allow e.g. the use of `openssl` and `openssl@1.1` in the same
dependency tree to avoid runtime failures and general weirdness.
---
Library/Homebrew/formula_installer.rb | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index bd1cc9379..c701aeb39 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -146,7 +146,23 @@ class FormulaInstaller
return if ignore_deps?
recursive_deps = formula.recursive_dependencies
- unlinked_deps = recursive_deps.map(&:to_formula).select do |dep|
+ recursive_formulae = recursive_deps.map(&:to_formula)
+
+ version_hash = {}
+ version_conflicts = Set.new
+ recursive_formulae.each do |f|
+ name = f.name
+ unversioned_name, = name.split("@")
+ version_hash[unversioned_name] ||= Set.new
+ version_hash[unversioned_name] << name
+ next if version_hash[unversioned_name].length < 2
+ version_conflicts += version_hash[unversioned_name]
+ end
+ unless version_conflicts.empty?
+ raise CannotInstallFormulaError, "#{formula.full_name} contains conflicting version dependencies (#{version_conflicts.to_a.join " "}) so cannot be installed"
+ end
+
+ unlinked_deps = recursive_formulae.select do |dep|
dep.installed? && !dep.keg_only? && !dep.linked_keg.directory?
end
--
cgit v1.2.3
From 8f80cc65686bd6b5eed365fd7d9f822366c01943 Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Tue, 13 Dec 2016 01:53:05 +0000
Subject: diagnostic: check for bad tap files.
Check for Ruby files in taps that are outside of the detected `Formula`
directory for a tap but inside one of the other potential directories.
This usually indicates a formula has been added in the wrong directory
in a tap and is used to fail CI in this case.
---
Library/Homebrew/diagnostic.rb | 23 +++++++++++++++++++++++
Library/Homebrew/tap.rb | 6 +++++-
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb
index e8506ce80..64c155fde 100644
--- a/Library/Homebrew/diagnostic.rb
+++ b/Library/Homebrew/diagnostic.rb
@@ -1075,6 +1075,29 @@ module Homebrew
message
end
+ def check_for_tap_ruby_files_locations
+ bad_tap_files = {}
+ Tap.each do |tap|
+ unused_formula_dirs = tap.potential_formula_dirs - [tap.formula_dir]
+ unused_formula_dirs.each do |dir|
+ next unless dir.exist?
+ dir.children.each do |path|
+ next unless path.extname == ".rb"
+ bad_tap_files[tap] ||= []
+ bad_tap_files[tap] << path
+ end
+ end
+ end
+ return if bad_tap_files.empty?
+ bad_tap_files.keys.map do |tap|
+ <<-EOS.undent
+ Found Ruby file outside #{tap} tap formula directory
+ (#{tap.formula_dir}):
+ #{bad_tap_files[tap].join("\n ")}
+ EOS
+ end.join("\n")
+ end
+
def all
methods.map(&:to_s).grep(/^check_/)
end
diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb
index 68b21ac60..4b59f2344 100644
--- a/Library/Homebrew/tap.rb
+++ b/Library/Homebrew/tap.rb
@@ -292,7 +292,11 @@ class Tap
# path to the directory of all {Formula} files for this {Tap}.
def formula_dir
- @formula_dir ||= [path/"Formula", path/"HomebrewFormula", path].detect(&:directory?)
+ @formula_dir ||= potential_formula_dirs.detect(&:directory?)
+ end
+
+ def potential_formula_dirs
+ @potential_formula_dirs ||= [path/"Formula", path/"HomebrewFormula", path].freeze
end
# path to the directory of all {Cask} files for this {Tap}.
--
cgit v1.2.3
From 0a007fc983c83d610b918bdd8e38038e2732c170 Mon Sep 17 00:00:00 2001
From: David Broder-Rodgers
Date: Thu, 15 Dec 2016 22:36:39 +0000
Subject: Updated homepage 404 check to use explicit parameters and return the
status code
---
Library/Homebrew/dev-cmd/audit.rb | 9 ++++-----
Library/Homebrew/test/audit_test.rb | 4 ++--
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 0112c524f..cc5a0e62c 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -564,11 +564,10 @@ class FormulaAuditor
end
return unless @online
- begin
- nostdout { curl "--connect-timeout", "15", "-o", "/dev/null", homepage }
- rescue ErrorDuringExecution
- problem "The homepage is not reachable (curl exit code #{$?.exitstatus})"
- end
+ status_code, = curl_output "--connect-timeout", "15", "--output", "/dev/null", "--range", "0-0", \
+ "--write-out", "%{http_code}", homepage
+ return if status_code.start_with? "20"
+ problem "The homepage #{homepage} is not reachable (HTTP status code #{status_code})"
end
def audit_bottle_spec
diff --git a/Library/Homebrew/test/audit_test.rb b/Library/Homebrew/test/audit_test.rb
index 2725f906e..dace4dc2b 100644
--- a/Library/Homebrew/test/audit_test.rb
+++ b/Library/Homebrew/test/audit_test.rb
@@ -429,8 +429,8 @@ class FormulaAuditorTests < Homebrew::TestCase
fa.audit_homepage
assert_equal ["The homepage should start with http or https " \
- "(URL is #{fa.formula.homepage}).", "The homepage is not reachable " \
- "(curl exit code #{$?.exitstatus})"], fa.problems
+ "(URL is #{fa.formula.homepage}).", "The homepage #{fa.formula.homepage} is not reachable " \
+ "(HTTP status code 000)"], fa.problems
formula_homepages = {
"bar" => "http://www.freedesktop.org/wiki/bar",
--
cgit v1.2.3
From ebb659af7da12771efe134e1f9386324423f4246 Mon Sep 17 00:00:00 2001
From: Bob W. Hogg
Date: Sun, 18 Dec 2016 14:50:38 -0800
Subject: Add Kaby Lake to Linux hardware list
Note that no Mac hardware using a Kaby Lake processor has been released
yet, so do not add it to the equivalent list for macOS.
---
Library/Homebrew/extend/os/linux/hardware/cpu.rb | 2 ++
Library/Homebrew/test/hardware_test.rb | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/Library/Homebrew/extend/os/linux/hardware/cpu.rb b/Library/Homebrew/extend/os/linux/hardware/cpu.rb
index 2472c60ed..9d779f789 100644
--- a/Library/Homebrew/extend/os/linux/hardware/cpu.rb
+++ b/Library/Homebrew/extend/os/linux/hardware/cpu.rb
@@ -47,6 +47,8 @@ module Hardware
:haswell
when 0x3d, 0x47, 0x4f, 0x56
:broadwell
+ when 0x8e
+ :kabylake
else
cpu_family_model
end
diff --git a/Library/Homebrew/test/hardware_test.rb b/Library/Homebrew/test/hardware_test.rb
index 2bea5387d..69f881a60 100644
--- a/Library/Homebrew/test/hardware_test.rb
+++ b/Library/Homebrew/test/hardware_test.rb
@@ -8,7 +8,7 @@ class HardwareTests < Homebrew::TestCase
if Hardware::CPU.intel?
def test_hardware_intel_family
- families = [:core, :core2, :penryn, :nehalem, :arrandale, :sandybridge, :ivybridge, :haswell, :broadwell, :skylake, :dunno]
+ families = [:core, :core2, :penryn, :nehalem, :arrandale, :sandybridge, :ivybridge, :haswell, :broadwell, :skylake, :kabylake, :dunno]
assert_includes families, Hardware::CPU.family
end
end
--
cgit v1.2.3
From 637aae48e4814e2799a06838c24f06a2a2ef0a36 Mon Sep 17 00:00:00 2001
From: David Broder-Rodgers
Date: Mon, 19 Dec 2016 08:45:21 +0000
Subject: Markups
---
Library/Homebrew/dev-cmd/audit.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index cc5a0e62c..754cb597b 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -564,8 +564,8 @@ class FormulaAuditor
end
return unless @online
- status_code, = curl_output "--connect-timeout", "15", "--output", "/dev/null", "--range", "0-0", \
- "--write-out", "%{http_code}", homepage
+ status_code, = curl_output "--connect-timeout", "15", "--output", "/dev/null", "--range", "0-0",
+ "--write-out", "%{http_code}", homepage
return if status_code.start_with? "20"
problem "The homepage #{homepage} is not reachable (HTTP status code #{status_code})"
end
--
cgit v1.2.3
From cc09bb14c16c8e4f6b360f30074522c2ee25167b Mon Sep 17 00:00:00 2001
From: Tom Schoonjans
Date: Mon, 19 Dec 2016 21:51:57 +0100
Subject: brew create: add meson support
meson is quickly gaining popularity as build system, in combination with
ninja. Several Gnome projects for example are currently transitioning
from autotools to meson, mostly because it allows for Visual Studio
builds, which is impossible to accomplish with autotools.
In order to facilitate generating meson based Formulas, I added support
for meson to brew-create.
---
Library/Homebrew/dev-cmd/create.rb | 17 ++++++++++++++++-
docs/brew.1.html | 5 +++--
manpages/brew-cask.1 | 2 +-
manpages/brew.1 | 6 +++---
4 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb
index 11544dbef..5d46e73b9 100644
--- a/Library/Homebrew/dev-cmd/create.rb
+++ b/Library/Homebrew/dev-cmd/create.rb
@@ -1,4 +1,4 @@
-#: * `create`
create URL [--autotools|--cmake] [--no-fetch] [--set-name name] [--set-version version] [--tap user/repo]Generate a formula for the downloadable file at URL and open it in the editor. +
create URL [--autotools|--cmake|--meson] [--no-fetch] [--set-name name] [--set-version version] [--tap user/repo]Generate a formula for the downloadable file at URL and open it in the editor.
Homebrew will attempt to automatically derive the formula name
and version, but if it fails, you'll have to make your own template. The wget
formula serves as a simple example. For the complete API have a look at
http://www.rubydoc.info/github/Homebrew/brew/master/Formula
If --autotools is passed, create a basic template for an Autotools-style build.
-If --cmake is passed, create a basic template for a CMake-style build.
--cmake is passed, create a basic template for a CMake-style build.
+If --meson is passed, create a basic template for a Meson-style build.
If --no-fetch is passed, Homebrew will not download URL to the cache and
will thus not add the SHA256 to the formula for you.
If --build-from-source is passed, download the source rather than a
bottle.
If --force-bottle is passed, download a bottle if it exists for the current
-version of macOS, even if it would not be used during installation.
If --force-bottle is passed, download a bottle if it exists for the
+current or newest version of macOS, even if it would not be used during
+installation.
gist-logs [--new-issue|-n] formulaUpload logs for a failed build of formula to a new Gist.
formula is usually the name of the formula to install, but it can be specified @@ -185,6 +186,10 @@ from bottles if they are available.
passed, then both formula and the dependencies installed as part of this process are built from source even if bottles are available. +If --force-bottle is passed, install from a bottle if it exists for the
+current or newest version of macOS, even if it would not normally be used
+for installation.
If --devel is passed, and formula defines it, install the development version.
If --HEAD is passed, and formula defines it, install the HEAD version,
diff --git a/manpages/brew-cask.1 b/manpages/brew-cask.1
index 9eaaf027a..63aad2c56 100644
--- a/manpages/brew-cask.1
+++ b/manpages/brew-cask.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BREW\-CASK" "1" "December 2016" "Homebrew" "brew-cask"
+.TH "BREW\-CASK" "1" "January 2017" "Homebrew" "brew-cask"
.
.SH "NAME"
\fBbrew\-cask\fR \- a friendly binary installer for macOS
diff --git a/manpages/brew.1 b/manpages/brew.1
index c25f73af9..38dce5cfd 100644
--- a/manpages/brew.1
+++ b/manpages/brew.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BREW" "1" "December 2016" "Homebrew" "brew"
+.TH "BREW" "1" "January 2017" "Homebrew" "brew"
.
.SH "NAME"
\fBbrew\fR \- The missing package manager for macOS
@@ -171,7 +171,7 @@ If \fB\-\-deps\fR is passed, also download dependencies for any listed \fIformul
If \fB\-\-build\-from\-source\fR is passed, download the source rather than a bottle\.
.
.IP
-If \fB\-\-force\-bottle\fR is passed, download a bottle if it exists for the current version of macOS, even if it would not be used during installation\.
+If \fB\-\-force\-bottle\fR is passed, download a bottle if it exists for the current or newest version of macOS, even if it would not be used during installation\.
.
.TP
\fBgist\-logs\fR [\fB\-\-new\-issue\fR|\fB\-n\fR] \fIformula\fR
@@ -247,6 +247,9 @@ If \fB\-\-build\-from\-source\fR or \fB\-s\fR is passed, compile the specified \
If \fBHOMEBREW_BUILD_FROM_SOURCE\fR is set, regardless of whether \fB\-\-build\-from\-source\fR was passed, then both \fIformula\fR and the dependencies installed as part of this process are built from source even if bottles are available\.
.
.IP
+If \fB\-\-force\-bottle\fR is passed, install from a bottle if it exists for the current or newest version of macOS, even if it would not normally be used for installation\.
+.
+.IP
If \fB\-\-devel\fR is passed, and \fIformula\fR defines it, install the development version\.
.
.IP
--
cgit v1.2.3
From ed66fa3ae567f4500232341af4a9432fc03d8272 Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Mon, 2 Jan 2017 17:24:52 +0000
Subject: update-report: handle homebrew/versions imports.
Imports from homebrew/versions are migrated from that tap and then
renamed immediately when they hit homebrew/core. This did not trigger
our previous rename detection so address these to improve the output and
handle migration correctly.
---
Library/Homebrew/cmd/update-report.rb | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb
index caa1e01ad..786570196 100644
--- a/Library/Homebrew/cmd/update-report.rb
+++ b/Library/Homebrew/cmd/update-report.rb
@@ -387,7 +387,7 @@ class Reporter
end
end
- renamed_formulae = []
+ renamed_formulae = Set.new
@report[:D].each do |old_full_name|
old_name = old_full_name.split("/").last
new_name = tap.formula_renames[old_name]
@@ -402,10 +402,24 @@ class Reporter
renamed_formulae << [old_full_name, new_full_name] if @report[:A].include? new_full_name
end
+ @report[:A].each do |new_full_name|
+ new_name = new_full_name.split("/").last
+ old_name = tap.formula_renames.key(new_name)
+ next unless old_name
+
+ if tap.core_tap?
+ old_full_name = old_name
+ else
+ old_full_name = "#{tap}/#{old_name}"
+ end
+
+ renamed_formulae << [old_full_name, new_full_name]
+ end
+
unless renamed_formulae.empty?
@report[:A] -= renamed_formulae.map(&:last)
@report[:D] -= renamed_formulae.map(&:first)
- @report[:R] = renamed_formulae
+ @report[:R] = renamed_formulae.to_a
end
@report
--
cgit v1.2.3
From 91c09c5b11beb0f9ff9915b6e949f17c3973c9a5 Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Mon, 2 Jan 2017 18:29:00 +0000
Subject: General documentation updates.
Mostly related to the newer ways we’re handling versions and the
incoming deprecation of devel-only, head-only and versions.
---
docs/Acceptable-Formulae.md | 6 +-----
docs/Custom-GCC-and-cross-compilers.md | 3 +--
docs/FAQ.md | 19 ++-----------------
docs/Formula-Cookbook.md | 6 +++---
...pen-a-Homebrew-Pull-Request-(and-get-it-merged).md | 3 +++
docs/Interesting-Taps-&-Forks.md | 6 ------
docs/Tips-N'-Tricks.md | 4 +---
7 files changed, 11 insertions(+), 36 deletions(-)
diff --git a/docs/Acceptable-Formulae.md b/docs/Acceptable-Formulae.md
index b827403d8..ac65d0802 100644
--- a/docs/Acceptable-Formulae.md
+++ b/docs/Acceptable-Formulae.md
@@ -67,12 +67,8 @@ Formulae in the core repository must have a stable version tagged by
the upstream project. Tarballs are preferred to git checkouts, and
tarballs should include the version in the filename whenever possible.
-Software that only provides a development/beta, tagged version should be put in
-[homebrew/devel-only](https://github.com/Homebrew/homebrew-devel-only).
We don’t accept software without a tagged version because they regularly break
-due to upstream changes; we can’t provide [bottles](Bottles.md) for them; and
-we don’t have an automatic update mechanism for `head-only` formulae which
-makes them very quickly outdated.
+due to upstream changes and we can’t provide [bottles](Bottles.md) for them.
### Bindings
First check that there is not already a binding available via
diff --git a/docs/Custom-GCC-and-cross-compilers.md b/docs/Custom-GCC-and-cross-compilers.md
index 1d662c158..43b8dfc01 100644
--- a/docs/Custom-GCC-and-cross-compilers.md
+++ b/docs/Custom-GCC-and-cross-compilers.md
@@ -15,7 +15,6 @@ GCC or cross-compiler suite, please link it in here.
* Homebrew provides a `gcc` formula for use with Xcode 4.2+ or when needing
C++11 support on earlier versions.
-* [Homebrew-versions](https://github.com/homebrew/homebrew-versions) provides an
-up to date GCC duplicates e.g. `brew install homebrew/versions/gcc48`
+* Homebrew provides older GCC formulae e.g. `gcc@4.8` and `gcc@6`
* [RISC-V](https://github.com/riscv/homebrew-riscv) provides the RISC-V
toolchain including binutils and gcc.
diff --git a/docs/FAQ.md b/docs/FAQ.md
index b9cbcd225..82efbf454 100644
--- a/docs/FAQ.md
+++ b/docs/FAQ.md
@@ -212,23 +212,8 @@ Linking /usr/local/Cellar/foo/0.1… 17 symlinks created
```
### Where was a formula deleted?
-Use `brew log $FORMULA` to find out!
-
-Sometimes formulae are moved to specialized repositories. These are the
-likely candidates:
-
-* [homebrew/dupes](https://github.com/Homebrew/homebrew-dupes)
-* [homebrew/games](https://github.com/Homebrew/homebrew-games)
-* [homebrew/versions](https://github.com/Homebrew/homebrew-versions)
-
-You can use `brew tap` to access these formulae:
-
-```bash
-brew tap homebrew/games
-brew install …
-```
-
-Note that brew search still finds formula in taps.
+Use `brew log $FORMULA` to find out! Likely because it had unresolved issues or
+our analytics identified it was not widely used.
### Homebrew is a poor name, it is generic, why was it chosen?
@mxcl was too concerned with the beer theme and didn’t consider that the
diff --git a/docs/Formula-Cookbook.md b/docs/Formula-Cookbook.md
index 6657b9766..72afa387e 100644
--- a/docs/Formula-Cookbook.md
+++ b/docs/Formula-Cookbook.md
@@ -9,11 +9,11 @@ A formula is a package definition written in Ruby. It can be created with `brew
| **Keg** | The installation prefix of a **Formula** | `/usr/local/Cellar/foo/0.1` |
| **opt prefix** | A symlink to the active version of a **Keg** | `/usr/local/opt/foo ` |
| **Cellar** | All **Kegs** are installed here | `/usr/local/Cellar` |
-| **Tap** | An optional Git repository of **Formulae** and/or commands | `/usr/local/Homebrew/Library/Taps/homebrew/homebrew-versions` |
+| **Tap** | An Git repository of **Formulae** and/or commands | `/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core` |
| **Bottle** | Pre-built **Keg** used instead of building from source | `qt-4.8.4.mavericks.bottle.tar.gz` |
| **Cask** | An [extension of homebrew](https://github.com/caskroom/homebrew-cask) to install macOS native apps | `/Applications/MacDown.app/Contents/SharedSupport/bin/macdown` |
| **Brew Bundle**| An [extension of homebrew](https://github.com/Homebrew/homebrew-bundle) to describe dependencies | `brew 'myservice', restart_service: true` |
-
+
## An Introduction
Homebrew uses Git for downloading updates and contributing to the project.
@@ -33,7 +33,7 @@ Before submitting a new formula make sure your package:
* isn't in another official [Homebrew tap](https://github.com/Homebrew)
* isn't already waiting to be merged (check the [issue tracker](https://github.com/Homebrew/homebrew-core/pulls))
* is still supported by upstream (i.e. doesn't require extensive patching)
-* has a stable, tagged version (i.e. not just a GitHub repository with no versions). See [Interesting-Taps-&-Forks](Interesting-Taps-&-Forks.md) for where pre-release versions belong.
+* has a stable, tagged version (i.e. not just a GitHub repository with no versions).
* passes all `brew audit --new-formula $FORMULA` tests.
Before submitting a new formula make sure you read over our [contribution guidelines](https://github.com/Homebrew/brew/blob/master/CONTRIBUTING.md).
diff --git a/docs/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md b/docs/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md
index a3497abca..ef6091e2c 100644
--- a/docs/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md
+++ b/docs/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md
@@ -4,6 +4,9 @@ The following commands are used by Homebrew contributors to set up a fork of Hom
Depending on the change you want to make, you need to send the pull request to the appropriate one of Homebrew's main repositories. If you want to submit a change to Homebrew core code (the `brew` implementation), you should open the pull request on [Homebrew/brew](https://github.com/Homebrew/brew). If you want to submit a change for a formula, you should open the pull request on [the `homebrew/core` tap](https://github.com/Homebrew/homebrew-core) or another [official tap](https://github.com/Homebrew), based on the formula type.
+## Submit a new version of an existing formula
+1. Use `brew bump-formula-pr` to do everything (i.e. forking, committing, pushing) with a single command. Run `brew bump-formula-pr --help` to learn more.
+
## Set up your own fork of the Homebrew repository
### Core `brew` code related pull request
diff --git a/docs/Interesting-Taps-&-Forks.md b/docs/Interesting-Taps-&-Forks.md
index d42a97f54..dcb860a23 100644
--- a/docs/Interesting-Taps-&-Forks.md
+++ b/docs/Interesting-Taps-&-Forks.md
@@ -12,16 +12,12 @@ Homebrew has the capability to add (and remove) multiple taps to your local inst
* [homebrew/completions](https://github.com/Homebrew/homebrew-completions): Shell completion formulae.
-* [homebrew/devel-only](https://github.com/Homebrew/homebrew-devel-only): A tap for brews that only have pre-release/development versions.
-
* [homebrew/dupes](https://github.com/Homebrew/homebrew-dupes): Need GDB or a newer Tk? System duplicates go here.
* [homebrew/emacs](https://github.com/Homebrew/homebrew-emacs): A tap for Emacs packages.
* [homebrew/games](https://github.com/Homebrew/homebrew-games): Game or gaming-emulation related formulae.
-* [homebrew/head-only](https://github.com/Homebrew/homebrew-head-only): A tap for brews that only have unstable, unreleased versions. This tap is **deprecated** and doesn’t accept new formulae.
-
* [homebrew/nginx](https://github.com/Homebrew/homebrew-nginx): Feature rich Nginx tap for modules.
* [homebrew/php](https://github.com/Homebrew/homebrew-php): Repository for php-related formulae.
@@ -32,8 +28,6 @@ Homebrew has the capability to add (and remove) multiple taps to your local inst
* [homebrew/services](https://github.com/Homebrew/homebrew-services): A tool to start Homebrew formulae's plists with `launchctl`.
-* [homebrew/versions](https://github.com/Homebrew/homebrew-versions): Need e.g. older or newer versions of Postgresql? Older versions of GCC?
-
* [homebrew/x11](https://github.com/Homebrew/homebrew-x11): Formulae with hard X11 dependencies.
`brew search` looks in these main taps as well as in [homebrew/core](https://github.com/Homebrew/homebrew-core). So don't worry about missing stuff. We will add other taps to the search as they become well maintained and popular.
diff --git a/docs/Tips-N'-Tricks.md b/docs/Tips-N'-Tricks.md
index fc532c019..e2257e534 100644
--- a/docs/Tips-N'-Tricks.md
+++ b/docs/Tips-N'-Tricks.md
@@ -3,9 +3,7 @@
## Installing previous versions of formulae
The preferred and supported method of installing specific versions of
-formulae is to use the
-[homebrew/versions](https://github.com/Homebrew/homebrew-versions)
-tap. If the version you’re looking for isn’t available, consider [opening a
+formulae is to use formula like e.g. `gcc@6`. If the version you’re looking for isn’t available, consider [opening a
pull request](https://github.com/Homebrew/brew/blob/master/docs/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md)!
### Installing directly from pull-requests
--
cgit v1.2.3
From 248beb9bf6ce0b9afc97dfc72067b6acfcb5eeb8 Mon Sep 17 00:00:00 2001
From: Masayuki Morita
Date: Tue, 3 Jan 2017 14:36:08 +0900
Subject: Move error messages in GitHubReleaseDownloadStrategy to raise
argument
---
Library/Homebrew/download_strategy.rb | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index fa54ef716..6e618f720 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -546,16 +546,10 @@ class GitHubReleaseDownloadStrategy < CurlDownloadStrategy
super
@github_token = ENV["GITHUB_TOKEN"]
- unless @github_token
- puts "Environmental variable GITHUB_TOKEN is required."
- raise CurlDownloadStrategyError, @url
- end
+ raise CurlDownloadStrategyError, "Environmental variable GITHUB_TOKEN is required." unless @github_token
url_pattern = %r|https://github.com/(\S+)/(\S+)/releases/download/(\S+)/(\S+)|
- unless @url =~ url_pattern
- puts "Invalid url pattern for GitHub Release."
- raise CurlDownloadStrategyError, @url
- end
+ raise CurlDownloadStrategyError, "Invalid url pattern for GitHub Release." unless @url =~ url_pattern
_, @owner, @repo, @tag, @filename = *(@url.match(url_pattern))
end
@@ -580,10 +574,7 @@ class GitHubReleaseDownloadStrategy < CurlDownloadStrategy
def resolve_asset_id
release_metadata = fetch_release_metadata
assets = release_metadata["assets"].select{ |a| a["name"] == @filename }
- if assets.empty?
- puts "Asset file not found."
- raise CurlDownloadStrategyError, @url
- end
+ raise CurlDownloadStrategyError, "Asset file not found." if assets.empty?
return assets.first["id"]
end
@@ -597,8 +588,7 @@ class GitHubReleaseDownloadStrategy < CurlDownloadStrategy
release_response = open(release_url, {:http_basic_authentication => [@github_token]}).read
rescue OpenURI::HTTPError => e
if e.message == '404 Not Found'
- puts "GitHub Release not found."
- raise CurlDownloadStrategyError, @url
+ raise CurlDownloadStrategyError, "GitHub Release not found."
else
raise e
end
--
cgit v1.2.3
From a4330f458a09e946ef7bac912fba63628dbf67ca Mon Sep 17 00:00:00 2001
From: Masayuki Morita
Date: Tue, 3 Jan 2017 14:58:08 +0900
Subject: Use util/github insted of open-uri in GitHubReleaseDownloadStrategy
---
Library/Homebrew/download_strategy.rb | 21 ++++++---------------
Library/Homebrew/test/download_strategies_test.rb | 2 +-
2 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 6e618f720..19af8820c 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -535,18 +535,19 @@ end
# GitHubReleaseDownloadStrategy downloads tarballs from GitHub Release assets.
# To use it, add ":using => GitHubReleaseDownloadStrategy" to the URL section
# of your formula. This download strategy uses GitHub access tokens (in the
-# environment variables GITHUB_TOKEN) to sign the request.
+# 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 GitHubReleaseDownloadStrategy < CurlDownloadStrategy
- require 'open-uri'
+ require "utils/formatter"
+ require 'utils/github'
def initialize(name, resource)
super
- @github_token = ENV["GITHUB_TOKEN"]
- raise CurlDownloadStrategyError, "Environmental variable GITHUB_TOKEN is required." unless @github_token
+ @github_token = ENV["HOMEBREW_GITHUB_API_TOKEN"]
+ raise CurlDownloadStrategyError, "Environmental variable HOMEBREW_GITHUB_API_TOKEN is required." unless @github_token
url_pattern = %r|https://github.com/(\S+)/(\S+)/releases/download/(\S+)/(\S+)|
raise CurlDownloadStrategyError, "Invalid url pattern for GitHub Release." unless @url =~ url_pattern
@@ -584,17 +585,7 @@ class GitHubReleaseDownloadStrategy < CurlDownloadStrategy
end
def fetch_release_metadata
- begin
- release_response = open(release_url, {:http_basic_authentication => [@github_token]}).read
- rescue OpenURI::HTTPError => e
- if e.message == '404 Not Found'
- raise CurlDownloadStrategyError, "GitHub Release not found."
- else
- raise e
- end
- end
-
- return JSON.parse(release_response)
+ GitHub.open(release_url)
end
end
diff --git a/Library/Homebrew/test/download_strategies_test.rb b/Library/Homebrew/test/download_strategies_test.rb
index 1df0267af..e69bdfda2 100644
--- a/Library/Homebrew/test/download_strategies_test.rb
+++ b/Library/Homebrew/test/download_strategies_test.rb
@@ -64,7 +64,7 @@ end
class GitHubReleaseDownloadStrategyTests < Homebrew::TestCase
def setup
resource = ResourceDouble.new("https://github.com/owner/repo/releases/download/tag/foo_v0.1.0_darwin_amd64.tar.gz")
- ENV["GITHUB_TOKEN"] = "token"
+ ENV["HOMEBREW_GITHUB_API_TOKEN"] = "token"
@strategy = GitHubReleaseDownloadStrategy.new("foo", resource)
end
--
cgit v1.2.3
From 824768e26ff34a63c0ff809b500c2f3910b982ed Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Tue, 3 Jan 2017 15:59:15 +0000
Subject: Set theme jekyll-theme-cayman
---
docs/_config.yml | 1 +
1 file changed, 1 insertion(+)
create mode 100644 docs/_config.yml
diff --git a/docs/_config.yml b/docs/_config.yml
new file mode 100644
index 000000000..c4192631f
--- /dev/null
+++ b/docs/_config.yml
@@ -0,0 +1 @@
+theme: jekyll-theme-cayman
\ No newline at end of file
--
cgit v1.2.3
From cd1579a51a0455f0e7dee1eeddc2191f67780ce6 Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Tue, 3 Jan 2017 17:50:09 +0000
Subject: Deprecate Homebrew/versions, Homebrew/devel-only.
Don't use Homebrew/versions in a test and remove them both from the
OFFICIAL_TAPS list (i.e. `brew search`).
---
Library/Homebrew/official_taps.rb | 2 --
Library/Homebrew/test/tap_test.rb | 14 +++++++-------
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/Library/Homebrew/official_taps.rb b/Library/Homebrew/official_taps.rb
index a220c9239..c1ef431b6 100644
--- a/Library/Homebrew/official_taps.rb
+++ b/Library/Homebrew/official_taps.rb
@@ -1,7 +1,6 @@
OFFICIAL_TAPS = %w[
apache
completions
- devel-only
dupes
emacs
fuse
@@ -12,7 +11,6 @@ OFFICIAL_TAPS = %w[
python
science
tex
- versions
x11
].freeze
diff --git a/Library/Homebrew/test/tap_test.rb b/Library/Homebrew/test/tap_test.rb
index b950cd166..7114cdf22 100644
--- a/Library/Homebrew/test/tap_test.rb
+++ b/Library/Homebrew/test/tap_test.rb
@@ -16,7 +16,7 @@ class IntegrationCommandTestTap < IntegrationCommandTestCase
end
assert_match "homebrew/foo", cmd("tap")
- assert_match "homebrew/versions", cmd("tap", "--list-official")
+ assert_match "homebrew/science", cmd("tap", "--list-official")
assert_match "2 taps", cmd("tap-info")
assert_match "https://github.com/Homebrew/homebrew-foo", cmd("tap-info", "homebrew/foo")
assert_match "https://github.com/Homebrew/homebrew-foo", cmd("tap-info", "--json=v1", "--installed")
@@ -162,17 +162,17 @@ class TapTest < Homebrew::TestCase
assert_raises(TapUnavailableError) { Tap.new("Homebrew", "bar").remote }
refute_predicate @tap, :custom_remote?
- version_tap = Tap.new("Homebrew", "versions")
- version_tap.path.mkpath
- version_tap.path.cd do
+ services_tap = Tap.new("Homebrew", "services")
+ services_tap.path.mkpath
+ services_tap.path.cd do
shutup do
system "git", "init"
- system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-versions"
+ system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-services"
end
end
- refute_predicate version_tap, :private?
+ refute_predicate services_tap, :private?
ensure
- version_tap.path.rmtree if version_tap
+ services_tap.path.rmtree if services_tap
end
def test_remote_not_git_repo
--
cgit v1.2.3
From bc0aa4e64ce4eaf53476aa448b71b711feb9939e Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Tue, 3 Jan 2017 18:01:03 +0000
Subject: Add versions documentation.
---
docs/Formula-Cookbook.md | 2 +-
docs/Tips-N'-Tricks.md | 4 ++--
docs/Versions.md | 15 +++++++++++++++
3 files changed, 18 insertions(+), 3 deletions(-)
create mode 100644 docs/Versions.md
diff --git a/docs/Formula-Cookbook.md b/docs/Formula-Cookbook.md
index 72afa387e..69a47b211 100644
--- a/docs/Formula-Cookbook.md
+++ b/docs/Formula-Cookbook.md
@@ -9,7 +9,7 @@ A formula is a package definition written in Ruby. It can be created with `brew
| **Keg** | The installation prefix of a **Formula** | `/usr/local/Cellar/foo/0.1` |
| **opt prefix** | A symlink to the active version of a **Keg** | `/usr/local/opt/foo ` |
| **Cellar** | All **Kegs** are installed here | `/usr/local/Cellar` |
-| **Tap** | An Git repository of **Formulae** and/or commands | `/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core` |
+| **Tap** | A Git repository of **Formulae** and/or commands | `/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core` |
| **Bottle** | Pre-built **Keg** used instead of building from source | `qt-4.8.4.mavericks.bottle.tar.gz` |
| **Cask** | An [extension of homebrew](https://github.com/caskroom/homebrew-cask) to install macOS native apps | `/Applications/MacDown.app/Contents/SharedSupport/bin/macdown` |
| **Brew Bundle**| An [extension of homebrew](https://github.com/Homebrew/homebrew-bundle) to describe dependencies | `brew 'myservice', restart_service: true` |
diff --git a/docs/Tips-N'-Tricks.md b/docs/Tips-N'-Tricks.md
index e2257e534..3adf26b87 100644
--- a/docs/Tips-N'-Tricks.md
+++ b/docs/Tips-N'-Tricks.md
@@ -2,8 +2,8 @@
## Installing previous versions of formulae
-The preferred and supported method of installing specific versions of
-formulae is to use formula like e.g. `gcc@6`. If the version you’re looking for isn’t available, consider [opening a
+The supported method of installing specific versions of
+some formulae is to see if there is a versions formula like e.g. `gcc@6` available. If the version you’re looking for isn’t available, consider [opening a
pull request](https://github.com/Homebrew/brew/blob/master/docs/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md)!
### Installing directly from pull-requests
diff --git a/docs/Versions.md b/docs/Versions.md
new file mode 100644
index 000000000..87bc9f566
--- /dev/null
+++ b/docs/Versions.md
@@ -0,0 +1,15 @@
+# Versions
+Now that [Homebrew/versions](https://github.com/homebrew/homebrew-versions) has been deprecated [Homebrew/core](https://github.com/homebrew/homebrew-core) supports multiple versions of formulae with a new naming format.
+
+In [Homebrew/versions](https://github.com/homebrew/homebrew-versions) the formula for GCC 6 was named `gcc6.rb` and began `class Gcc6 < Formula`. In [Homebrew/core](https://github.com/homebrew/homebrew-core) this same formula is named `gcc@6.rb` and begins `class GccAT6 < Formula`.
+
+## Acceptable Versioned Formulae
+Homebrew's versions are not intended to be used for any old versions you personally require for your project; formulae submitted should be expected to be used by a large number of people and still supported by their upstream projects.
+
+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.
+
+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.
--
cgit v1.2.3
From 6ecf2ca0135bb79b92d21cc8ccbed9dd5cce1b03 Mon Sep 17 00:00:00 2001
From: Alyssa Ross
Date: Tue, 3 Jan 2017 18:04:29 +0000
Subject: cask: remove license
See https://github.com/Homebrew/brew/pull/1771#issuecomment-270179479.
---
Library/Homebrew/cask/LICENSE | 23 -----------------------
1 file changed, 23 deletions(-)
delete mode 100644 Library/Homebrew/cask/LICENSE
diff --git a/Library/Homebrew/cask/LICENSE b/Library/Homebrew/cask/LICENSE
deleted file mode 100644
index 62542ae57..000000000
--- a/Library/Homebrew/cask/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-Copyright © 2013-2016, Paul Hinze & Contributors
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright notice, this
- list of conditions and the following disclaimer in the documentation and/or
- other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--
cgit v1.2.3
From a175a1241efbec95f442257919fffe867bdf26cf Mon Sep 17 00:00:00 2001
From: Alyssa Ross
Date: Tue, 3 Jan 2017 18:05:30 +0000
Subject: license: remove copyright ending year
See https://github.com/Homebrew/brew/pull/1771#issuecomment-270143292.
---
LICENSE.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/LICENSE.txt b/LICENSE.txt
index 1efd08cff..12500f7e5 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,6 +1,6 @@
BSD 2-Clause License
-Copyright (c) 2009-2016, Homebrew contributors
+Copyright (c) 2009-present, Homebrew contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
--
cgit v1.2.3
From d7ab913f312a3dd0852ba874d7585c4aad3c6166 Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Tue, 3 Jan 2017 22:12:21 +0000
Subject: audit: deprecate env :std/:userpaths for strict.
This should apply only for new formulae but we should start gradually
phasing it out for older ones too.
---
Library/Homebrew/dev-cmd/audit.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 74ba987f6..601031d6e 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -1048,6 +1048,8 @@ class FormulaAuditor
return unless @strict
+ problem "`#{$1}` in formulae is deprecated" if line =~ /(env :(std|userpaths))/
+
if line =~ /system ((["'])[^"' ]*(?:\s[^"' ]*)+\2)/
bad_system = $1
unless %w[| < > & ; *].any? { |c| bad_system.include? c }
--
cgit v1.2.3
From b7e10ba23972e3ebfdc4a75da1b6e2016d3e99c9 Mon Sep 17 00:00:00 2001
From: Alyssa Ross
Date: Wed, 4 Jan 2017 00:46:44 +0000
Subject: tests: remove temp tab homebrew_version override
This had to be added in #1750 to work around special-casing for tabs
generated with Homebrew versions < 1.1.6. Now that 1.1.6 is the current
version, we can remove this hack.
---
Library/Homebrew/test/tab_test.rb | 8 --------
1 file changed, 8 deletions(-)
diff --git a/Library/Homebrew/test/tab_test.rb b/Library/Homebrew/test/tab_test.rb
index 526e1f79e..baa1dec84 100644
--- a/Library/Homebrew/test/tab_test.rb
+++ b/Library/Homebrew/test/tab_test.rb
@@ -33,10 +33,6 @@ class TabTests < Homebrew::TestCase
def test_defaults
tab = Tab.empty
- # FIXME: remove this line after Homebrew 1.1.6 is released.
- # See https://github.com/Homebrew/brew/pull/1750#discussion_r94254622
- tab.homebrew_version = "1.1.6"
-
assert_empty tab.unused_options
assert_empty tab.used_options
assert_nil tab.changed_files
@@ -199,10 +195,6 @@ class TabTests < Homebrew::TestCase
stdlib = :libcxx
tab = Tab.create(f, compiler, stdlib)
- # FIXME: remove this line after Homebrew 1.1.6 is released.
- # See https://github.com/Homebrew/brew/pull/1750#discussion_r94254622
- tab.homebrew_version = "1.1.6"
-
runtime_dependencies = [
{ "full_name" => "bar", "version" => "2.0" },
{ "full_name" => "user/repo/from_tap", "version" => "1.0" },
--
cgit v1.2.3
From 56d6695bf36805bb32a960e377a564fc4df5d716 Mon Sep 17 00:00:00 2001
From: Alyssa Ross
Date: Wed, 4 Jan 2017 00:56:06 +0000
Subject: tab: set homebrew_version in Tab.empty
---
Library/Homebrew/tab.rb | 1 +
Library/Homebrew/test/tab_test.rb | 1 +
2 files changed, 2 insertions(+)
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb
index 669846dfc..746c3dd92 100644
--- a/Library/Homebrew/tab.rb
+++ b/Library/Homebrew/tab.rb
@@ -168,6 +168,7 @@ class Tab < OpenStruct
def self.empty
attributes = {
+ "homebrew_version" => HOMEBREW_VERSION,
"used_options" => [],
"unused_options" => [],
"built_as_bottle" => false,
diff --git a/Library/Homebrew/test/tab_test.rb b/Library/Homebrew/test/tab_test.rb
index baa1dec84..f9824ba2a 100644
--- a/Library/Homebrew/test/tab_test.rb
+++ b/Library/Homebrew/test/tab_test.rb
@@ -33,6 +33,7 @@ class TabTests < Homebrew::TestCase
def test_defaults
tab = Tab.empty
+ assert_equal HOMEBREW_VERSION, tab.homebrew_version
assert_empty tab.unused_options
assert_empty tab.used_options
assert_nil tab.changed_files
--
cgit v1.2.3
From 127e9def5084063cf33e8acb26a970556ef51148 Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Wed, 4 Jan 2017 10:53:21 +0000
Subject: Cleanup documentation site
GitHub now nicely generates a documentation site for us at
http://brew.sh/brew based on our docs folder. Optimise the output of
this and the GitHub docs directory for readability and the various user
groupings.
---
.gitignore | 7 ++
README.md | 11 +-
docs/.ruby-version | 1 +
docs/Acceptable-Formulae.md | 23 ++--
docs/Analytics.md | 4 +-
docs/Bottles.md | 25 +++--
docs/Brew-Test-Bot-For-Core-Contributors.md | 2 +-
docs/CNAME | 1 +
docs/Checksum_Deprecation.md | 3 +-
docs/Custom-GCC-and-cross-compilers.md | 2 +-
docs/External-Commands.md | 80 +++++---------
docs/FAQ.md | 45 ++++----
docs/Gemfile | 6 ++
docs/Homebrew-and-Python.md | 14 +--
...-a-Homebrew-Pull-Request-(and-get-it-merged).md | 73 -------------
docs/How-To-Open-a-Homebrew-Pull-Request.md | 73 +++++++++++++
docs/Installation.md | 5 +-
docs/New-Maintainer-Checklist.md | 24 ++---
docs/Python-for-Formula-Authors.md | 2 +
docs/Querying-Brew.md | 2 +-
docs/README.md | 71 ++++++------
docs/Tips-N'-Tricks.md | 23 +---
docs/Xcode.md | 120 ++++++++++-----------
docs/_config.yml | 3 +-
docs/brew-tap.md | 5 +-
docs/brew.1.html | 4 +-
manpages/brew.1 | 4 +-
27 files changed, 310 insertions(+), 323 deletions(-)
create mode 100644 docs/.ruby-version
create mode 100644 docs/CNAME
create mode 100644 docs/Gemfile
delete mode 100644 docs/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md
create mode 100644 docs/How-To-Open-a-Homebrew-Pull-Request.md
diff --git a/.gitignore b/.gitignore
index 201be91d8..7b1678561 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,6 +38,13 @@
!/docs
!/manpages
+# Ignore generated documentation site
+/docs/_site
+/docs/.bundle
+/docs/bin
+/docs/vendor
+/docs/Gemfile.lock
+
# Unignore our shell completion
!/completions
diff --git a/README.md b/README.md
index 8e3efd1fd..a3d613ce9 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew updat
3. Or use `brew search --desc
-
+| Variable | Description |
+|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| HOMEBREW_CACHE | Where Homebrew caches downloaded tarballs to, by default ~/Library/Caches/Homebrew. |
+| HOMEBREW_CELLAR | The location of the Homebrew Cellar, where software is staged. This will be $HOMEBREW_PREFIX/Cellar if that directory exists, or $HOMEBREW_REPOSITORY/Cellar otherwise. |
+| HOMEBREW_LIBRARY_PATH | The directory containing Homebrew’s own application code. |
+| HOMEBREW_PREFIX | Where Homebrew installs software. This is always the grandparent directory of the `brew` executable, /usr/local by default. |
+| HOMEBREW_REPOSITORY | If installed from a Git clone, the repo directory (i.e., where Homebrew’s .git directory lives). |
+
Note that the script itself can use any suitable shebang (`#!`) line, so an external “shell script” can be written for sh, bash, Ruby, or anything else.
-## USER-SUBMITTED COMMANDS
+## User-submitted Commands
These commands have been contributed by Homebrew users but are not included in the main Homebrew repository, nor are they installed by the installer script. You can install them manually, as outlined above.
->*NOTE:* They are largely untested, and as always, be careful about running untested code on your machine.
+Note they are largely untested, and as always, be careful about running untested code on your machine.
### brew-livecheck
-> Check if there is a new upstream version of a formula.
->
-> See the [`README`](https://github.com/youtux/homebrew-livecheck/blob/master/README.md) for more info and usage.
->
-> Install using:
-> ```
-> $ brew tap youtux/livecheck
-> ```
+Check if there is a new upstream version of a formula.
+See the [`README`](https://github.com/youtux/homebrew-livecheck/blob/master/README.md) for more info and usage.
+
+Install using:
+```sh
+brew tap youtux/livecheck
+```
### brew-gem
->Install any gem package into a self-contained Homebrew cellar location:
-
- Variable
- Description
-
-
- HOMEBREW_CACHE
- Where Homebrew caches downloaded tarballs to, by default
- ~/Library/Caches/Homebrew.
-
- HOMEBREW_CELLAR
- The location of the Homebrew Cellar, where software is staged. This will be
- $HOMEBREW_PREFIX/Cellar if that directory exists, or $HOMEBREW_REPOSITORY/Cellar otherwise.
-
- HOMEBREW_LIBRARY_PATH
- The directory containing Homebrew’s own application code.
-
-
- HOMEBREW_PREFIX
- Where Homebrew installs software. This is always the grandparent directory of the `brew` executable,
- /usr/local by default.
-
-HOMEBREW_REPOSITORY
- If installed from a Git clone, the repo directory (i.e., where Homebrew’s
- .git directory lives).
`/usr/local/bin` is already in your
@@ -142,7 +143,7 @@ brews then save yourself a bunch of hassle and install to
It is not always straightforward to tell `gem` to look in non-standard directories for headers and libraries. If you choose `/usr/local`, many things will "just work".
-### Why does Homebrew say sudo is bad?
+## Why does Homebrew say sudo is bad?
**tl;dr** Sudo is dangerous, and you installed TextMate.app without sudo
anyway.
@@ -168,17 +169,17 @@ not. So is it that important to `chown root wget`?
If you need to run Homebrew in a multi-user environment, consider
creating a separate user account especially for use of Homebrew.
-### Why isn’t a particular command documented?
+## Why isn’t a particular command documented?
If it’s not in `man brew`, it’s probably an external command. These are documented [here](External-Commands.md).
-### Why haven’t you pulled my pull request?
+## Why haven’t you pulled my pull request?
If it’s been a while, bump it with a “bump” comment. Sometimes we miss requests and there are plenty of them. Maybe we were thinking on something. It will encourage consideration. In the meantime if you could rebase the pull request so that it can be cherry-picked more easily we will love you for a long time.
-### Can I edit formulae myself?
+## Can I edit formulae myself?
Yes! It’s easy! Just `brew edit $FORMULA`. You don’t have to submit modifications back to *Homebrew/homebrew-core*, just edit the formula as you personally need it and `brew install`. As a bonus `brew update` will merge your changes with upstream so you can still keep the formula up-to-date **with** your personal modifications!
-### Can I make new formulae?
+## Can I make new formulae?
Yes! It’s easy! Just `brew create URL` Homebrew will then open the
formula in `$EDITOR` so you can edit it, but it probably already
installs; try it: `brew install $FORMULA`. If you come up with any issues,
@@ -188,7 +189,7 @@ which drops you into a debugging shell.
If you want your new formula to be part of *homebrew/core* or want
to learn more about writing formulae, then please read the [Formula Cookbook](Formula-Cookbook.md).
-### Can I install my own stuff to `/usr/local`?
+## Can I install my own stuff to `/usr/local`?
Yes, brew is designed to not get in your way so you can use it how you
like.
@@ -211,25 +212,25 @@ $ brew link foo
Linking /usr/local/Cellar/foo/0.1… 17 symlinks created
```
-### Where was a formula deleted?
+## Why was a formula deleted?
Use `brew log $FORMULA` to find out! Likely because it had unresolved issues or
our analytics identified it was not widely used.
-### Homebrew is a poor name, it is generic, why was it chosen?
+## Homebrew is a poor name, it is generic, why was it chosen?
@mxcl was too concerned with the beer theme and didn’t consider that the
project may actually prove popular. By the time he realized it was too
late. However, today, the first google hit for “homebrew” is not beer
related ;-)
-### What does *keg-only* mean?
+## What does *keg-only* mean?
It means the formula is installed only into the Cellar; it is not linked
into `/usr/local`. This means most tools will not find it. We don’t do
this for stupid reasons. You can still link in the formula if you need
to with `brew link`.
-### How can I specify different configure arguments for a formula?
+## How can I specify different configure arguments for a formula?
`brew edit $FORMULA` and edit the formula. Currently there is no
other way to do this.
-### Is there a glossary of terms around?
+## Is there a glossary of terms around?
All your terminology needs can be [found here](Formula-Cookbook.md#homebrew-terminology).
diff --git a/docs/Gemfile b/docs/Gemfile
new file mode 100644
index 000000000..fac2f802d
--- /dev/null
+++ b/docs/Gemfile
@@ -0,0 +1,6 @@
+source "https://rubygems.org"
+
+gem "github-pages", group: :jekyll_plugins
+
+# Nokogiri >=1.7 requires Ruby >=2.1
+gem "nokogiri", "<1.7"
diff --git a/docs/Homebrew-and-Python.md b/docs/Homebrew-and-Python.md
index 2500b8592..0757b5d24 100644
--- a/docs/Homebrew-and-Python.md
+++ b/docs/Homebrew-and-Python.md
@@ -1,6 +1,4 @@
-# Homebrew and Python
-## Overview
-
+# Python
This page describes how Python is handled in Homebrew for users. See [Python for Formula Authors](Python-for-Formula-Authors.md) for advice on writing formulae to install packages written in Python.
Homebrew should work with any [CPython](https://stackoverflow.com/questions/2324208/is-there-any-difference-between-cpython-and-python) and defaults to the macOS system Python.
@@ -11,14 +9,12 @@ Homebrew provides formulae to brew a more up-to-date Python 2.7.x (and 3.x).
## Python 2.x or Python 3.x
-
Homebrew provides a formula for Python 2.7.x and one for Python 3.x. They don't conflict, so they can both be installed. The executable `python` will always point to the 2.x and `python3` to the 3.x version.
([Wondering which one to choose?](https://wiki.python.org/moin/Python2orPython3))
## Setuptools, Pip, etc.
-
The Python formulae install [`pip`](http://www.pip-installer.org) and [Setuptools](https://pypi.python.org/pypi/setuptools).
Setuptools can be updated via Pip, without having to re-brew Python:
@@ -30,7 +26,6 @@ Similarly, Pip can be used to upgrade itself via:
pip install --upgrade pip
### Note on `pip install --user`
-
The normal `pip install --user` is disabled for brewed Python. This is because of a bug in distutils, because Homebrew writes a `distutils.cfg` which sets the package `prefix`.
A possible workaround (which puts executable scripts in `~/Library/Python/{{ formula
-name }}-{{ version }}. In the case of Erlang, this requires
+watch the file name. Homebrew downloads files as ${FORMULA_NAME}-${VERSION}. In the case of Erlang, this requires
renaming the file from otp_src_R13B03 to
erlang-R13B03.
@@ -60,7 +54,6 @@ run `mv the_tarball $(brew --cache -s $FORMULA)`.
You can also pre-cache the download by using the command `brew fetch formula` which also displays the SHA256 value. This can be useful for updating formulae to new versions.
## Using Homebrew behind a proxy
-
Behind the scenes, Homebrew uses several commands for downloading files (e.g. curl, git, svn). Many of these tools can download via a proxy. It's a common (though not universal) convention for these command-line tools to observe getting the proxy parameters from environment variables (e.g. `http_proxy`). Unfortunately, most tools are inconsistent in their use of these environment parameters (e.g. curl supports `http_proxy`, `HTTPS_PROXY`, `FTP_PROXY`, `GOPHER_PROXY`, `ALL_PROXY`, `NO_PROXY`).
Luckily, for the majority of cases setting `http_proxy` is enough.
@@ -72,13 +65,11 @@ http_proxy=http://
Homebrew's lead maintainer is Mike McQuaid.
-Homebrew's current maintainers are Misty De Meo, Andrew Janke, Xu Cheng, Tomasz Pajor, Josh Hagins, Baptiste Fontaine, Markus Reiter, ilovezfs, Martin Afanasjew, Tom Schoonjans, Uladzislau Shablinski, Tim Smith and Alex Dunn.
+Homebrew's current maintainers are Misty De Meo, Andrew Janke, Xu Cheng, Tomasz Pajor, Josh Hagins, Baptiste Fontaine, Markus Reiter, ilovezfs, Tom Schoonjans, Uladzislau Shablinski, Tim Smith and Alex Dunn.
-Former maintainers with significant contributions include Dominyk Tiller, Brett Koonce, Jack Nagel, Adam Vandenberg and Homebrew's creator: Max Howell.
+Former maintainers with significant contributions include Martin Afanasjew, Dominyk Tiller, Brett Koonce, Jack Nagel, Adam Vandenberg and Homebrew's creator: Max Howell.
class Wget < Formula
@@ -2059,7 +2059,7 @@ class Formula
# and you haven't passed or previously used any options on this formula.
#
# If you maintain your own repository, you can add your own bottle links.
- # https://github.com/Homebrew/brew/blob/master/docs/Bottles.md
+ # http://docs.brew.sh/Bottles.html
# You can ignore this block entirely if submitting to Homebrew/Homebrew, It'll be
# handled for you by the Brew Test Bot.
#
diff --git a/Library/Homebrew/manpages/brew.1.md.erb b/Library/Homebrew/manpages/brew.1.md.erb
index 7412d0a69..2266f3e7a 100644
--- a/Library/Homebrew/manpages/brew.1.md.erb
+++ b/Library/Homebrew/manpages/brew.1.md.erb
@@ -76,7 +76,7 @@ scripts that reside somewhere in the `PATH`, named `brew-` or
to create your own commands without modifying Homebrew's internals.
Instructions for creating your own commands can be found in the docs:
-
+
## SPECIFYING FORMULAE
@@ -197,7 +197,7 @@ can take several different forms:
*Default:* the number of available CPU cores.
* `HOMEBREW_NO_ANALYTICS`:
- If set, Homebrew will not send analytics. See:
+ If set, Homebrew will not send analytics. See:
* `HOMEBREW_NO_AUTO_UPDATE`:
If set, Homebrew will not auto-update before running `brew install`,
diff --git a/Library/Homebrew/os.rb b/Library/Homebrew/os.rb
index f6fe1eb81..dae843407 100644
--- a/Library/Homebrew/os.rb
+++ b/Library/Homebrew/os.rb
@@ -15,7 +15,7 @@ module OS
require "os/mac"
# Don't tell people to report issues on unsupported versions of macOS.
if !OS::Mac.prerelease? && !OS::Mac.outdated_release?
- ISSUES_URL = "https://git.io/brew-troubleshooting".freeze
+ ISSUES_URL = "http://docs.brew.sh/Troubleshooting.html".freeze
end
PATH_OPEN = "/usr/bin/open".freeze
# compatibility
diff --git a/Library/Homebrew/utils/analytics.rb b/Library/Homebrew/utils/analytics.rb
index cc7ad54d2..7dd54d3f1 100644
--- a/Library/Homebrew/utils/analytics.rb
+++ b/Library/Homebrew/utils/analytics.rb
@@ -35,7 +35,7 @@ module Utils
end
# Send analytics. Don't send or store any personally identifiable information.
- # https://github.com/Homebrew/brew/blob/master/docs/Analytics.md
+ # http://docs.brew.sh/Analytics.html
# https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide
# https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
if ENV["HOMEBREW_ANALYTICS_DEBUG"]
diff --git a/Library/Homebrew/utils/analytics.sh b/Library/Homebrew/utils/analytics.sh
index 0f188fe9b..35f91eabc 100644
--- a/Library/Homebrew/utils/analytics.sh
+++ b/Library/Homebrew/utils/analytics.sh
@@ -107,7 +107,7 @@ report-analytics-screenview-command() {
)
# Send analytics. Don't send or store any personally identifiable information.
- # https://github.com/Homebrew/brew/blob/master/docs/Analytics.md
+ # http://docs.brew.sh/Analytics.html
# https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#screenView
# https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
if [[ -z "$HOMEBREW_ANALYTICS_DEBUG" ]]
diff --git a/README.md b/README.md
index a3d613ce9..940b49878 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew updat
## Troubleshooting
First, please run `brew update` and `brew doctor`.
-Second, read the [Troubleshooting Checklist](https://github.com/Homebrew/brew/blob/master/docs/Troubleshooting.md#troubleshooting).
+Second, read the [Troubleshooting Checklist](http://docs.brew.sh/Troubleshooting.html).
**If you don't read these it will take us far longer to help you with your problem.**
@@ -27,7 +27,7 @@ We'd love you to contribute to Homebrew. First, please read our [Contribution Gu
We explicitly welcome contributions from people who have never contributed to open-source before: we were all beginners once! We can help build on a partially working pull request with the aim of getting it merged. We are also actively seeking to diversify our contributors and especially welcome contributions from women from all backgrounds and people of colour.
-A good starting point for contributing is running `brew audit` (or `brew audit --strict`) with some of the packages you use (e.g. `brew audit wget` if you use `wget`) and then read through the warnings, try to fix them until `brew audit` shows no results and [submit a pull request](https://github.com/Homebrew/brew/blob/master/docs/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md). If no formulae you use have warnings you can run `brew audit` without arguments to have it run on all packages and pick one. Good luck!
+A good starting point for contributing is running `brew audit` (or `brew audit --strict`) with some of the packages you use (e.g. `brew audit wget` if you use `wget`) and then read through the warnings, try to fix them until `brew audit` shows no results and [submit a pull request](http://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request.html). If no formulae you use have warnings you can run `brew audit` without arguments to have it run on all packages and pick one. Good luck!
## Security
Please report security issues to security@brew.sh.
@@ -61,7 +61,7 @@ Please consider a regular donation through Patreon:
[](https://www.patreon.com/homebrew)
## Sponsors
-Our CI infrastructure was paid for by [our Kickstarter supporters](https://github.com/Homebrew/brew/blob/master/docs/Kickstarter-Supporters.md).
+Our CI infrastructure was paid for by [our Kickstarter supporters](http://docs.brew.sh/Kickstarter-Supporters.html).
Our CI infrastructure is hosted by [The Positive Internet Company](http://www.positive-internet.com).
diff --git a/docs/Formula-Cookbook.md b/docs/Formula-Cookbook.md
index 69a47b211..6304d7b0e 100644
--- a/docs/Formula-Cookbook.md
+++ b/docs/Formula-Cookbook.md
@@ -352,7 +352,7 @@ If you have already forked Homebrew on GitHub, then you can manually push (just
git push https://github.com/myname/homebrew-core/
```
-Now, please [open a pull request](https://github.com/Homebrew/brew/blob/master/docs/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md#how-to-open-a-homebrew-pull-request-and-get-it-merged) for your changes.
+Now, please [open a pull request](http://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request.html) for your changes.
* One formula per commit; one commit per formula
* Keep merge commits out of the pull request
diff --git a/docs/Tips-N'-Tricks.md b/docs/Tips-N'-Tricks.md
index 3e14158d4..8f67c9ca8 100644
--- a/docs/Tips-N'-Tricks.md
+++ b/docs/Tips-N'-Tricks.md
@@ -3,8 +3,7 @@
## Installing previous versions of formulae
The supported method of installing specific versions of
-some formulae is to see if there is a versions formula like e.g. `gcc@6` available. If the version you’re looking for isn’t available, consider [opening a
-pull request](https://github.com/Homebrew/brew/blob/master/docs/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md)!
+some formulae is to see if there is a versions formula like e.g. `gcc@6` available. If the version you’re looking for isn’t available, consider [opening a pull request](How-To-Open-a-Homebrew-Pull-Request.md)!
### Installing directly from pull-requests
You can [browse pull requests](https://github.com/Homebrew/homebrew-core/pulls)
diff --git a/docs/brew.1.html b/docs/brew.1.html
index e3a44ec87..8c81b1ddb 100644
--- a/docs/brew.1.html
+++ b/docs/brew.1.html
@@ -36,7 +36,7 @@ If no search term is given, all locally available formulae are listed. analytics [state]Display anonymous user behaviour analytics state. -Read more at https://git.io/brew-analytics.
analytics (on|off)Turn on/off Homebrew's analytics.
analytics regenerate-uuidRegenerate UUID used in Homebrew's analytics.
cat formulaDisplay the source to formula.
v1.
information on all installed formulae.
See the docs for examples of using the JSON: -https://github.com/Homebrew/brew/blob/master/docs/Querying-Brew.md
+http://docs.brew.sh/Querying-Brew.htmlinstall [--debug] [--env=std|super] [--ignore-dependencies] [--only-dependencies] [--cc=compiler] [--build-from-source] [--devel|--HEAD] [--keep-tmp] formulaInstall formula.
formula is usually the name of the formula to install, but it can be specified
@@ -352,7 +352,7 @@ for version is v1.
Pass --installed to get information on installed taps.
See the docs for examples of using the JSON: -https://github.com/Homebrew/brew/blob/master/docs/Querying-Brew.md
tap-pin tapPin tap, prioritizing its formulae over core when formula names are supplied
by the user. See also tap-unpin.
tap-unpin tapUnpin tap so its formulae are no longer prioritized. See also tap-pin.
PATH, named brew-
to create your own commands without modifying Homebrew's internals.
Instructions for creating your own commands can be found in the docs: -https://github.com/Homebrew/brew/blob/master/docs/External-Commands.md
+http://docs.brew.sh/External-Commands.htmlbrew search.
the number of parallel jobs to run when building with make(1).
Default: the number of available CPU cores.
-HOMEBREW_NO_ANALYTICSIf set, Homebrew will not send analytics. See: https://github.com/Homebrew/brew/blob/master/docs/Analytics.md#analytics
HOMEBREW_NO_ANALYTICSIf set, Homebrew will not send analytics. See: http://docs.brew.sh/Analytics.html
HOMEBREW_NO_AUTO_UPDATEIf set, Homebrew will not auto-update before running brew install,
brew upgrade or brew tap.
HOMEBREW_NO_EMOJIIf set, Homebrew will not print the HOMEBREW_INSTALL_BADGE on a
diff --git a/manpages/brew.1 b/manpages/brew.1
index e60972c18..c9269e7b3 100644
--- a/manpages/brew.1
+++ b/manpages/brew.1
@@ -45,7 +45,7 @@ Perform a substring search of formula names for \fItext\fR\. If \fItext\fR is su
.
.TP
\fBanalytics\fR [\fBstate\fR]
-Display anonymous user behaviour analytics state\. Read more at \fIhttps://git\.io/brew\-analytics\fR\.
+Display anonymous user behaviour analytics state\. Read more at \fIhttp://docs\.brew\.sh/Analytics\.html\fR\.
.
.TP
\fBanalytics\fR (\fBon\fR|\fBoff\fR)
@@ -213,7 +213,7 @@ Print a JSON representation of \fIformulae\fR\. Currently the only accepted valu
Pass \fB\-\-all\fR to get information on all formulae, or \fB\-\-installed\fR to get information on all installed formulae\.
.
.IP
-See the docs for examples of using the JSON: \fIhttps://github\.com/Homebrew/brew/blob/master/docs/Querying\-Brew\.md\fR
+See the docs for examples of using the JSON: \fIhttp://docs\.brew\.sh/Querying\-Brew\.html\fR
.
.TP
\fBinstall\fR [\fB\-\-debug\fR] [\fB\-\-env=\fR\fIstd\fR|\fIsuper\fR] [\fB\-\-ignore\-dependencies\fR] [\fB\-\-only\-dependencies\fR] [\fB\-\-cc=\fR\fIcompiler\fR] [\fB\-\-build\-from\-source\fR] [\fB\-\-devel\fR|\fB\-\-HEAD\fR] [\fB\-\-keep\-tmp\fR] \fIformula\fR
@@ -479,7 +479,7 @@ Print a JSON representation of \fItaps\fR\. Currently the only accepted value fo
Pass \fB\-\-installed\fR to get information on installed taps\.
.
.IP
-See the docs for examples of using the JSON: \fIhttps://github\.com/Homebrew/brew/blob/master/docs/Querying\-Brew\.md\fR
+See the docs for examples of using the JSON: \fIhttp://docs\.brew\.sh/Querying\-Brew\.html\fR
.
.TP
\fBtap\-pin\fR \fItap\fR
@@ -838,7 +838,7 @@ Integrates Homebrew formulae with macOS\'s \fBlaunchctl\fR manager: \fIhttps://g
Homebrew, like \fBgit\fR(1), supports external commands\. These are executable scripts that reside somewhere in the \fBPATH\fR, named \fBbrew\-\fR\fIcmdname\fR or \fBbrew\-\fR\fIcmdname\fR\fB\.rb\fR, which can be invoked like \fBbrew\fR \fIcmdname\fR\. This allows you to create your own commands without modifying Homebrew\'s internals\.
.
.P
-Instructions for creating your own commands can be found in the docs: \fIhttps://github\.com/Homebrew/brew/blob/master/docs/External\-Commands\.md\fR
+Instructions for creating your own commands can be found in the docs: \fIhttp://docs\.brew\.sh/External\-Commands\.html\fR
.
.SH "SPECIFYING FORMULAE"
Many Homebrew commands accept one or more \fIformula\fR arguments\. These arguments can take several different forms:
@@ -957,7 +957,7 @@ If set, instructs Homebrew to use the value of \fBHOMEBREW_MAKE_JOBS\fR as the n
.
.TP
\fBHOMEBREW_NO_ANALYTICS\fR
-If set, Homebrew will not send analytics\. See: \fIhttps://github\.com/Homebrew/brew/blob/master/docs/Analytics\.md#analytics\fR
+If set, Homebrew will not send analytics\. See: \fIhttp://docs\.brew\.sh/Analytics\.html\fR
.
.TP
\fBHOMEBREW_NO_AUTO_UPDATE\fR
--
cgit v1.2.3
From 6195d6592b7374e135440025c82ae19cf37f30af Mon Sep 17 00:00:00 2001
From: ilovezfs
Date: Wed, 4 Jan 2017 10:23:15 -0800
Subject: formula: realpath prefix before computing abv
versioned prefix is a directory, but unversioned is a symlink, so
realpath it before computing abv
---
Library/Homebrew/formula.rb | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index eb85f804f..dcee0de85 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -553,7 +553,7 @@ class Formula
# called from within the same formula's {#install} or {#post_install} methods.
# Otherwise, return the full path to the formula's versioned cellar.
def prefix(v = pkg_version)
- prefix = rack/v
+ prefix = FormulaPrefixPathname.new(rack/v)
if !@versioned_prefix && prefix.directory? && Keg.new(prefix).optlinked?
opt_prefix
else
@@ -938,7 +938,7 @@ class Formula
# formula, as the path is stable even when the software is updated.
#
args << "--with-readline=#{Formula["readline"].opt_prefix}" if build.with? "readline"
def opt_prefix
- Pathname.new("#{HOMEBREW_PREFIX}/opt/#{name}")
+ FormulaPrefixPathname.new("#{HOMEBREW_PREFIX}/opt/#{name}")
end
def opt_bin
@@ -2423,4 +2423,10 @@ class Formula
@link_overwrite_paths ||= Set.new
end
end
+
+ class FormulaPrefixPathname < Pathname
+ def abv
+ Pathname.new(realpath).abv
+ end
+ end
end
--
cgit v1.2.3
From a68d38743abc2351a9468dcec70174fdfe38cf94 Mon Sep 17 00:00:00 2001
From: ilovezfs
Date: Wed, 4 Jan 2017 10:27:39 -0800
Subject: formula: make prefix_linked? use versioned prefix
otherwise whenever prefix is unversioned, prefix_Linked will be false
---
Library/Homebrew/formula.rb | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index dcee0de85..cad8a693f 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -574,7 +574,10 @@ class Formula
# Is formula's linked keg points to the prefix.
def prefix_linked?(v = pkg_version)
return false unless linked?
- linked_keg.resolved_path == prefix(v)
+ @versioned_prefix = true
+ result = linked_keg.resolved_path == prefix(v)
+ @versioned_prefix = false
+ result
end
# {PkgVersion} of the linked keg for the formula.
--
cgit v1.2.3
From 9a6cd9b83fc8596727df0157e89faee302907cda Mon Sep 17 00:00:00 2001
From: Jonathan Chang
Date: Wed, 4 Jan 2017 16:16:00 -0600
Subject: docs: fix titles on docs.brew.sh
---
docs/Acceptable-Formulae.md | 1 +
docs/Analytics.md | 1 +
docs/Bottles.md | 1 +
docs/Brew-Test-Bot-For-Core-Contributors.md | 1 +
docs/Brew-Test-Bot.md | 1 +
docs/C++-Standard-Libraries.md | 1 +
docs/Checksum_Deprecation.md | 1 +
docs/Common-Issues.md | 1 +
docs/Custom-GCC-and-cross-compilers.md | 1 +
docs/External-Commands.md | 1 +
docs/Formula-Cookbook.md | 1 +
docs/Gems,-Eggs-and-Perl-Modules.md | 1 +
docs/Homebrew-and-Python.md | 1 +
docs/How-to-Create-and-Maintain-a-Tap.md | 1 +
docs/Installation.md | 1 +
docs/Interesting-Taps-&-Forks.md | 1 +
docs/Kickstarter-Supporters.md | 1 +
docs/Maintainer-Guidelines.md | 1 +
docs/Maintainers-Avoiding-Burnout.md | 1 +
docs/Migrating-A-Formula-To-A-Tap.md | 1 +
docs/New-Maintainer-Checklist.md | 1 +
docs/Querying-Brew.md | 1 +
docs/Versions.md | 1 +
docs/brew-tap.md | 1 +
24 files changed, 24 insertions(+)
diff --git a/docs/Acceptable-Formulae.md b/docs/Acceptable-Formulae.md
index 12084fad7..9f4fb45db 100644
--- a/docs/Acceptable-Formulae.md
+++ b/docs/Acceptable-Formulae.md
@@ -1,4 +1,5 @@
# Acceptable Formulae
+
Some formulae should not go in
[homebrew/core](https://github.com/Homebrew/homebrew-core). But there are
additional [Interesting Taps & Forks](Interesting-Taps-&-Forks.md) and anyone can start their
diff --git a/docs/Analytics.md b/docs/Analytics.md
index 80515d079..b4e73f75d 100644
--- a/docs/Analytics.md
+++ b/docs/Analytics.md
@@ -1,4 +1,5 @@
# Anonymous Aggregate User Behaviour Analytics
+
Homebrew has begun gathering anonymous aggregate user behaviour analytics and reporting these to Google Analytics. You will be notified the first time you run `brew update` or install Homebrew.
## Why?
diff --git a/docs/Bottles.md b/docs/Bottles.md
index 7d2982c14..2752ebe03 100644
--- a/docs/Bottles.md
+++ b/docs/Bottles.md
@@ -1,4 +1,5 @@
# Bottles (binary packages)
+
Bottles are produced by installing a formula with `brew install --build-bottle $FORMULA` and then bottling it with `brew bottle $FORMULA`. This outputs the bottle DSL which should be inserted into the formula file.
## Usage
diff --git a/docs/Brew-Test-Bot-For-Core-Contributors.md b/docs/Brew-Test-Bot-For-Core-Contributors.md
index 4b697066c..f4c9a0ec6 100644
--- a/docs/Brew-Test-Bot-For-Core-Contributors.md
+++ b/docs/Brew-Test-Bot-For-Core-Contributors.md
@@ -1,4 +1,5 @@
# Brew Test Bot For Core Contributors
+
If a build has run and passed on `brew test-bot` then it can be used to quickly bottle formulae.
There are two types of Jenkins jobs you will interact with:
diff --git a/docs/Brew-Test-Bot.md b/docs/Brew-Test-Bot.md
index 0a5f76bda..db39327fa 100644
--- a/docs/Brew-Test-Bot.md
+++ b/docs/Brew-Test-Bot.md
@@ -1,4 +1,5 @@
# Brew Test Bot
+
`brew test-bot` is the name for the automated review and testing system funded
by [our Kickstarter in 2013](https://www.kickstarter.com/projects/homebrew/brew-test-bot).
diff --git a/docs/C++-Standard-Libraries.md b/docs/C++-Standard-Libraries.md
index 0bb987def..c1725f202 100644
--- a/docs/C++-Standard-Libraries.md
+++ b/docs/C++-Standard-Libraries.md
@@ -1,4 +1,5 @@
# C++ Standard Libraries
+
There are two C++ standard libraries supported by Apple compilers.
The default for 10.8 and earlier is **libstdc++**, supported by Apple GCC
diff --git a/docs/Checksum_Deprecation.md b/docs/Checksum_Deprecation.md
index c86f3a1a3..3ef0d41ec 100644
--- a/docs/Checksum_Deprecation.md
+++ b/docs/Checksum_Deprecation.md
@@ -1,4 +1,5 @@
# MD5 and SHA-1 Deprecation
+
During early 2015 Homebrew started the process of deprecating _SHA1_ for package
integrity verification. Since then every formulae under the Homebrew organisation
has been moved onto _SHA256_ verification; this includes both source packages
diff --git a/docs/Common-Issues.md b/docs/Common-Issues.md
index 14f2836c4..8da622ab4 100644
--- a/docs/Common-Issues.md
+++ b/docs/Common-Issues.md
@@ -1,4 +1,5 @@
# Common Issues
+
This is a list of commonly encountered problems, known issues, and their solutions.
### `brew` complains about absence of "Command Line Tools"
diff --git a/docs/Custom-GCC-and-cross-compilers.md b/docs/Custom-GCC-and-cross-compilers.md
index 99b52c060..08a8b2b19 100644
--- a/docs/Custom-GCC-and-cross-compilers.md
+++ b/docs/Custom-GCC-and-cross-compilers.md
@@ -1,4 +1,5 @@
# Custom GCC and Cross Compilers
+
Homebrew depends on having an up-to-date version of Xcode because it comes with
specific versions of build tools e.g. `clang`.
diff --git a/docs/External-Commands.md b/docs/External-Commands.md
index b88ba3fa5..59622bd3a 100644
--- a/docs/External-Commands.md
+++ b/docs/External-Commands.md
@@ -1,4 +1,5 @@
# External Commands
+
Homebrew, like Git, supports *external commands*. This lets you create new commands that can be run like:
```shell
diff --git a/docs/Formula-Cookbook.md b/docs/Formula-Cookbook.md
index 69a47b211..9d02a0f9a 100644
--- a/docs/Formula-Cookbook.md
+++ b/docs/Formula-Cookbook.md
@@ -1,4 +1,5 @@
# 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.
## Homebrew Terminology
diff --git a/docs/Gems,-Eggs-and-Perl-Modules.md b/docs/Gems,-Eggs-and-Perl-Modules.md
index dfbdc224f..770d770f6 100644
--- a/docs/Gems,-Eggs-and-Perl-Modules.md
+++ b/docs/Gems,-Eggs-and-Perl-Modules.md
@@ -1,4 +1,5 @@
# Gems, Eggs and Perl Modules
+
On a fresh macOS installation there are three empty directories for
add-ons available to all users:
diff --git a/docs/Homebrew-and-Python.md b/docs/Homebrew-and-Python.md
index 0757b5d24..e2f59c322 100644
--- a/docs/Homebrew-and-Python.md
+++ b/docs/Homebrew-and-Python.md
@@ -1,4 +1,5 @@
# Python
+
This page describes how Python is handled in Homebrew for users. See [Python for Formula Authors](Python-for-Formula-Authors.md) for advice on writing formulae to install packages written in Python.
Homebrew should work with any [CPython](https://stackoverflow.com/questions/2324208/is-there-any-difference-between-cpython-and-python) and defaults to the macOS system Python.
diff --git a/docs/How-to-Create-and-Maintain-a-Tap.md b/docs/How-to-Create-and-Maintain-a-Tap.md
index ff7de8029..5c8f3a8c4 100644
--- a/docs/How-to-Create-and-Maintain-a-Tap.md
+++ b/docs/How-to-Create-and-Maintain-a-Tap.md
@@ -1,4 +1,5 @@
# How to Create and Maintain a Tap
+
Taps are external sources of Homebrew formulae and/or external commands. They
can be created by anyone to provide their own formulae and/or external commands
to any Homebrew user.
diff --git a/docs/Installation.md b/docs/Installation.md
index ff5649a72..dbe8b9917 100644
--- a/docs/Installation.md
+++ b/docs/Installation.md
@@ -1,4 +1,5 @@
# Installation
+
The suggested and easiest way to install Homebrew is on the
[homepage](http://brew.sh).
diff --git a/docs/Interesting-Taps-&-Forks.md b/docs/Interesting-Taps-&-Forks.md
index dcb860a23..a5c609441 100644
--- a/docs/Interesting-Taps-&-Forks.md
+++ b/docs/Interesting-Taps-&-Forks.md
@@ -1,4 +1,5 @@
# Interesting Taps & Forks
+
A Tap is homebrew-speak for a git repository containing extra formulae.
Homebrew has the capability to add (and remove) multiple taps to your local installation with the `brew tap` and `brew untap` command. Type `man brew` in your Terminal. The main repository https://github.com/Homebrew/homebrew-core, often called `homebrew/core`, is always built-in.
diff --git a/docs/Kickstarter-Supporters.md b/docs/Kickstarter-Supporters.md
index ae9556390..3f39b435c 100644
--- a/docs/Kickstarter-Supporters.md
+++ b/docs/Kickstarter-Supporters.md
@@ -1,4 +1,5 @@
# Kickstarter Supporters
+
This file contains a list of the awesome people who gave £5 or more to
[our Kickstarter](https://www.kickstarter.com/projects/homebrew/brew-test-bot).
diff --git a/docs/Maintainer-Guidelines.md b/docs/Maintainer-Guidelines.md
index d83118642..fdb7e88f9 100644
--- a/docs/Maintainer-Guidelines.md
+++ b/docs/Maintainer-Guidelines.md
@@ -1,4 +1,5 @@
# Maintainer Guidelines
+
**This guide is for maintainers.** These special people have **write
access** to Homebrew’s repository and help merge the contributions of
others. You may find what is written here interesting, but it’s
diff --git a/docs/Maintainers-Avoiding-Burnout.md b/docs/Maintainers-Avoiding-Burnout.md
index f3ba3e346..99353d946 100644
--- a/docs/Maintainers-Avoiding-Burnout.md
+++ b/docs/Maintainers-Avoiding-Burnout.md
@@ -1,4 +1,5 @@
# Maintainers: Avoiding Burnout
+
**This guide is for maintainers.** These special people have **write
access** to Homebrew’s repository and help merge the contributions of
others. You may find what is written here interesting, but it’s
diff --git a/docs/Migrating-A-Formula-To-A-Tap.md b/docs/Migrating-A-Formula-To-A-Tap.md
index 7bc984f84..ba5577056 100644
--- a/docs/Migrating-A-Formula-To-A-Tap.md
+++ b/docs/Migrating-A-Formula-To-A-Tap.md
@@ -1,4 +1,5 @@
# Migrating A Formula To A Tap
+
There are times when we may wish to migrate a formula from one tap into another tap. To do this:
1. Create a pull request to the new tap adding the formula file as-is from the original tap. Fix any test failures that may occur due to the stricter requirements for new formulae than existing formula (e.g. `brew audit --strict` must pass for that formula).
diff --git a/docs/New-Maintainer-Checklist.md b/docs/New-Maintainer-Checklist.md
index b1117ce9b..29c2d4ece 100644
--- a/docs/New-Maintainer-Checklist.md
+++ b/docs/New-Maintainer-Checklist.md
@@ -1,4 +1,5 @@
# New Maintainer Checklist
+
**This is a guide used by existing maintainers to invite new maintainers. You might find it interesting but there's nothing here users should have to know.**
So, there's someone who has been making consistently high-quality contributions to Homebrew for a long time and shown themselves able to make slightly more advanced contributions than just e.g. formula updates? Let's invite them to be a maintainer!
diff --git a/docs/Querying-Brew.md b/docs/Querying-Brew.md
index 70fe6bb06..6d37cb588 100644
--- a/docs/Querying-Brew.md
+++ b/docs/Querying-Brew.md
@@ -1,4 +1,5 @@
# Querying `brew`
+
_In this document we will be using [jq](https://stedolan.github.io/jq/) to parse JSON, available from Homebrew using `brew install jq`._
## Overview
diff --git a/docs/Versions.md b/docs/Versions.md
index 87bc9f566..9e679db7d 100644
--- a/docs/Versions.md
+++ b/docs/Versions.md
@@ -1,4 +1,5 @@
# Versions
+
Now that [Homebrew/versions](https://github.com/homebrew/homebrew-versions) has been deprecated [Homebrew/core](https://github.com/homebrew/homebrew-core) supports multiple versions of formulae with a new naming format.
In [Homebrew/versions](https://github.com/homebrew/homebrew-versions) the formula for GCC 6 was named `gcc6.rb` and began `class Gcc6 < Formula`. In [Homebrew/core](https://github.com/homebrew/homebrew-core) this same formula is named `gcc@6.rb` and begins `class GccAT6 < Formula`.
diff --git a/docs/brew-tap.md b/docs/brew-tap.md
index f73f1813e..15f8c7936 100644
--- a/docs/brew-tap.md
+++ b/docs/brew-tap.md
@@ -1,4 +1,5 @@
# Taps (third-party repositories)
+
`brew tap` adds more repos to the list of formulae that `brew` tracks, updates,
and installs from. By default, `tap` assumes that the repos come from GitHub,
but the command isn't limited to any one location.
--
cgit v1.2.3
From 4c061fc1833521b3e943de2e2d16029966cd7164 Mon Sep 17 00:00:00 2001
From: Alyssa Ross
Date: Thu, 5 Jan 2017 00:22:56 +0000
Subject: dependency: TapDependency#tap returns a Tap
Previously, this returned a String, but a Tap instance seems much more
sensible.
I couldn't find anywhere this method was actually used, so the change
shouldn't break anything.
---
Library/Homebrew/dependency.rb | 2 +-
Library/Homebrew/test/dependency_test.rb | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/Library/Homebrew/dependency.rb b/Library/Homebrew/dependency.rb
index 253ba4bee..4a452440a 100644
--- a/Library/Homebrew/dependency.rb
+++ b/Library/Homebrew/dependency.rb
@@ -175,7 +175,7 @@ class TapDependency < Dependency
attr_reader :tap
def initialize(name, tags = [], env_proc = DEFAULT_ENV_PROC, option_names = [name.split("/").last])
- @tap = name.rpartition("/").first
+ @tap = Tap.fetch(name.rpartition("/").first)
super(name, tags, env_proc, option_names)
end
diff --git a/Library/Homebrew/test/dependency_test.rb b/Library/Homebrew/test/dependency_test.rb
index 65255995e..134e91d13 100644
--- a/Library/Homebrew/test/dependency_test.rb
+++ b/Library/Homebrew/test/dependency_test.rb
@@ -118,6 +118,11 @@ class DependencyTests < Homebrew::TestCase
end
class TapDependencyTests < Homebrew::TestCase
+ def test_tap
+ dep = TapDependency.new("foo/bar/dog")
+ assert_equal Tap.new("foo", "bar"), dep.tap
+ end
+
def test_option_names
dep = TapDependency.new("foo/bar/dog")
assert_equal %w[dog], dep.option_names
--
cgit v1.2.3
From 536b6e2396042491068fda8536bfec5e38000985 Mon Sep 17 00:00:00 2001
From: Alyssa Ross
Date: Thu, 5 Jan 2017 00:24:49 +0000
Subject: uses: properly handle recursive deps exceptions
Fixes #1776.
If any known formula had a dependency on an untapped tap,
Formula#recursive_dependencies would throw an exception, which would be
caught by the outer exception handler, causing the rest of the
dependencies for that formula to be skipped and incomplete output to be
generated.
To fix this, I added a check to avoid analysing the dependencies of
formulae from uninstalled taps.
Additionally, I removed the aforementioned outer exception handler added
in 5fdb89aed90f03413cdb21af430411c4a722876e, because the only other
place that should be capable of throwing such an exception is the
statement that was surrounded by another wider exception handler in
Homebrew/legacy-homebrew#40682.
---
Library/Homebrew/cmd/uses.rb | 73 ++++++++++++++++++++++----------------------
1 file changed, 37 insertions(+), 36 deletions(-)
diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb
index fb11a31a7..f9af36754 100644
--- a/Library/Homebrew/cmd/uses.rb
+++ b/Library/Homebrew/cmd/uses.rb
@@ -47,48 +47,49 @@ module Homebrew
uses = formulae.select do |f|
used_formulae.all? do |ff|
- begin
- if recursive
- deps = f.recursive_dependencies do |dependent, dep|
- if dep.recommended?
- Dependency.prune if ignores.include?("recommended?") || dependent.build.without?(dep)
- elsif dep.optional?
- Dependency.prune if !includes.include?("optional?") && !dependent.build.with?(dep)
- elsif dep.build?
- Dependency.prune unless includes.include?("build?")
- end
+ if recursive
+ deps = f.recursive_dependencies do |dependent, dep|
+ if dep.recommended?
+ Dependency.prune if ignores.include?("recommended?") || dependent.build.without?(dep)
+ elsif dep.optional?
+ Dependency.prune if !includes.include?("optional?") && !dependent.build.with?(dep)
+ elsif dep.build?
+ Dependency.prune unless includes.include?("build?")
end
- reqs = f.recursive_requirements do |dependent, req|
- if req.recommended?
- Requirement.prune if ignores.include?("recommended?") || dependent.build.without?(req)
- elsif req.optional?
- Requirement.prune if !includes.include?("optional?") && !dependent.build.with?(req)
- elsif req.build?
- Requirement.prune unless includes.include?("build?")
- end
- end
- else
- deps = f.deps.reject do |dep|
- ignores.any? { |ignore| dep.send(ignore) } && !includes.any? { |include| dep.send(include) }
- end
- reqs = f.requirements.reject do |req|
- ignores.any? { |ignore| req.send(ignore) } && !includes.any? { |include| req.send(include) }
+
+ # If a tap isn't installed, we can't find the dependencies of one
+ # its formulae, and an exception will be thrown if we try.
+ if dep.is_a?(TapDependency) && !dep.tap.installed?
+ Dependency.keep_but_prune_recursive_deps
end
end
- next true if deps.any? do |dep|
- begin
- dep.to_formula.full_name == ff.full_name
- rescue
- dep.name == ff.name
+ reqs = f.recursive_requirements do |dependent, req|
+ if req.recommended?
+ Requirement.prune if ignores.include?("recommended?") || dependent.build.without?(req)
+ elsif req.optional?
+ Requirement.prune if !includes.include?("optional?") && !dependent.build.with?(req)
+ elsif req.build?
+ Requirement.prune unless includes.include?("build?")
end
end
-
- reqs.any? do |req|
- req.name == ff.name || [ff.name, ff.full_name].include?(req.default_formula)
+ else
+ deps = f.deps.reject do |dep|
+ ignores.any? { |ignore| dep.send(ignore) } && !includes.any? { |include| dep.send(include) }
+ end
+ reqs = f.requirements.reject do |req|
+ ignores.any? { |ignore| req.send(ignore) } && !includes.any? { |include| req.send(include) }
end
- rescue FormulaUnavailableError
- # Silently ignore this case as we don't care about things used in
- # taps that aren't currently tapped.
+ end
+ next true if deps.any? do |dep|
+ begin
+ dep.to_formula.full_name == ff.full_name
+ rescue
+ dep.name == ff.name
+ end
+ end
+
+ reqs.any? do |req|
+ req.name == ff.name || [ff.name, ff.full_name].include?(req.default_formula)
end
end
end
--
cgit v1.2.3
From cd18536eff0bbd1c499f70091ac68777a2a6cebe Mon Sep 17 00:00:00 2001
From: Shaun Jackman
Date: Wed, 11 May 2016 14:41:11 -0700
Subject: PerlRequirement: version number might not be wrapped in parentheses
For example:
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi
---
Library/Homebrew/requirements/perl_requirement.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Library/Homebrew/requirements/perl_requirement.rb b/Library/Homebrew/requirements/perl_requirement.rb
index 06e36ac0d..70eb2a36c 100644
--- a/Library/Homebrew/requirements/perl_requirement.rb
+++ b/Library/Homebrew/requirements/perl_requirement.rb
@@ -10,7 +10,7 @@ class PerlRequirement < Requirement
satisfy(build_env: false) do
which_all("perl").detect do |perl|
- perl_version = Utils.popen_read(perl, "--version")[/\(v(\d+\.\d+)(?:\.\d+)?\)/, 1]
+ perl_version = Utils.popen_read(perl, "--version")[/v(\d+\.\d+)(?:\.\d+)?/, 1]
next unless perl_version
Version.create(perl_version.to_s) >= Version.create(@version)
end
--
cgit v1.2.3
From e466a65b8dfc24ab21a49d37dcd2ca3c1ffe34f2 Mon Sep 17 00:00:00 2001
From: Alyssa Ross
Date: Thu, 5 Jan 2017 12:21:50 +0000
Subject: formula: correct grammar in comments
---
Library/Homebrew/formula.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index eb85f804f..46d30bfff 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -326,13 +326,13 @@ class Formula
active_spec.bottle_disable_reason
end
- # Does the currently active {SoftwareSpec} has any bottle?
+ # Does the currently active {SoftwareSpec} have any bottle?
# @private
def bottle_defined?
active_spec.bottle_defined?
end
- # Does the currently active {SoftwareSpec} has an installable bottle?
+ # Does the currently active {SoftwareSpec} have an installable bottle?
# @private
def bottled?
active_spec.bottled?
--
cgit v1.2.3
From 6c2b614a04e375eea81490e906fd80a975c76f65 Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Fri, 6 Jan 2017 08:50:20 +0000
Subject: pathname: make compute_disk_usage handle symlinks.
---
Library/Homebrew/extend/pathname.rb | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 976ea7dd8..cfb028704 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -26,11 +26,17 @@ module DiskUsageExtension
private
def compute_disk_usage
- if directory?
+ path = if symlink?
+ resolved_path
+ else
+ self
+ end
+
+ if path.directory?
scanned_files = Set.new
@file_count = 0
@disk_usage = 0
- find do |f|
+ path.find do |f|
if f.directory?
@disk_usage += f.lstat.size
else
@@ -47,7 +53,7 @@ module DiskUsageExtension
end
else
@file_count = 1
- @disk_usage = lstat.size
+ @disk_usage = path.lstat.size
end
end
end
--
cgit v1.2.3
From 1a4ff22447f73ddfda069453571bd91f8ebd367a Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Fri, 6 Jan 2017 08:50:35 +0000
Subject: formula: tweak versioned prefix approach.
---
Library/Homebrew/formula.rb | 40 +++++++++++++++++++---------------------
1 file changed, 19 insertions(+), 21 deletions(-)
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index cad8a693f..85add1b43 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -198,7 +198,7 @@ class Formula
@build = active_spec.build
@pin = FormulaPin.new(self)
@follow_installed_alias = true
- @versioned_prefix = false
+ @prefix_returns_versioned_prefix = false
end
# @private
@@ -553,11 +553,12 @@ class Formula
# called from within the same formula's {#install} or {#post_install} methods.
# Otherwise, return the full path to the formula's versioned cellar.
def prefix(v = pkg_version)
- prefix = FormulaPrefixPathname.new(rack/v)
- if !@versioned_prefix && prefix.directory? && Keg.new(prefix).optlinked?
+ versioned_prefix = versioned_prefix(v)
+ if !@prefix_returns_versioned_prefix && v == pkg_version &&
+ versioned_prefix.directory? && Keg.new(versioned_prefix).optlinked?
opt_prefix
else
- prefix
+ versioned_prefix
end
end
@@ -574,10 +575,7 @@ class Formula
# Is formula's linked keg points to the prefix.
def prefix_linked?(v = pkg_version)
return false unless linked?
- @versioned_prefix = true
- result = linked_keg.resolved_path == prefix(v)
- @versioned_prefix = false
- result
+ linked_keg.resolved_path == versioned_prefix(v)
end
# {PkgVersion} of the linked keg for the formula.
@@ -941,7 +939,7 @@ class Formula
# formula, as the path is stable even when the software is updated.
# args << "--with-readline=#{Formula["readline"].opt_prefix}" if build.with? "readline"
def opt_prefix
- FormulaPrefixPathname.new("#{HOMEBREW_PREFIX}/opt/#{name}")
+ Pathname.new("#{HOMEBREW_PREFIX}/opt/#{name}")
end
def opt_bin
@@ -1005,7 +1003,7 @@ class Formula
# @private
def run_post_install
- @versioned_prefix = true
+ @prefix_returns_versioned_prefix = true
build = self.build
self.build = Tab.for_formula(self)
old_tmpdir = ENV["TMPDIR"]
@@ -1020,7 +1018,7 @@ class Formula
ENV["TMPDIR"] = old_tmpdir
ENV["TEMP"] = old_temp
ENV["TMP"] = old_tmp
- @versioned_prefix = false
+ @prefix_returns_versioned_prefix = false
end
# Tell the user about any caveats regarding this package.
@@ -1123,7 +1121,7 @@ class Formula
# where staging is a Mktemp staging context
# @private
def brew
- @versioned_prefix = true
+ @prefix_returns_versioned_prefix = true
stage do |staging|
staging.retain! if ARGV.keep_tmp?
prepare_patches
@@ -1138,7 +1136,7 @@ class Formula
end
end
ensure
- @versioned_prefix = false
+ @prefix_returns_versioned_prefix = false
end
# @private
@@ -1640,7 +1638,7 @@ class Formula
# @private
def run_test
- @versioned_prefix = true
+ @prefix_returns_versioned_prefix = true
old_home = ENV["HOME"]
old_curl_home = ENV["CURL_HOME"]
old_tmpdir = ENV["TMPDIR"]
@@ -1672,7 +1670,7 @@ class Formula
ENV["TEMP"] = old_temp
ENV["TMP"] = old_tmp
ENV["TERM"] = old_term
- @versioned_prefix = false
+ @prefix_returns_versioned_prefix = false
end
# @private
@@ -1857,6 +1855,12 @@ class Formula
private
+ # Returns the prefix for a given formula version number.
+ # @private
+ def versioned_prefix(v)
+ rack/v
+ end
+
def exec_cmd(cmd, args, out, logfn)
ENV["HOMEBREW_CC_LOG_PATH"] = logfn
@@ -2426,10 +2430,4 @@ class Formula
@link_overwrite_paths ||= Set.new
end
end
-
- class FormulaPrefixPathname < Pathname
- def abv
- Pathname.new(realpath).abv
- end
- end
end
--
cgit v1.2.3
From 44971905937ddf3e7815f069694eb7d87a217f63 Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Fri, 6 Jan 2017 16:35:41 +0000
Subject: keg: use resolved_path not realpath.
This guards against this being a non-symlink in which case it will fail.
---
Library/Homebrew/keg.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index 59fed9ec3..4312c9454 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -598,7 +598,7 @@ class Keg
if src.symlink? || src.file?
Find.prune if File.basename(src) == ".DS_Store"
- Find.prune if src.realpath == dst
+ Find.prune if src.resolved_path == dst
# Don't link pyc or pyo files because Python overwrites these
# cached object files and next time brew wants to link, the
# file is in the way.
--
cgit v1.2.3
From 80b7d4c1aafc6eba51e6b167b1da13788714f4d4 Mon Sep 17 00:00:00 2001
From: Jan Viljanen
Date: Fri, 6 Jan 2017 12:02:10 +0100
Subject: Whitelist PHP formulas in shadowed header audit check
---
Library/Homebrew/extend/os/mac/formula_cellar_checks.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb b/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb
index 8bc42ad35..5b1c648bf 100644
--- a/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb
+++ b/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb
@@ -6,6 +6,8 @@ module FormulaCellarChecks
formula.name.start_with?(formula_name)
end
+ return if formula.name =~ /^php\d+$/
+
return if MacOS.version < :mavericks && formula.name.start_with?("postgresql")
return if MacOS.version < :yosemite && formula.name.start_with?("memcached")
--
cgit v1.2.3
From f814ee87fbfd6434393bd3e606194eaad96d82e6 Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Sat, 7 Jan 2017 09:52:01 +0000
Subject: Revert "cc: always filter flags on deps."
---
Library/Homebrew/shims/super/cc | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/Library/Homebrew/shims/super/cc b/Library/Homebrew/shims/super/cc
index 1400788ba..b0ea705e8 100755
--- a/Library/Homebrew/shims/super/cc
+++ b/Library/Homebrew/shims/super/cc
@@ -206,6 +206,10 @@ class Cmd
end
def keep?(path)
+ # The logic in this method will eventually become the default,
+ # but is currently opt-in.
+ return keep_orig?(path) unless ENV["HOMEBREW_EXPERIMENTAL_FILTER_FLAGS_ON_DEPS"]
+
# Allow references to self
if formula_prefix && path.start_with?("#{formula_prefix}/")
true
@@ -222,6 +226,11 @@ class Cmd
end
end
+ # The original less-smart version of keep_orig; will eventually be removed
+ def keep_orig?(path)
+ path.start_with?(prefix, cellar, tmpdir) || !path.start_with?("/opt/local", "/opt/boxen/homebrew", "/opt/X11", "/sw", "/usr/X11")
+ end
+
def cflags
args = []
--
cgit v1.2.3
From 2aac904eac522a4d746a852ecc244509f5cfdafa Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Sat, 7 Jan 2017 13:02:09 +0000
Subject: docs/README: link to Versions.md.
---
docs/README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/README.md b/docs/README.md
index 0e3e0f0fd..ec7564733 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -27,6 +27,7 @@
- [How To Open A Pull Request (and get it merged)](How-To-Open-a-Homebrew-Pull-Request.md)
- [Formula Cookbook](Formula-Cookbook.md)
- [Acceptable Formulae](Acceptable-Formulae.md)
+- [Formulae Versions](Versions.md)
- [Node for Formula Authors](Node-for-Formula-Authors.md)
- [Python for Formula Authors](Python-for-Formula-Authors.md)
- [Migrating A Formula To A Tap](Migrating-A-Formula-To-A-Tap.md)
--
cgit v1.2.3
From dc9819b86c60b5c6fd10373ff318d8ef60f97d52 Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Sat, 7 Jan 2017 13:15:18 +0000
Subject: Revert "uses: properly handle untapped formulae in recursive
dependency expansion"
---
Library/Homebrew/cmd/uses.rb | 73 ++++++++++++++++----------------
Library/Homebrew/dependency.rb | 2 +-
Library/Homebrew/test/dependency_test.rb | 5 ---
3 files changed, 37 insertions(+), 43 deletions(-)
diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb
index f9af36754..fb11a31a7 100644
--- a/Library/Homebrew/cmd/uses.rb
+++ b/Library/Homebrew/cmd/uses.rb
@@ -47,49 +47,48 @@ module Homebrew
uses = formulae.select do |f|
used_formulae.all? do |ff|
- if recursive
- deps = f.recursive_dependencies do |dependent, dep|
- if dep.recommended?
- Dependency.prune if ignores.include?("recommended?") || dependent.build.without?(dep)
- elsif dep.optional?
- Dependency.prune if !includes.include?("optional?") && !dependent.build.with?(dep)
- elsif dep.build?
- Dependency.prune unless includes.include?("build?")
+ begin
+ if recursive
+ deps = f.recursive_dependencies do |dependent, dep|
+ if dep.recommended?
+ Dependency.prune if ignores.include?("recommended?") || dependent.build.without?(dep)
+ elsif dep.optional?
+ Dependency.prune if !includes.include?("optional?") && !dependent.build.with?(dep)
+ elsif dep.build?
+ Dependency.prune unless includes.include?("build?")
+ end
end
-
- # If a tap isn't installed, we can't find the dependencies of one
- # its formulae, and an exception will be thrown if we try.
- if dep.is_a?(TapDependency) && !dep.tap.installed?
- Dependency.keep_but_prune_recursive_deps
+ reqs = f.recursive_requirements do |dependent, req|
+ if req.recommended?
+ Requirement.prune if ignores.include?("recommended?") || dependent.build.without?(req)
+ elsif req.optional?
+ Requirement.prune if !includes.include?("optional?") && !dependent.build.with?(req)
+ elsif req.build?
+ Requirement.prune unless includes.include?("build?")
+ end
end
- end
- reqs = f.recursive_requirements do |dependent, req|
- if req.recommended?
- Requirement.prune if ignores.include?("recommended?") || dependent.build.without?(req)
- elsif req.optional?
- Requirement.prune if !includes.include?("optional?") && !dependent.build.with?(req)
- elsif req.build?
- Requirement.prune unless includes.include?("build?")
+ else
+ deps = f.deps.reject do |dep|
+ ignores.any? { |ignore| dep.send(ignore) } && !includes.any? { |include| dep.send(include) }
+ end
+ reqs = f.requirements.reject do |req|
+ ignores.any? { |ignore| req.send(ignore) } && !includes.any? { |include| req.send(include) }
end
end
- else
- deps = f.deps.reject do |dep|
- ignores.any? { |ignore| dep.send(ignore) } && !includes.any? { |include| dep.send(include) }
- end
- reqs = f.requirements.reject do |req|
- ignores.any? { |ignore| req.send(ignore) } && !includes.any? { |include| req.send(include) }
- end
- end
- next true if deps.any? do |dep|
- begin
- dep.to_formula.full_name == ff.full_name
- rescue
- dep.name == ff.name
+ next true if deps.any? do |dep|
+ begin
+ dep.to_formula.full_name == ff.full_name
+ rescue
+ dep.name == ff.name
+ end
end
- end
- reqs.any? do |req|
- req.name == ff.name || [ff.name, ff.full_name].include?(req.default_formula)
+ reqs.any? do |req|
+ req.name == ff.name || [ff.name, ff.full_name].include?(req.default_formula)
+ end
+ rescue FormulaUnavailableError
+ # Silently ignore this case as we don't care about things used in
+ # taps that aren't currently tapped.
end
end
end
diff --git a/Library/Homebrew/dependency.rb b/Library/Homebrew/dependency.rb
index 4a452440a..253ba4bee 100644
--- a/Library/Homebrew/dependency.rb
+++ b/Library/Homebrew/dependency.rb
@@ -175,7 +175,7 @@ class TapDependency < Dependency
attr_reader :tap
def initialize(name, tags = [], env_proc = DEFAULT_ENV_PROC, option_names = [name.split("/").last])
- @tap = Tap.fetch(name.rpartition("/").first)
+ @tap = name.rpartition("/").first
super(name, tags, env_proc, option_names)
end
diff --git a/Library/Homebrew/test/dependency_test.rb b/Library/Homebrew/test/dependency_test.rb
index 134e91d13..65255995e 100644
--- a/Library/Homebrew/test/dependency_test.rb
+++ b/Library/Homebrew/test/dependency_test.rb
@@ -118,11 +118,6 @@ class DependencyTests < Homebrew::TestCase
end
class TapDependencyTests < Homebrew::TestCase
- def test_tap
- dep = TapDependency.new("foo/bar/dog")
- assert_equal Tap.new("foo", "bar"), dep.tap
- end
-
def test_option_names
dep = TapDependency.new("foo/bar/dog")
assert_equal %w[dog], dep.option_names
--
cgit v1.2.3
From e7a81caaf4bc0468fdc302656efebd584e10a3f6 Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Sat, 7 Jan 2017 14:03:08 +0000
Subject: Allow `brew audit` to fake a Safari user-agent.
This allows us to detect if homepages such as e.g. `aiccu` which
blocks `curl` are up or not.
---
Library/Homebrew/dev-cmd/audit.rb | 6 +++---
Library/Homebrew/global.rb | 1 +
Library/Homebrew/utils/curl.rb | 5 ++++-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 601031d6e..6d43c51bf 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -169,7 +169,7 @@ class FormulaAuditor
@specs = %w[stable devel head].map { |s| formula.send(s) }.compact
end
- def url_status_code(url, range: false)
+ def url_status_code(url, range: false, user_agent: :default)
# The system Curl is too old and unreliable with HTTPS homepages on
# Yosemite and below.
return "200" unless DevelopmentTools.curl_handles_most_https_homepages?
@@ -185,7 +185,7 @@ class FormulaAuditor
args = curl_args(
extra_args: extra_args,
show_output: true,
- default_user_agent: true
+ user_agent: user_agent
)
retries = 3
status_code = nil
@@ -597,7 +597,7 @@ class FormulaAuditor
return unless @online
- status_code = url_status_code(homepage)
+ status_code = url_status_code(homepage, user_agent: :browser)
return if status_code.start_with? "20"
problem "The homepage #{homepage} is not reachable (HTTP status code #{status_code})"
end
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb
index 9a2f0c794..031178421 100644
--- a/Library/Homebrew/global.rb
+++ b/Library/Homebrew/global.rb
@@ -26,6 +26,7 @@ RUBY_BIN = RUBY_PATH.dirname
HOMEBREW_USER_AGENT_CURL = ENV["HOMEBREW_USER_AGENT_CURL"]
HOMEBREW_USER_AGENT_RUBY = "#{ENV["HOMEBREW_USER_AGENT"]} ruby/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}".freeze
+HOMEBREW_USER_AGENT_FAKE_SAFARI = "Mozilla/5.0 (#{ENV["HOMEBREW_SYSTEM"]}; #{ENV["HOMEBREW_PROCESSOR"]} #{ENV["HOMEBREW_OS_VERSION"]}) AppleWebKit/602.3.12 (KHTML, like Gecko) Version/10.0.2 Safari/602.3.12".freeze
require "tap_constants"
diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb
index eab623c40..5a40ae846 100644
--- a/Library/Homebrew/utils/curl.rb
+++ b/Library/Homebrew/utils/curl.rb
@@ -12,7 +12,10 @@ def curl_args(options = {})
"--location",
]
- unless options[:default_user_agent]
+ case options[:user_agent]
+ when :browser
+ args << "--user-agent" << HOMEBREW_USER_AGENT_FAKE_SAFARI
+ else
args << "--user-agent" << HOMEBREW_USER_AGENT_CURL
end
--
cgit v1.2.3
From 6b63abb850a4478199e39327464dc014b632a9f1 Mon Sep 17 00:00:00 2001
From: William Woodruff
Date: Sat, 7 Jan 2017 15:06:46 -0500
Subject: keg_relocate: Check HOMEBREW_TEMP's realpath when excluding name
changes.
Since /tmp (the default HOMEBREW_TEMP) is a symlink to /private/tmp,
some build systems (like Parrot's) will attempt to use the realpath
instead of the literal /tmp we supply it with. This breaks the relocation
code, which only tested the literal HOMEBREW_TEMP and not its realpath.
---
Library/Homebrew/extend/os/mac/keg_relocate.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb
index 8f73daba5..f44a97b31 100644
--- a/Library/Homebrew/extend/os/mac/keg_relocate.rb
+++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb
@@ -6,7 +6,9 @@ class Keg
each_install_name_for(file) do |bad_name|
# Don't fix absolute paths unless they are rooted in the build directory
- next if bad_name.start_with?("/") && !bad_name.start_with?(HOMEBREW_TEMP.to_s)
+ next if bad_name.start_with?("/") &&
+ !bad_name.start_with?(HOMEBREW_TEMP.to_s) &&
+ !bad_name.start_with?(HOMEBREW_TEMP.realpath.to_s)
new_name = fixed_name(file, bad_name)
change_install_name(bad_name, new_name, file) unless new_name == bad_name
--
cgit v1.2.3
From 335be35acf805a2853a6fe92b06d9a643616f463 Mon Sep 17 00:00:00 2001
From: Masayuki Morita
Date: Sun, 8 Jan 2017 16:44:54 +0900
Subject: Generalize GitHubReleaseDownloadStrategy in order to support archive
URL
---
Library/Homebrew/download_strategy.rb | 81 ++++++++++++++++-------
Library/Homebrew/test/download_strategies_test.rb | 45 ++++++++++---
2 files changed, 93 insertions(+), 33 deletions(-)
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 19af8820c..3e028949b 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -532,42 +532,78 @@ class S3DownloadStrategy < CurlDownloadStrategy
end
end
-# GitHubReleaseDownloadStrategy downloads tarballs from GitHub Release assets.
-# To use it, add ":using => GitHubReleaseDownloadStrategy" 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 GitHubReleaseDownloadStrategy < CurlDownloadStrategy
- require "utils/formatter"
- require 'utils/github'
-
+# 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
def initialize(name, resource)
super
+ set_github_token
+ parse_url_pattern
+ 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"]
- raise CurlDownloadStrategyError, "Environmental variable HOMEBREW_GITHUB_API_TOKEN is required." unless @github_token
+ unless @github_token
+ raise CurlDownloadStrategyError, "Environmental variable HOMEBREW_GITHUB_API_TOKEN is required."
+ end
+ end
+end
- url_pattern = %r|https://github.com/(\S+)/(\S+)/releases/download/(\S+)/(\S+)|
- raise CurlDownloadStrategyError, "Invalid url pattern for GitHub Release." unless @url =~ url_pattern
+# 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
+ require "utils/formatter"
+ require 'utils/github'
+
+ 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
- puts "Download asset_id: #{asset_id}"
# HTTP request header `Accept: application/octet-stream` is required.
# Without this, the GitHub API will respond with metadata, not binary.
- curl asset_url, "-C", downloaded_size, "-o", temporary_path, "-H", 'Accept: application/octet-stream'
+ curl download_url, "-C", downloaded_size, "-o", temporary_path, "-H", 'Accept: application/octet-stream'
end
private
- def asset_url
- "https://#{@github_token}@api.github.com/repos/#{@owner}/#{@repo}/releases/assets/#{asset_id}"
- end
-
def asset_id
@asset_id ||= resolve_asset_id
end
@@ -580,11 +616,8 @@ class GitHubReleaseDownloadStrategy < CurlDownloadStrategy
return assets.first["id"]
end
- def release_url
- "https://api.github.com/repos/#{@owner}/#{@repo}/releases/tags/#{@tag}"
- end
-
def fetch_release_metadata
+ release_url = "https://api.github.com/repos/#{@owner}/#{@repo}/releases/tags/#{@tag}"
GitHub.open(release_url)
end
end
diff --git a/Library/Homebrew/test/download_strategies_test.rb b/Library/Homebrew/test/download_strategies_test.rb
index e69bdfda2..21f7e6906 100644
--- a/Library/Homebrew/test/download_strategies_test.rb
+++ b/Library/Homebrew/test/download_strategies_test.rb
@@ -61,25 +61,47 @@ class VCSDownloadStrategyTests < Homebrew::TestCase
end
end
-class GitHubReleaseDownloadStrategyTests < Homebrew::TestCase
+class GitHubPrivateRepositoryDownloadStrategyTests < Homebrew::TestCase
def setup
- resource = ResourceDouble.new("https://github.com/owner/repo/releases/download/tag/foo_v0.1.0_darwin_amd64.tar.gz")
+ resource = ResourceDouble.new("https://github.com/owner/repo/archive/1.1.5.tar.gz")
ENV["HOMEBREW_GITHUB_API_TOKEN"] = "token"
- @strategy = GitHubReleaseDownloadStrategy.new("foo", resource)
+ @strategy = GitHubPrivateRepositoryDownloadStrategy.new("foo", resource)
end
- def test_initialize
+ 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"
+ @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_asset_url
+ 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.send(:asset_url)
+ assert_equal expected, @strategy.download_url
end
def test_resolve_asset_id
@@ -99,9 +121,14 @@ class GitHubReleaseDownloadStrategyTests < Homebrew::TestCase
assert_equal 456, @strategy.send(:resolve_asset_id)
end
- def test_release_url
- expected = "https://api.github.com/repos/owner/repo/releases/tags/tag"
- assert_equal expected, @strategy.send(:release_url)
+ 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
--
cgit v1.2.3
From 560d5bdd7101d4e73f6501b5ac1601b0a434cece Mon Sep 17 00:00:00 2001
From: Masayuki Morita
Date: Sun, 8 Jan 2017 18:00:31 +0900
Subject: Validate a token when initializing
GitHubPrivateRepositoryDownloadStrategy
---
Library/Homebrew/download_strategy.rb | 24 +++++++++++++++++++----
Library/Homebrew/test/download_strategies_test.rb | 2 ++
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 3e028949b..d22ab9550 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -541,10 +541,13 @@ end
# 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
- set_github_token
parse_url_pattern
+ set_github_token
end
def parse_url_pattern
@@ -571,6 +574,22 @@ class GitHubPrivateRepositoryDownloadStrategy < CurlDownloadStrategy
unless @github_token
raise CurlDownloadStrategyError, "Environmental variable HOMEBREW_GITHUB_API_TOKEN is required."
end
+ validate_github_repository_access!
+ end
+
+ def validate_github_repository_access!
+ begin
+ # 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
end
@@ -580,9 +599,6 @@ end
# 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
- require "utils/formatter"
- require 'utils/github'
-
def parse_url_pattern
url_pattern = %r|https://github.com/([^/]+)/([^/]+)/releases/download/([^/]+)/(\S+)|
unless @url =~ url_pattern
diff --git a/Library/Homebrew/test/download_strategies_test.rb b/Library/Homebrew/test/download_strategies_test.rb
index 21f7e6906..ff4cbbf7a 100644
--- a/Library/Homebrew/test/download_strategies_test.rb
+++ b/Library/Homebrew/test/download_strategies_test.rb
@@ -65,6 +65,7 @@ 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
@@ -88,6 +89,7 @@ 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
--
cgit v1.2.3
From 12b9cb7f4c5e0927cb1049db4f1aa53fbe371a6d Mon Sep 17 00:00:00 2001
From: Masayuki Morita
Date: Sun, 8 Jan 2017 18:29:20 +0900
Subject: Fix rubocop style warning of download_strategy
---
Library/Homebrew/download_strategy.rb | 34 +++++++++++------------
Library/Homebrew/test/download_strategies_test.rb | 2 +-
2 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index d22ab9550..bd036067d 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -542,7 +542,7 @@ end
# works with public one, but in that case simply use CurlDownloadStrategy.
class GitHubPrivateRepositoryDownloadStrategy < CurlDownloadStrategy
require "utils/formatter"
- require 'utils/github'
+ require "utils/github"
def initialize(name, resource)
super
@@ -551,12 +551,12 @@ class GitHubPrivateRepositoryDownloadStrategy < CurlDownloadStrategy
end
def parse_url_pattern
- url_pattern = %r|https://github.com/([^/]+)/([^/]+)/(\S+)|
+ 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))
+ _, @owner, @repo, @filepath = *@url.match(url_pattern)
end
def download_url
@@ -578,18 +578,16 @@ class GitHubPrivateRepositoryDownloadStrategy < CurlDownloadStrategy
end
def validate_github_repository_access!
- begin
- # 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
+ # 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
+ EOS
+ raise CurlDownloadStrategyError, message
end
end
@@ -600,12 +598,12 @@ end
# 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+)|
+ 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))
+ _, @owner, @repo, @tag, @filename = *@url.match(url_pattern)
end
def download_url
@@ -615,7 +613,7 @@ class GitHubPrivateRepositoryReleaseDownloadStrategy < GitHubPrivateRepositoryDo
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'
+ curl download_url, "-C", downloaded_size, "-o", temporary_path, "-H", "Accept: application/octet-stream"
end
private
@@ -626,10 +624,10 @@ class GitHubPrivateRepositoryReleaseDownloadStrategy < GitHubPrivateRepositoryDo
def resolve_asset_id
release_metadata = fetch_release_metadata
- assets = release_metadata["assets"].select{ |a| a["name"] == @filename }
+ assets = release_metadata["assets"].select { |a| a["name"] == @filename }
raise CurlDownloadStrategyError, "Asset file not found." if assets.empty?
- return assets.first["id"]
+ assets.first["id"]
end
def fetch_release_metadata
diff --git a/Library/Homebrew/test/download_strategies_test.rb b/Library/Homebrew/test/download_strategies_test.rb
index ff4cbbf7a..2b64abbf9 100644
--- a/Library/Homebrew/test/download_strategies_test.rb
+++ b/Library/Homebrew/test/download_strategies_test.rb
@@ -117,7 +117,7 @@ class GitHubPrivateRepositoryReleaseDownloadStrategyTests < Homebrew::TestCase
"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)
--
cgit v1.2.3
From c276a44ebae578bdbd3048916f2a90ae20e72dd1 Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Mon, 9 Jan 2017 12:16:55 +0000
Subject: bump-formula-pr: check for URL presence.
If it's not there, produce a nicer error.
Fixes #1805.
---
Library/Homebrew/dev-cmd/bump-formula-pr.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
index 8fdbd97b6..68bf32d0b 100644
--- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb
+++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
@@ -124,6 +124,8 @@ module Homebrew
false
elsif !hash_type
odie "#{formula}: no tag/revision specified!"
+ elsif !new_url
+ odie "#{formula}: no url specified!"
else
rsrc_url = if requested_spec != :devel && new_url =~ /.*ftpmirror.gnu.*/
new_mirror = new_url.sub "ftpmirror.gnu.org", "ftp.gnu.org/gnu"
--
cgit v1.2.3
From 346d68eb04013d2322796ed1a0edd7de007a156d Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Mon, 9 Jan 2017 13:24:51 +0000
Subject: audit: check virtualenv and setuptools resource.
`virtualenv_install_with_resources` will automatically define and
install a `setuptools` resource so this is unnecessary.
References https://github.com/Homebrew/homebrew-core/pull/8570
---
Library/Homebrew/dev-cmd/audit.rb | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 6d43c51bf..744aa6fbe 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -819,6 +819,11 @@ class FormulaAuditor
problem "Formulae should not depend on both OpenSSL and LibreSSL (even optionally)."
end
+ if text =~ /virtualenv_(create|install_with_resources)/ &&
+ text =~ /resource\s+['"]setuptools['"]\s+do/
+ problem "Formulae using virtualenvs do not need a `setuptools` resource."
+ end
+
return unless text.include?('require "language/go"') && !text.include?("go_resource")
problem "require \"language/go\" is unnecessary unless using `go_resource`s"
end
--
cgit v1.2.3
From f5b63f4a8dd3e22ffc405a1a6119a961f8332578 Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Mon, 9 Jan 2017 12:31:00 +0000
Subject: Deprecate brew (un)linkapps.
Unfortunately `brew linkapps` cannot behave nicely with e.g. Spotlight
using either aliases or symlinks and Homebrew formulae do not build
"proper" `.app` bundles that can be relocated. Instead, please consider
using `brew cask` and migrate formulae using `.app`s to casks.
---
Library/Homebrew/cmd/linkapps.rb | 16 +++++++++++++++-
Library/Homebrew/cmd/unlinkapps.rb | 13 ++++++++++++-
docs/brew.1.html | 14 ++++++++++++--
manpages/brew.1 | 10 ++++++++--
4 files changed, 47 insertions(+), 6 deletions(-)
diff --git a/Library/Homebrew/cmd/linkapps.rb b/Library/Homebrew/cmd/linkapps.rb
index bd88409aa..7dd1a6b93 100644
--- a/Library/Homebrew/cmd/linkapps.rb
+++ b/Library/Homebrew/cmd/linkapps.rb
@@ -1,6 +1,11 @@
#: * `linkapps` [`--local`] [If --force is passed, Homebrew will allow keg-only formulae to be linked.
linkapps [--local] [formulae]Find installed formulae that provide .app-style macOS apps and symlink them
-into /Applications, allowing for easier access.
/Applications, allowing for easier access (deprecated).
+
+Unfortunately brew linkapps cannot behave nicely with e.g. Spotlight using
+either aliases or symlinks and Homebrew formulae do not build "proper" .app
+bundles that can be relocated. Instead, please consider using brew cask and
+migrate formulae using .apps to casks.
If no formulae are provided, all of them will have their apps symlinked.
@@ -369,7 +374,12 @@ for temporarily disabling a formula:If --dry-run or -n is passed, Homebrew will list all files which would
be unlinked, but will not actually unlink or delete any files.
unlinkapps [--local] [--dry-run] [formulae]Remove symlinks created by brew linkapps from /Applications.
unlinkapps [--local] [--dry-run] [formulae]Remove symlinks created by brew linkapps from /Applications (deprecated).
Unfortunately brew linkapps cannot behave nicely with e.g. Spotlight using
+either aliases or symlinks and Homebrew formulae do not build "proper" .app
+bundles that can be relocated. Instead, please consider using brew cask and
+migrate formulae using .apps to casks.
If no formulae are provided, all linked apps will be removed.
diff --git a/manpages/brew.1 b/manpages/brew.1 index c9269e7b3..aa1d1c1d0 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -294,7 +294,10 @@ If \fB\-\-force\fR is passed, Homebrew will allow keg\-only formulae to be linke . .TP \fBlinkapps\fR [\fB\-\-local\fR] [\fIformulae\fR] -Find installed formulae that provide \fB\.app\fR\-style macOS apps and symlink them into \fB/Applications\fR, allowing for easier access\. +Find installed formulae that provide \fB\.app\fR\-style macOS apps and symlink them into \fB/Applications\fR, allowing for easier access (deprecated)\. +. +.IP +Unfortunately \fBbrew linkapps\fR cannot behave nicely with e\.g\. Spotlight using either aliases or symlinks and Homebrew formulae do not build "proper" \fB\.app\fR bundles that can be relocated\. Instead, please consider using \fBbrew cask\fR and migrate formulae using \fB\.app\fRs to casks\. . .IP If no \fIformulae\fR are provided, all of them will have their apps symlinked\. @@ -508,7 +511,10 @@ If \fB\-\-dry\-run\fR or \fB\-n\fR is passed, Homebrew will list all files which . .TP \fBunlinkapps\fR [\fB\-\-local\fR] [\fB\-\-dry\-run\fR] [\fIformulae\fR] -Remove symlinks created by \fBbrew linkapps\fR from \fB/Applications\fR\. +Remove symlinks created by \fBbrew linkapps\fR from \fB/Applications\fR (deprecated)\. +. +.IP +Unfortunately \fBbrew linkapps\fR cannot behave nicely with e\.g\. Spotlight using either aliases or symlinks and Homebrew formulae do not build "proper" \fB\.app\fR bundles that can be relocated\. Instead, please consider using \fBbrew cask\fR and migrate formulae using \fB\.app\fRs to casks\. . .IP If no \fIformulae\fR are provided, all linked apps will be removed\. -- cgit v1.2.3 From c0a29d664420bb568036f8e92654cf5e0b73da3e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 9 Jan 2017 13:33:56 +0000 Subject: caveats, keg: remove linkapps caveats code. --- Library/Homebrew/caveats.rb | 11 ----------- Library/Homebrew/keg.rb | 4 ---- 2 files changed, 15 deletions(-) diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb index 3dfdb1c87..d1dda9d4c 100644 --- a/Library/Homebrew/caveats.rb +++ b/Library/Homebrew/caveats.rb @@ -23,7 +23,6 @@ class Caveats caveats << fish_function_caveats caveats << plist_caveats caveats << python_caveats - caveats << app_caveats caveats << elisp_caveats caveats.compact.join("\n") end @@ -169,16 +168,6 @@ class Caveats s end - def app_caveats - return unless keg - return unless keg.app_installed? - - <<-EOS.undent - .app bundles were installed. - Run `brew linkapps #{keg.name}` to symlink these to /Applications. - EOS - end - def elisp_caveats return if f.keg_only? return unless keg diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index 4312c9454..14eb0e3f3 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -367,10 +367,6 @@ class Keg Pathname.glob("#{app_prefix}/{,libexec/}*.app") end - def app_installed? - !apps.empty? - end - def elisp_installed? return false unless (path/"share/emacs/site-lisp"/name).exist? (path/"share/emacs/site-lisp"/name).children.any? { |f| %w[.el .elc].include? f.extname } -- cgit v1.2.3 From 28ad8a06cc24d2d71400e9c860a52ef046022cf1 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 9 Jan 2017 21:03:37 +0000 Subject: formula: return runtime_dependencies in to_hash. Which, in turn, provides it for `brew info --json=v1` so other tools such as e.g. `brew bundle` can make use of this information. --- Library/Homebrew/formula.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index e6312ccdb..91a3e8150 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1618,6 +1618,7 @@ class Formula "used_options" => tab.used_options.as_flags, "built_as_bottle" => tab.built_as_bottle, "poured_from_bottle" => tab.poured_from_bottle, + "runtime_dependencies" => tab.runtime_dependencies, } end -- cgit v1.2.3 From d8adae0f92fcf6685d8fc8a1a44e6a11db30fac0 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 9 Jan 2017 21:42:09 +0000 Subject: formulary: read from formula in opt prefix. We want to prefer the newer/versioned formulae when possible but this is preferable to a random cached formula or, worse, no formula. This means `brew info foo` will never complain that `foo` is a missing formula. --- Library/Homebrew/formulary.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index fadd89457..25df57cdc 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -380,6 +380,11 @@ class Formulary return TapLoader.new(possible_tap_newname_formulae.first, from: from) end + possible_keg_formula = Pathname.new("#{HOMEBREW_PREFIX}/opt/#{ref}/.brew/#{ref}.rb") + if possible_keg_formula.file? + return FormulaLoader.new(ref, possible_keg_formula) + end + possible_cached_formula = Pathname.new("#{HOMEBREW_CACHE_FORMULA}/#{ref}.rb") if possible_cached_formula.file? return FormulaLoader.new(ref, possible_cached_formula) -- cgit v1.2.3 From 4a39070c268b6dba063b938d8663c70f60311230 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 9 Jan 2017 21:30:41 +0000 Subject: xquartz: use default location when possible. Xcode can be installed anywhere but for most people it's in `/Applications/Xcode.app` so just look there by default before looking at Spotlight which can return weird results on e.g. backup disks. --- Library/Homebrew/os/mac/xquartz.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Library/Homebrew/os/mac/xquartz.rb b/Library/Homebrew/os/mac/xquartz.rb index 674e50c50..b82772faf 100644 --- a/Library/Homebrew/os/mac/xquartz.rb +++ b/Library/Homebrew/os/mac/xquartz.rb @@ -5,6 +5,8 @@ module OS module XQuartz module_function + # TODO: confirm this path when you have internet + DEFAULT_BUNDLE_PATH = Pathname.new("Applications/Utilities/XQuartz.app").freeze FORGE_BUNDLE_ID = "org.macosforge.xquartz.X11".freeze APPLE_BUNDLE_ID = "org.x.X11".freeze FORGE_PKG_ID = "org.macosforge.xquartz.pkg".freeze @@ -56,6 +58,11 @@ module OS end def bundle_path + # Use the default location if it exists. + return DEFAULT_BUNDLE_PATH if DEFAULT_BUNDLE_PATH.exist? + + # Ask Spotlight where XQuartz is. If the user didn't install XQuartz + # in the conventional place, this is our only option. MacOS.app_with_bundle_id(FORGE_BUNDLE_ID, APPLE_BUNDLE_ID) end -- cgit v1.2.3 From 2c6915a48fb1456b8075d95735dc2032e23ef210 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 9 Jan 2017 21:30:20 +0000 Subject: xcode: general cleanup. --- Library/Homebrew/os/mac/xcode.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index 8e51fc6b6..d13c98b88 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -3,8 +3,8 @@ module OS module Xcode module_function - V4_BUNDLE_ID = "com.apple.dt.Xcode".freeze - V3_BUNDLE_ID = "com.apple.Xcode".freeze + BUNDLE_ID = "com.apple.dt.Xcode".freeze + OLD_BUNDLE_ID = "com.apple.Xcode".freeze def latest_version case MacOS.version @@ -51,9 +51,9 @@ module OS begin dir = MacOS.active_developer_dir - if dir.empty? || dir == CLT::MAVERICKS_PKG_PATH || !File.directory?(dir) + if dir.empty? || dir == CLT::PKG_PATH || !File.directory?(dir) path = bundle_path - path.join("Contents", "Developer") if path + path/"Contents/Developer" if path else # Use cleanpath to avoid pathological trailing slash Pathname.new(dir).cleanpath @@ -182,7 +182,7 @@ module OS FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI".freeze MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables".freeze MAVERICKS_NEW_PKG_ID = "com.apple.pkg.CLTools_Base".freeze # obsolete - MAVERICKS_PKG_PATH = "/Library/Developer/CommandLineTools".freeze + PKG_PATH = "/Library/Developer/CommandLineTools".freeze # Returns true even if outdated tools are installed, e.g. # tools from Xcode 4.x on 10.9 @@ -237,7 +237,7 @@ module OS return false if MacOS.version < :lion if MacOS.version >= :mavericks - version = Utils.popen_read("#{MAVERICKS_PKG_PATH}/usr/bin/clang --version") + version = Utils.popen_read("#{PKG_PATH}/usr/bin/clang --version") else version = Utils.popen_read("/usr/bin/clang --version") end @@ -261,7 +261,7 @@ module OS [MAVERICKS_PKG_ID, MAVERICKS_NEW_PKG_ID, STANDALONE_PKG_ID, FROM_XCODE_PKG_ID].find do |id| if MacOS.version >= :mavericks - next unless File.exist?("#{MAVERICKS_PKG_PATH}/usr/bin/clang") + next unless File.exist?("#{PKG_PATH}/usr/bin/clang") end version = MacOS.pkgutil_info(id)[/version: (.+)$/, 1] return version if version -- cgit v1.2.3 From a17f38dd364af67d5965aaa58438cb768c6d057a Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 9 Jan 2017 21:30:32 +0000 Subject: xcode: use default location when possible. Xcode can be installed anywhere but for most people it's in `/Applications/Xcode.app` so just look there if `xcode-select` isn't helpful before looking at Spotlight which can return weird results on e.g. backup disks. Fixes #1587. --- Library/Homebrew/os/mac/xcode.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index d13c98b88..e85f21c63 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -3,6 +3,7 @@ module OS module Xcode module_function + DEFAULT_BUNDLE_PATH = Pathname.new("/Applications/Xcode.app").freeze BUNDLE_ID = "com.apple.dt.Xcode".freeze OLD_BUNDLE_ID = "com.apple.Xcode".freeze @@ -67,11 +68,14 @@ module OS Pathname.new("#{prefix}/Toolchains/XcodeDefault.xctoolchain") end - # Ask Spotlight where Xcode is. If the user didn't install the - # helper tools and installed Xcode in a non-conventional place, this - # is our only option. See: https://superuser.com/questions/390757 def bundle_path - MacOS.app_with_bundle_id(V4_BUNDLE_ID, V3_BUNDLE_ID) + # Use the default location if it exists. + return DEFAULT_BUNDLE_PATH if DEFAULT_BUNDLE_PATH.exist? + + # Ask Spotlight where Xcode is. If the user didn't install the + # helper tools and installed Xcode in a non-conventional place, this + # is our only option. See: https://superuser.com/questions/390757 + MacOS.app_with_bundle_id(BUNDLE_ID, OLD_BUNDLE_ID) end def installed? -- cgit v1.2.3 From fe117bf79b244c42b7e4049d353c3c003eae4880 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 9 Jan 2017 22:44:01 +0000 Subject: requirement: get formula from satisfy. If satisfy returns a `Pathname` from `which` then we can use that to infer a formula dependency from that `Requirement`. --- Library/Homebrew/requirement.rb | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) 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 -- cgit v1.2.3 From 0158cc2e23f228715182a946ddfd6268bd6fc2d8 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 9 Jan 2017 22:44:33 +0000 Subject: build: don't assume requirement dependency is default formula. --- Library/Homebrew/build.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3 From 5821572b9b14b682feaec3f0c42afdba61a821b2 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 9 Jan 2017 22:44:47 +0000 Subject: formula_installer: don't assume requirement dependency is default formula. --- Library/Homebrew/formula_installer.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 24c068460..66bd60c37 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) -- cgit v1.2.3 From 3ccbfa72a2be56037375ee413b66c96d14384373 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 11 Jan 2017 14:19:56 -0800 Subject: brew.1: use uninstall instead of remove. Fixes #1817. --- Library/Homebrew/manpages/brew.1.md.erb | 2 +- docs/brew.1.html | 2 +- manpages/brew.1 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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`install formulaInstall formula.
remove formulaUninstall formula.
uninstall formulaUninstall formula.
updateFetch the newest version of Homebrew from GitHub using git(1).
listList all installed formulae.
search text|/text/Perform a substring search of formula names for text. If text is
diff --git a/manpages/brew.1 b/manpages/brew.1
index aa1d1c1d0..c3fb89d60 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
--
cgit v1.2.3
From ac7a59373087e9d49097ab7f0ddb691e64159959 Mon Sep 17 00:00:00 2001
From: ilovezfs
Date: Thu, 12 Jan 2017 07:22:34 -0800
Subject: InreplaceError: fix undefined method crash
When the first parameter to inreplace was an array, and the replacement
failed, InreplaceError would end up crashing with an undefined method
exception because the order of operations resulted in super not being
passed the value of the entire inject block.
---
Library/Homebrew/utils/inreplace.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb
index c7557ab41..b4c219f06 100644
--- a/Library/Homebrew/utils/inreplace.rb
+++ b/Library/Homebrew/utils/inreplace.rb
@@ -1,9 +1,10 @@
module Utils
class InreplaceError < RuntimeError
def initialize(errors)
- super errors.inject("inreplace failed\n") do |s, (path, errs)|
+ formatted_errors = errors.inject("inreplace failed\n") do |s, (path, errs)|
s << "#{path}:\n" << errs.map { |e| " #{e}\n" }.join
end
+ super formatted_errors
end
end
--
cgit v1.2.3
From 62d48b4f9d5d0b11db514e5b5245b9f4fb1d2f66 Mon Sep 17 00:00:00 2001
From: Andrew Janke
Date: Tue, 20 Dec 2016 03:59:15 -0500
Subject: brew deps --tree: fix gap in line between reqs and deps
---
Library/Homebrew/cmd/deps.rb | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb
index b5240b2c9..205cbe172 100644
--- a/Library/Homebrew/cmd/deps.rb
+++ b/Library/Homebrew/cmd/deps.rb
@@ -143,15 +143,23 @@ module Homebrew
def recursive_deps_tree(f, prefix)
reqs = f.requirements.select(&:default_formula?)
+ deps = f.deps.default
max = reqs.length - 1
reqs.each_with_index do |req, i|
- chr = i == max ? "└──" : "├──"
+ chr = if i == max && deps.empty?
+ "└──"
+ else
+ "├──"
+ end
puts prefix + "#{chr} :#{dep_display_name(req.to_dependency)}"
end
- deps = f.deps.default
max = deps.length - 1
deps.each_with_index do |dep, i|
- chr = i == max ? "└──" : "├──"
+ chr = if i == max
+ "└──"
+ else
+ "├──"
+ end
prefix_ext = i == max ? " " : "│ "
puts prefix + "#{chr} #{dep_display_name(dep)}"
recursive_deps_tree(Formulary.factory(dep.name), prefix + prefix_ext)
--
cgit v1.2.3
From 7c7a878b1f1be672fd8b259e7089cb84afab6428 Mon Sep 17 00:00:00 2001
From: Andrew Hundt
Date: Fri, 13 Jan 2017 16:20:30 -0500
Subject: clarify what should be in brew create url
resolves https://github.com/Homebrew/brew/issues/1821---
docs/Formula-Cookbook.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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
--
cgit v1.2.3
From 9dca10f9dc428e85afa399de4b76dbeac81a32b2 Mon Sep 17 00:00:00 2001
From: ilovezfs
Date: Fri, 13 Jan 2017 16:26:59 -0800
Subject: audit: whitelist unstable versions already in core
also allow higher stable versions with the same version prefix
---
Library/Homebrew/dev-cmd/audit.rb | 38 +++++++++++++++++++++++++++++++++++++-
1 file changed, 37 insertions(+), 1 deletion(-)
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 744aa6fbe..88d9a535c 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -678,11 +678,47 @@ class FormulaAuditor
end
end
+ unstable_whitelist = %w[
+ aalib 1.4rc5
+ automysqlbackup 3.0-rc6
+ aview 1.3.0rc1
+ distcc 3.2rc1
+ elm-format 0.5.2-alpha
+ ftgl 2.1.3-rc5
+ hidapi 0.8.0-rc1
+ libcaca 0.99b19
+ premake 4.4-beta5
+ pwnat 0.3-beta
+ pxz 4.999.9
+ recode 3.7-beta2
+ speexdsp 1.2rc3
+ sqoop 1.4.6
+ tcptraceroute 1.5beta7
+ testssl 2.8rc3
+ tiny-fugue 5.0b8
+ vbindiff 3.0_beta4
+ ].each_slice(2).to_a.map do |formula, version|
+ [formula, version.sub(/\d+$/, "")]
+ end
+
+ gnome_devel_whitelist = %w[
+ gtk-doc 1.25
+ libart 2.3.21
+ pygtkglext 1.1.0
+ ].each_slice(2).to_a.map do |formula, version|
+ [formula, version.split(".")[0..1].join(".")]
+ end
+
stable = formula.stable
case stable && stable.url
when /[\d\._-](alpha|beta|rc\d)/
- problem "Stable version URLs should not contain #{$1}"
+ matched = $1
+ version_prefix = stable.version.to_s.sub(/\d+$/, "")
+ return if unstable_whitelist.include?([formula.name, version_prefix])
+ problem "Stable version URLs should not contain #{matched}"
when %r{download\.gnome\.org/sources}, %r{ftp\.gnome\.org/pub/GNOME/sources}i
+ version_prefix = stable.version.to_s.split(".")[0..1].join(".")
+ return if gnome_devel_whitelist.include?([formula.name, version_prefix])
version = Version.parse(stable.url)
if version >= Version.create("1.0")
minor_version = version.to_s.split(".", 3)[1].to_i
--
cgit v1.2.3
From 7c159449910d5c6fe2f4fea7416fed8a8ba2d4db Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Sun, 15 Jan 2017 02:25:51 -0800
Subject: Fix documentation for HEAD upgrades.
These can now be done with just `brew upgrade`, like other upgrades.
Fixes #1818.
---
Library/Homebrew/cmd/install.rb | 3 ---
docs/brew.1.html | 5 +----
manpages/brew.1 | 3 ---
3 files changed, 1 insertion(+), 10 deletions(-)
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
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] formulaDownload and patch formula, then open a shell. This allows the user to
run ./configure --help and otherwise determine how to turn the software
package into a Homebrew formula.