Skip to content
This repository was archived by the owner on Nov 27, 2017. It is now read-only.

Commit eec5059

Browse files
committed
Merge branch homebrew/master into linuxbrew/master
Conflicts: .github/CONTRIBUTING.md .github/ISSUE_TEMPLATE.md .github/PULL_REQUEST_TEMPLATE.md Library/Homebrew/cmd/pull.rb Library/Homebrew/cmd/test-bot.rb Library/Homebrew/cmd/update.sh Library/Homebrew/global.rb Library/Homebrew/tap.rb README.md share/doc/homebrew/Troubleshooting.md
2 parents dc1c2b5 + 53c5089 commit eec5059

File tree

83 files changed

+384
-4267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+384
-4267
lines changed

.github/CONTRIBUTING.md

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,6 @@
1-
# Contributing to Linuxbrew
2-
[Linuxbrew](https://github.com/Linuxbrew/linuxbrew) is a fork of [Homebrew](https://github.com/Homebrew/homebrew). Homebrew is merged into Linuxbrew roughly once per week. To contribute a new formula or a new version of an existing formula, please submit your pull request to Homebrew rather than to Linuxbrew. Patches to fix issues that you have reproduced on both Linuxbrew and Homebrew should be sent to Homebrew. Please send your pull request to Linuxbrew if you are in doubt.
1+
**DO NOT CREATE NEW ISSUES OR PULL REQUESTS ON THIS REPOSITORY!**
32

4-
Patches to fix issues particular to Linux should not affect the behaviour of the formula on Mac. Use `if OS.mac?` and `if OS.linux?` as necessary to preserve the existing behaviour on Mac.
5-
6-
# Contributing to Homebrew
7-
First time contributing to Homebrew? Read our [Code of Conduct](https://github.com/Homebrew/homebrew/blob/master/CODEOFCONDUCT.md#code-of-conduct).
8-
9-
### Report a bug
10-
11-
* run `brew update` (twice)
12-
* run and read `brew doctor`
13-
* read [the Troubleshooting Checklist](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting)
14-
* open an issue on the formula's repository
15-
16-
### Submit a `1.2.3` version upgrade for the `foo` formula
17-
18-
* check if the same upgrade has been already submitted by [searching the open pull requests for `foo`](https://github.com/Homebrew/homebrew/pulls?utf8=✓&q=is%3Apr+is%3Aopen+foo).
19-
* `brew edit foo`
20-
* edit [`url`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#url-class_method) and [`sha256`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#sha256%3D-class_method)/[`tag`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#url-class_method), leave the [`bottle`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#bottle-class_method) as-is
21-
* `brew install foo`
22-
* run `brew audit foo` and fix any issues
23-
* `git commit` with commit subject `foo 1.2.3`
24-
* [open a pull request](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md#how-to-open-a-homebrew-pull-request-and-get-it-merged) and fix any failing tests
25-
26-
### Add a new formula for `foo` version `2.3.4` from `$URL`
27-
28-
* read [the Formula Cookbook](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md#formula-cookbook) or: `brew create $URL` and make edits
29-
* `brew install foo`
30-
* `brew audit --online --strict foo`
31-
* `git commit` with message formatted `foo 2.3.4 (new formula)`
32-
* [open a pull request](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md#how-to-open-a-homebrew-pull-request-and-get-it-merged) and fix any failing tests
33-
34-
### Contribute a fix to the `foo` formula
35-
36-
* `brew edit foo` and make edits
37-
* leave the [`bottle`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#bottle-class_method) as-is
38-
* `brew install foo`, `brew test foo`, and `brew audit foo`
39-
* `git commit` with summary formatted `foo: fix <insert details>`
40-
* if it is a portability fix, format it as `foo: Fix for Linuxbrew`
41-
* format the rest of the commit message according to [Chris Beams' guidelines](http://chris.beams.io/posts/git-commit/)
42-
* [open a pull request](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md#how-to-open-a-homebrew-pull-request-and-get-it-merged) and fix any failing tests
43-
44-
Thanks!
3+
- Please create all issues found when running `brew install` at https://github.com/Linuxbrew/homebrew-core/issues/new
4+
- Please create all issues found when running any other `brew` command at https://github.com/Linuxbrew/brew/issues/new
5+
- Please create formula pull requests at https://github.com/Linuxbrew/homebrew-core
6+
- Please create core code pull requests at https://github.com/Linuxbrew/brew

.github/ISSUE_TEMPLATE.md

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
1-
# Please follow the general troubleshooting steps first:
1+
DO NOT CREATE NEW ISSUES ON THIS REPOSITORY!
22

3-
- [ ] Ran `brew update` and retried your prior step?
4-
- [ ] Ran `brew doctor`, fixed as many issues as possible and retried your prior step?
5-
- [ ] If you're seeing permission errors tried running `sudo chown -R $(whoami) $(brew --prefix)`?
3+
Please create all issues found when running `brew install` at https://github.com/Linuxbrew/homebrew-core/issues/new
64

7-
_You can erase any parts of this template not applicable to your Issue._
8-
9-
### Bug reports:
10-
11-
Please replace this line with a brief summary of your issue **AND** if reporting a build issue include the link from:
12-
13-
`brew gist-logs <formula>`
14-
(where `<formula>` is the name of the formula that failed to build).
15-
16-
### Feature/Formula Requests:
17-
18-
**Please note by far the quickest way to get a new feature or formula into Linuxbrew is to file a [Pull Request](https://github.com/Linuxbrew/linuxbrew/blob/master/.github/CONTRIBUTING.md).**
19-
20-
We will consider your request but it may be closed if it's something we're not actively planning to work on.
5+
Please create all issues found when running any other `brew` command at https://github.com/Linuxbrew/brew/issues/new

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,5 @@
1-
# Contributing to Linuxbrew:
1+
DO NOT CREATE NEW PULL REQUESTS ON THIS REPOSITORY!
22

3-
To contribute a new formula or a new version of an existing formula, please submit your pull request to [Homebrew](https://github.com/Homebrew/homebrew) rather than to Linuxbrew. Patches to fix issues that you have reproduced on both Linuxbrew and Homebrew should be sent to Homebrew. Please send your pull request to Linuxbrew if you are in doubt.
3+
Please create formula pull requests at https://github.com/Linuxbrew/homebrew-core
44

5-
Patches to fix issues particular to Linux should not affect the behaviour of the formula on Mac. Use `if OS.mac?` and `if OS.linux?` as necessary to preserve the existing behaviour on Mac. For example, to add a new dependency that is not necessary on Mac:
6-
7-
```ruby
8-
depends_on "zlib" unless OS.mac?
9-
```
10-
11-
### All Submissions:
12-
13-
_You can erase any parts of this template not applicable to your Pull Request._
14-
15-
- [ ] Have you followed the guidelines in our [Contributing](https://github.com/Linuxbrew/linuxbrew/blob/master/.github/CONTRIBUTING.md) document?
16-
- [ ] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/Linuxbrew/linuxbrew/pulls) for the same update/change?
17-
- [ ] Have you included a log of the failed build without your patch using `brew gist-logs <formula>`?
18-
- [ ] Does your submission pass
19-
`brew audit --strict <formula>` (where `<formula>` is the name of the formula you're submitting)?
20-
- [ ] Have you built your formula locally prior to submission with `brew install <formula>`?
21-
22-
### Changes to Linuxbrew's Core:
23-
24-
- [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
25-
- [ ] Have you written new tests for your core changes, as applicable? [Here's an example](https://github.com/Homebrew/homebrew/pull/49031) if you'd like one.
26-
- [ ] Have you successfully ran `brew tests` with your changes locally?
5+
Please create core code pull requests at https://github.com/Linuxbrew/brew

CODEOFCONDUCT.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1 @@
1-
# Code of Conduct
2-
The Homebrew community is made up of members from around the globe with a diverse set of skills, personalities, and experiences. It is through these differences that our community experiences great successes and continued growth. When you're working with members of the community, we encourage you to follow these guidelines which help steer our interactions and strive to keep Homebrew a positive, successful, and growing community.
3-
4-
A member of the Homebrew community is:
5-
6-
## Open
7-
Members of the community are open to collaboration, whether it's on GitHub, email, IRC or otherwise. We're receptive to constructive comment and criticism, as the experiences and skill sets of other members contribute to the whole of our efforts. We're accepting of all who wish to take part in our activities, fostering an environment where anyone can participate and everyone can make a difference.
8-
9-
## Considerate
10-
Members of the community are considerate of their peers - other Homebrew users. We're thoughtful when addressing the efforts of others, keeping in mind that oftentimes their labor was completed simply for the good of the community. We're attentive in our communications, whether in person or online, and we're tactful when approaching differing views.
11-
12-
## Respectful
13-
Members of the community are respectful. We're respectful of others, their positions, their skills, their commitments, and their efforts. We're respectful of the volunteer efforts that permeate the Homebrew community. We're respectful of the processes set forth in the community, and we work within them. When we disagree, we are courteous in raising our issues.
14-
15-
Overall, we're good to each other. We contribute to this community not because we have to, but because we want to. If we remember that, these guidelines will come naturally.
16-
17-
# Diversity
18-
The Homebrew community welcomes and encourages participation by everyone. Our community is based on mutual respect, tolerance, and encouragement, and we are working to help each other live up to these principles. We want our community to be more diverse: whoever you are, and whatever your background, we welcome you.
19-
20-
We have created this diversity statement because we believe that a diverse Homebrew community is stronger and more vibrant. A diverse community where people treat each other with respect has more potential contributors and more sources for ideas.
21-
22-
Although we have phrased the formal diversity statement generically to make it all-inclusive, we recognise that there are specific attributes that are used to discriminate against people. In alphabetical order, some of these attributes include (but are not limited to): age, culture, ethnicity, gender identity or expression, national origin, physical or mental difference, politics, race, religion, sex, sexual orientation, socio-economic status, and subculture. We welcome people regardless of the values of these or other attributes.
23-
24-
# Attribution
25-
This code of conduct is heavily based on the [Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/) and the [Python Diversity Statement](https://www.python.org/community/diversity/).
1+
Moved to https://github.com/Homebrew/brew/blob/master/CODEOFCONDUCT.md.

Library/Formula/nesc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Nesc < Formula
77
depends_on "automake" => :build
88
depends_on "autoconf" => :build
99
depends_on :java => :build
10-
depends_on :emacs => :build
10+
depends_on :emacs => ["21.1", :build]
1111

1212
bottle do
1313
cellar :any_skip_relocation

Library/Homebrew/cmd/audit.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,8 +904,8 @@ def audit_reverse_migration
904904

905905
if formula.tap.tap_migrations.key?(formula.name)
906906
problem <<-EOS.undent
907-
#{formula.name} seems to be listed in tap_migrations.rb!
908-
Please remove #{formula.name} from present tap & tap_migrations.rb
907+
#{formula.name} seems to be listed in tap_migrations.json!
908+
Please remove #{formula.name} from present tap & tap_migrations.json
909909
before submitting it to Homebrew/homebrew.
910910
EOS
911911
end

Library/Homebrew/cmd/config.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require "hardware"
22
require "software_spec"
33
require "rexml/document"
4+
require "tap"
45

56
module Homebrew
67
def config
@@ -75,6 +76,18 @@ def origin
7576
Homebrew.git_origin || "(none)"
7677
end
7778

79+
def core_tap_head
80+
CoreTap.instance.git_head || "(none)"
81+
end
82+
83+
def core_tap_last_commit
84+
CoreTap.instance.git_last_commit || "never"
85+
end
86+
87+
def core_tap_origin
88+
CoreTap.instance.remote || "(none)"
89+
end
90+
7891
def describe_path(path)
7992
return "N/A" if path.nil?
8093
realpath = path.realpath
@@ -167,6 +180,13 @@ def dump_verbose_config(f = $stdout)
167180
f.puts "ORIGIN: #{origin}"
168181
f.puts "HEAD: #{head}"
169182
f.puts "Last commit: #{last_commit}"
183+
if CoreTap.instance.installed?
184+
f.puts "Core tap ORIGIN: #{core_tap_origin}"
185+
f.puts "Core tap HEAD: #{core_tap_head}"
186+
f.puts "Core tap last commit: #{core_tap_last_commit}"
187+
else
188+
f.puts "Core tap: N/A"
189+
end
170190
f.puts "HOMEBREW_PREFIX: #{HOMEBREW_PREFIX}"
171191
f.puts "HOMEBREW_REPOSITORY: #{HOMEBREW_REPOSITORY}"
172192
f.puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}"

Library/Homebrew/cmd/prune.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ def prune
3737
end
3838
end
3939

40-
migrate_taps :force => true unless ARGV.dry_run?
41-
4240
if ObserverPathnameExtension.total.zero?
4341
puts "Nothing pruned" if ARGV.verbose?
4442
else

Library/Homebrew/cmd/pull.rb

Lines changed: 65 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
# --resolve: When a patch fails to apply, leave in progress and allow user to
1919
# resolve, instead of aborting
2020
# --branch-okay: Do not warn if pulling to a branch besides master (useful for testing)
21+
# --legacy: Pull legacy formula PR from Homebrew/homebrew
22+
# (TODO remove it when it's not longer necessary)
2123

2224
require "utils"
2325
require "utils/json"
@@ -37,12 +39,17 @@ def pull
3739
github_repo = ""
3840
bintray_project = "homebrew"
3941
bintray_fetch_formulae = []
42+
tap = nil
4043

4144
ARGV.named.each do |arg|
4245
if arg.to_i > 0
4346
issue = arg
4447
if OS.mac?
45-
url = "https://github.com/Homebrew/homebrew/pull/#{arg}"
48+
if ARGV.include? "--legacy"
49+
url = "https://github.com/Homebrew/homebrew/pull/#{arg}"
50+
else
51+
url = "https://github.com/Homebrew/homebrew-core/pull/#{arg}"
52+
end
4653
elsif OS.linux?
4754
url = "https://github.com/Linuxbrew/linuxbrew/pull/#{arg}"
4855
bintray_project = "linuxbrew"
@@ -51,7 +58,7 @@ def pull
5158
tap = CoreTap.instance
5259
elsif (testing_match = arg.match %r{brew.sh/job/Homebrew.*Testing/(\d+)/})
5360
_, testing_job = *testing_match
54-
url = "https://github.com/Homebrew/homebrew/compare/master...BrewTestBot:testing-#{testing_job}"
61+
url = "https://github.com/Homebrew/homebrew-core/compare/master...BrewTestBot:testing-#{testing_job}"
5562
tap = CoreTap.instance
5663
odie "Testing URLs require `--bottle`!" unless ARGV.include?("--bottle")
5764
elsif (url_match = arg.match %r[https://github\.com/Linuxbrew/linuxbrew/pull/(\d+)\?([\w-]+):([\w-]+)])
@@ -67,21 +74,29 @@ def pull
6774
github_repo = "Linuxbrew/linuxbrew"
6875
elsif (api_match = arg.match HOMEBREW_PULL_API_REGEX)
6976
_, user, repo, issue = *api_match
70-
url = "https://github.com/#{user}/homebrew#{repo}/pull/#{issue}"
71-
tap = Tap.fetch(user, "homebrew#{repo}")
77+
url = "https://github.com/#{user}/#{repo}/pull/#{issue}"
78+
tap = Tap.fetch(user, repo) if repo.start_with?("homebrew-") || ARGV.include?("--legacy")
7279
elsif (url_match = arg.match HOMEBREW_PULL_OR_COMMIT_URL_REGEX)
7380
url, user, repo, issue = *url_match
74-
tap = Tap.fetch(user, "homebrew#{repo}")
81+
tap = Tap.fetch(user, repo) if repo.start_with?("homebrew-") || ARGV.include?("--legacy")
7582
else
7683
odie "Not a GitHub pull request or commit: #{arg}"
7784
end
7885

7986
if !testing_job && ARGV.include?("--bottle") && issue.nil?
80-
raise "No pull request detected!"
87+
odie "No pull request detected!"
8188
end
8289

83-
tap.install unless tap.installed?
84-
Dir.chdir tap.path
90+
if ARGV.include?("--legacy") && !tap.core_tap?
91+
odie "--legacy can only be used for CoreTap!"
92+
end
93+
94+
if tap
95+
tap.install unless tap.installed?
96+
Dir.chdir tap.path
97+
else
98+
Dir.chdir HOMEBREW_REPOSITORY
99+
end
85100

86101
# The cache directory seems like a good place to put patches.
87102
HOMEBREW_CACHE.mkpath
@@ -97,6 +112,11 @@ def pull
97112
patch_puller = PatchPuller.new(url)
98113
patch_puller.fetch_patch
99114
patch_changes = files_changed_in_patch(patch_puller.patchpath, tap)
115+
116+
if ARGV.include?("--legacy") && patch_changes[:others].reject { |f| f.start_with? "Library/Aliases" }.any?
117+
odie "Cannot merge legacy PR!"
118+
end
119+
100120
is_bumpable = patch_changes[:formulae].length == 1 && patch_changes[:others].empty?
101121
if do_bump
102122
odie "No changed formulae found to bump" if patch_changes[:formulae].empty?
@@ -112,16 +132,18 @@ def pull
112132

113133
changed_formulae = []
114134

115-
Utils.popen_read(
116-
"git", "diff-tree", "-r", "--name-only",
117-
"--diff-filter=AM", revision, "HEAD", "--", tap.formula_dir.to_s
118-
).each_line do |line|
119-
name = "#{tap.name}/#{File.basename(line.chomp, ".rb")}"
120-
begin
121-
changed_formulae << Formula[name]
122-
# Make sure we catch syntax errors.
123-
rescue Exception
124-
next
135+
if tap
136+
Utils.popen_read(
137+
"git", "diff-tree", "-r", "--name-only",
138+
"--diff-filter=AM", revision, "HEAD", "--", tap.formula_dir.to_s
139+
).each_line do |line|
140+
name = "#{tap.name}/#{File.basename(line.chomp, ".rb")}"
141+
begin
142+
changed_formulae << Formula[name]
143+
# Make sure we catch syntax errors.
144+
rescue Exception
145+
next
146+
end
125147
end
126148
end
127149

@@ -144,11 +166,13 @@ def pull
144166
orig_message = message = `git log HEAD^.. --format=%B`
145167
if issue && !ARGV.include?("--clean")
146168
ohai "Patch closes issue ##{issue}"
147-
# If this is a pull request, append a close message.
148-
closes = "Closes #{github_repo}##{issue}."
149-
unless message.include? closes
150-
message += "\n#{closes}"
169+
if ARGV.include?("--legacy")
170+
close_message = "Closes Homebrew/homebrew##{issue}."
171+
else
172+
close_message = "Closes #{github_repo}##{issue}."
151173
end
174+
# If this is a pull request, append a close message.
175+
message += "\n#{close_message}" unless message.include? close_message
152176
end
153177

154178
if changed_formulae.empty?
@@ -198,7 +222,16 @@ def pull
198222
"https://github.com/BrewTestBot/homebrew-#{tap.repo}/compare/homebrew:master...pr-#{issue}"
199223
end
200224
end
201-
curl "--silent", "--fail", "-o", "/dev/null", "-I", bottle_commit_url
225+
226+
bottle_commit_fallbacked = false
227+
begin
228+
curl "--silent", "--fail", "-o", "/dev/null", "-I", bottle_commit_url
229+
rescue ErrorDuringExecution
230+
raise if !ARGV.include?("--legacy") || bottle_commit_fallbacked
231+
bottle_commit_url = "https://github.com/BrewTestBot/homebrew/compare/homebrew:master...pr-#{issue}"
232+
bottle_commit_fallbacked = true
233+
retry
234+
end
202235

203236
safe_system "git", "checkout", "-B", bottle_branch, revision
204237
pull_patch bottle_commit_url
@@ -303,10 +336,18 @@ def apply_patch
303336

304337
# Fall back to three-way merge if patch does not apply cleanly
305338
patch_args << "-3"
339+
patch_args << "-p2" if ARGV.include?("--legacy") && !base_url.include?("BrewTestBot/homebrew-core")
306340
patch_args << patchpath
307341

342+
start_revision = `git rev-parse HEAD`.strip
343+
308344
begin
309345
safe_system "git", "am", *patch_args
346+
if ARGV.include?("--legacy")
347+
safe_system "git", "filter-branch", "-f", "--msg-filter",
348+
"sed -E -e \"s/ (#[0-9]+)/ Homebrew\\/homebrew\\1/g\"",
349+
"#{start_revision}..HEAD"
350+
end
310351
rescue ErrorDuringExecution
311352
if ARGV.include? "--resolve"
312353
odie "Patch failed to apply: try to resolve it."
@@ -331,7 +372,7 @@ def files_changed_in_patch(patchfile, tap)
331372
files << $1 if line =~ %r{^\+\+\+ b/(.*)}
332373
end
333374
files.each do |file|
334-
if tap.formula_file?(file)
375+
if (tap && tap.formula_file?(file)) || (ARGV.include?("--legacy") && file.start_with?("Library/Formula/"))
335376
formula_name = File.basename(file, ".rb")
336377
formulae << formula_name unless formulae.include?(formula_name)
337378
else

Library/Homebrew/cmd/readall.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def readall
3838
if ARGV.named.empty?
3939
formulae = Formula.files
4040
alias_dirs = Tap.map(&:alias_dir)
41-
alias_dirs.unshift CoreTap.instance.alias_dir
4241
else
4342
tap = Tap.fetch(ARGV.named.first)
4443
raise TapUnavailableError, tap.name unless tap.installed?

Library/Homebrew/cmd/tap-info.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ def tap_info
1010
end
1111
end
1212

13-
raise "#{tap} is not allowed" if taps.any?(&:core_tap?)
14-
1513
if ARGV.json == "v1"
1614
print_tap_json(taps)
1715
else

0 commit comments

Comments
 (0)