Merge pull request #2392 from MikeMcQuaid/cleanup-taps
Update all references to taps.
This commit is contained in:
commit
490252d063
@ -1,166 +0,0 @@
|
|||||||
#: @hide_from_man_page
|
|
||||||
#: * `boneyard-formula-pr` [`--dry-run`] [`--local`] [`--reason=<reason>`] <formula> :
|
|
||||||
#: Creates a pull request to boneyard a formula.
|
|
||||||
#:
|
|
||||||
#: If `--dry-run` is passed, print what would be done rather than doing it.
|
|
||||||
#:
|
|
||||||
#: If `--local` is passed, perform only local operations (i.e. don't push or create PR).
|
|
||||||
#:
|
|
||||||
#: If `--reason=<reason>` is passed, append this to the commit/PR message.
|
|
||||||
|
|
||||||
require "formula"
|
|
||||||
require "json"
|
|
||||||
require "fileutils"
|
|
||||||
|
|
||||||
begin
|
|
||||||
require "json"
|
|
||||||
rescue LoadError
|
|
||||||
puts "Homebrew does not provide Ruby dependencies; install with:"
|
|
||||||
puts " gem install json"
|
|
||||||
odie "Dependency json is not installed."
|
|
||||||
end
|
|
||||||
|
|
||||||
module Homebrew
|
|
||||||
module_function
|
|
||||||
|
|
||||||
def boneyard_formula_pr
|
|
||||||
local_only = ARGV.include?("--local")
|
|
||||||
formula = ARGV.formulae.first
|
|
||||||
reason = ARGV.value("reason")
|
|
||||||
odie "No formula found!" unless formula
|
|
||||||
|
|
||||||
formula_relpath = formula.path.relative_path_from(formula.tap.path)
|
|
||||||
formula_file = "#{formula.name}.rb"
|
|
||||||
bottle_block = File.read(formula.path).include? " bottle do"
|
|
||||||
boneyard_tap = Tap.fetch("homebrew", "boneyard")
|
|
||||||
tap_migrations_path = formula.tap.path/"tap_migrations.json"
|
|
||||||
if ARGV.dry_run?
|
|
||||||
ohai "brew update"
|
|
||||||
ohai "brew tap #{boneyard_tap.name}"
|
|
||||||
ohai "cd #{formula.tap.path}"
|
|
||||||
cd formula.tap.path
|
|
||||||
ohai "cp #{formula_relpath} #{boneyard_tap.path}"
|
|
||||||
ohai "git rm #{formula_relpath}"
|
|
||||||
unless File.exist? tap_migrations_path
|
|
||||||
ohai "Creating tap_migrations.json for #{formula.tap.name}"
|
|
||||||
ohai "git add #{tap_migrations_path}"
|
|
||||||
end
|
|
||||||
ohai "Loading tap_migrations.json"
|
|
||||||
ohai "Adding #{formula.name} to tap_migrations.json"
|
|
||||||
else
|
|
||||||
safe_system HOMEBREW_BREW_FILE, "update"
|
|
||||||
safe_system HOMEBREW_BREW_FILE, "tap", boneyard_tap.name
|
|
||||||
cd formula.tap.path
|
|
||||||
cp formula_relpath, boneyard_tap.formula_dir
|
|
||||||
safe_system "git", "rm", formula_relpath
|
|
||||||
unless File.exist? tap_migrations_path
|
|
||||||
tap_migrations_path.write <<-EOS.undent
|
|
||||||
{
|
|
||||||
}
|
|
||||||
EOS
|
|
||||||
safe_system "git", "add", tap_migrations_path
|
|
||||||
end
|
|
||||||
tap_migrations = JSON.parse(File.read(tap_migrations_path))
|
|
||||||
tap_migrations[formula.name] = boneyard_tap.name
|
|
||||||
tap_migrations = tap_migrations.sort.inject({}) { |acc, elem| acc.merge!(elem[0] => elem[1]) }
|
|
||||||
tap_migrations_path.atomic_write(JSON.pretty_generate(tap_migrations) + "\n")
|
|
||||||
end
|
|
||||||
unless which("hub") || local_only
|
|
||||||
if ARGV.dry_run?
|
|
||||||
ohai "brew install hub"
|
|
||||||
else
|
|
||||||
safe_system HOMEBREW_BREW_FILE, "install", "hub"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
branch = "#{formula.name}-boneyard"
|
|
||||||
|
|
||||||
reason = " because #{reason}" if reason
|
|
||||||
|
|
||||||
if ARGV.dry_run?
|
|
||||||
ohai "cd #{formula.tap.path}"
|
|
||||||
ohai "git checkout --no-track -b #{branch} origin/master"
|
|
||||||
ohai "git commit --no-edit --verbose --message=\"#{formula.name}: migrate to boneyard\" -- #{formula_relpath} #{tap_migrations_path.basename}"
|
|
||||||
|
|
||||||
unless local_only
|
|
||||||
ohai "hub fork --no-remote"
|
|
||||||
ohai "hub fork"
|
|
||||||
ohai "hub fork (to read $HUB_REMOTE)"
|
|
||||||
ohai "git push $HUB_REMOTE #{branch}:#{branch}"
|
|
||||||
ohai "hub pull-request -m $'#{formula.name}: migrate to boneyard\\n\\nCreated with `brew boneyard-formula-pr`#{reason}.'"
|
|
||||||
end
|
|
||||||
|
|
||||||
ohai "git checkout -"
|
|
||||||
else
|
|
||||||
cd formula.tap.path
|
|
||||||
safe_system "git", "checkout", "--no-track", "-b", branch, "origin/master"
|
|
||||||
safe_system "git", "commit", "--no-edit", "--verbose",
|
|
||||||
"--message=#{formula.name}: migrate to boneyard",
|
|
||||||
"--", formula_relpath, tap_migrations_path.basename
|
|
||||||
|
|
||||||
unless local_only
|
|
||||||
safe_system "hub", "fork", "--no-remote"
|
|
||||||
quiet_system "hub", "fork"
|
|
||||||
remote = Utils.popen_read("hub fork 2>&1")[/fatal: remote (.+) already exists\./, 1]
|
|
||||||
odie "cannot get remote from 'hub'!" unless remote
|
|
||||||
safe_system "git", "push", remote, "#{branch}:#{branch}"
|
|
||||||
pr_message = <<-EOS.undent
|
|
||||||
#{formula.name}: migrate to boneyard
|
|
||||||
|
|
||||||
Created with `brew boneyard-formula-pr`#{reason}.
|
|
||||||
EOS
|
|
||||||
pr_url = Utils.popen_read("hub", "pull-request", "-m", pr_message).chomp
|
|
||||||
end
|
|
||||||
|
|
||||||
safe_system "git", "checkout", "-"
|
|
||||||
end
|
|
||||||
|
|
||||||
if ARGV.dry_run?
|
|
||||||
ohai "cd #{boneyard_tap.path}"
|
|
||||||
ohai "git checkout --no-track -b #{branch} origin/master"
|
|
||||||
if bottle_block
|
|
||||||
ohai "Removing bottle block"
|
|
||||||
else
|
|
||||||
ohai "No bottle block to remove"
|
|
||||||
end
|
|
||||||
ohai "git add #{formula_file}"
|
|
||||||
ohai "git commit --no-edit --verbose --message=\"#{formula.name}: migrate from #{formula.tap.repo}\" -- #{formula_file}"
|
|
||||||
|
|
||||||
unless local_only
|
|
||||||
ohai "hub fork --no-remote"
|
|
||||||
ohai "hub fork"
|
|
||||||
ohai "hub fork (to read $HUB_REMOTE)"
|
|
||||||
ohai "git push $HUB_REMOTE #{branch}:#{branch}"
|
|
||||||
ohai "hub pull-request --browse -m $'#{formula.name}: migrate from #{formula.tap.repo}\\n\\nGoes together with $PR_URL\\n\\nCreated with `brew boneyard-formula-pr`#{reason}.'"
|
|
||||||
end
|
|
||||||
|
|
||||||
ohai "git checkout -"
|
|
||||||
else
|
|
||||||
cd boneyard_tap.formula_dir
|
|
||||||
safe_system "git", "checkout", "--no-track", "-b", branch, "origin/master"
|
|
||||||
if bottle_block
|
|
||||||
Utils::Inreplace.inreplace formula_file, / bottle do.+?end\n\n/m, ""
|
|
||||||
end
|
|
||||||
safe_system "git", "add", formula_file
|
|
||||||
safe_system "git", "commit", "--no-edit", "--verbose",
|
|
||||||
"--message=#{formula.name}: migrate from #{formula.tap.repo}",
|
|
||||||
"--", formula_file
|
|
||||||
|
|
||||||
unless local_only
|
|
||||||
safe_system "hub", "fork", "--no-remote"
|
|
||||||
quiet_system "hub", "fork"
|
|
||||||
remote = Utils.popen_read("hub fork 2>&1")[/fatal: remote (.+) already exists\./, 1]
|
|
||||||
odie "cannot get remote from 'hub'!" unless remote
|
|
||||||
safe_system "git", "push", remote, "#{branch}:#{branch}"
|
|
||||||
safe_system "hub", "pull-request", "--browse", "-m", <<-EOS.undent
|
|
||||||
#{formula.name}: migrate from #{formula.tap.repo}
|
|
||||||
|
|
||||||
Goes together with #{pr_url}.
|
|
||||||
|
|
||||||
Created with `brew boneyard-formula-pr`#{reason}.
|
|
||||||
EOS
|
|
||||||
end
|
|
||||||
|
|
||||||
safe_system "git", "checkout", "-"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@ -363,14 +363,6 @@ class BuildError < RuntimeError
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if formula.tap && formula.tap.name == "homebrew/boneyard"
|
|
||||||
onoe <<-EOS.undent
|
|
||||||
#{formula} was moved to homebrew-boneyard because it has unfixable issues.
|
|
||||||
Please do not file any issues about this. Sorry!
|
|
||||||
EOS
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if formula.tap && defined?(OS::ISSUES_URL)
|
if formula.tap && defined?(OS::ISSUES_URL)
|
||||||
if formula.tap.official?
|
if formula.tap.official?
|
||||||
puts Formatter.error(Formatter.url(OS::ISSUES_URL), label: "READ THIS")
|
puts Formatter.error(Formatter.url(OS::ISSUES_URL), label: "READ THIS")
|
||||||
|
|||||||
@ -1,11 +1,8 @@
|
|||||||
OFFICIAL_TAPS = %w[
|
OFFICIAL_TAPS = %w[
|
||||||
apache
|
apache
|
||||||
dupes
|
|
||||||
fuse
|
|
||||||
nginx
|
nginx
|
||||||
php
|
php
|
||||||
science
|
science
|
||||||
tex
|
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
OFFICIAL_CMD_TAPS = {
|
OFFICIAL_CMD_TAPS = {
|
||||||
|
|||||||
@ -205,14 +205,6 @@ _brew_audit() {
|
|||||||
'*:formula:__brew_formulae'
|
'*:formula:__brew_formulae'
|
||||||
}
|
}
|
||||||
|
|
||||||
# brew boneyard-formula-pr [--dry-run] [--local] formula-name
|
|
||||||
_brew_boneyard_formula_pr() {
|
|
||||||
_arguments \
|
|
||||||
'--dry-run[print what would be done rather than doing it]' \
|
|
||||||
'--local[perform only local operations(i.e. don''t push or create PR)]' \
|
|
||||||
':formula:__brew_formulae'
|
|
||||||
}
|
|
||||||
|
|
||||||
# brew bottle [--verbose] [--no-rebuild] [--keep-old] [--skip-relocation] [--root-url=root_url]
|
# brew bottle [--verbose] [--no-rebuild] [--keep-old] [--skip-relocation] [--root-url=root_url]
|
||||||
# brew bottle --merge [--no-commit] [--keep-old] [--write]
|
# brew bottle --merge [--no-commit] [--keep-old] [--write]
|
||||||
# TODO missing argument docs
|
# TODO missing argument docs
|
||||||
|
|||||||
@ -1,37 +1,19 @@
|
|||||||
# Interesting Taps & Forks
|
# Interesting Taps & Forks
|
||||||
|
|
||||||
A _tap_ is homebrew-speak for a Git repository containing extra formulae.
|
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` commands. Type `man brew` in your Terminal. The main repository <https://github.com/Homebrew/homebrew-core>, often called `homebrew/core`, is always built-in.
|
Homebrew has the capability to add (and remove) multiple taps to your local installation with the `brew tap` and `brew untap` commands. Type `man brew` in your Terminal. The main repository [https://github.com/Homebrew/homebrew-core](https://github.com/Homebrew/homebrew-core), often called `homebrew/core`, is always built-in.
|
||||||
|
|
||||||
## Main taps
|
## Main taps
|
||||||
|
|
||||||
* [homebrew/apache](https://github.com/Homebrew/homebrew-apache): A tap for Apache modules, extending macOS's built-in Apache. These brews may require unconventional additional setup, as explained in the caveats.
|
* [homebrew/apache](https://github.com/Homebrew/homebrew-apache): A tap for Apache modules, extending macOS's built-in Apache. These brews may require unconventional additional setup, as explained in the caveats.
|
||||||
|
|
||||||
* [homebrew/boneyard](https://github.com/Homebrew/homebrew-boneyard): Formulae from other official taps, primarily `homebrew/core` are not deleted, they are moved here.
|
|
||||||
|
|
||||||
* [homebrew/bundle](https://github.com/Homebrew/homebrew-bundle): Bundler for non-Ruby dependencies from Homebrew.
|
|
||||||
|
|
||||||
* [homebrew/completions](https://github.com/Homebrew/homebrew-completions): Shell completion formulae.
|
|
||||||
|
|
||||||
* [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/nginx](https://github.com/Homebrew/homebrew-nginx): Feature rich Nginx tap for modules.
|
* [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.
|
* [homebrew/php](https://github.com/Homebrew/homebrew-php): Repository for php-related formulae.
|
||||||
|
|
||||||
* [homebrew/python](https://github.com/Homebrew/homebrew-python): A few Python formulae that do not build well with `pip` alone.
|
|
||||||
|
|
||||||
* [homebrew/science](https://github.com/Homebrew/homebrew-science): A collection of scientific libraries and tools.
|
* [homebrew/science](https://github.com/Homebrew/homebrew-science): A collection of scientific libraries and tools.
|
||||||
|
|
||||||
* [homebrew/services](https://github.com/Homebrew/homebrew-services): A tool to start Homebrew formulae's plists with `launchctl`.
|
`brew search` looks in these taps as well as in [homebrew/core](https://github.com/Homebrew/homebrew-core) so don't worry about missing stuff.
|
||||||
|
|
||||||
* [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.
|
|
||||||
|
|
||||||
You can be added as a maintainer for one of the Homebrew organization taps and aid the project! If you are interested write to our list: homebrew-discuss@googlegroups.com. We want your help!
|
You can be added as a maintainer for one of the Homebrew organization taps and aid the project! If you are interested write to our list: homebrew-discuss@googlegroups.com. We want your help!
|
||||||
|
|
||||||
@ -47,6 +29,8 @@ You can be added as a maintainer for one of the Homebrew organization taps and a
|
|||||||
|
|
||||||
* [titanous/gnuradio](https://github.com/titanous/homebrew-gnuradio): GNU Radio and friends running on macOS.
|
* [titanous/gnuradio](https://github.com/titanous/homebrew-gnuradio): GNU Radio and friends running on macOS.
|
||||||
|
|
||||||
|
* [dunn/emacs](https://github.com/dunn/homebrew-emacs): A tap for Emacs packages.
|
||||||
|
|
||||||
## Interesting forks
|
## Interesting forks
|
||||||
|
|
||||||
* [mistydemeo/tigerbrew](https://github.com/mistydemeo/tigerbrew): Experimental Tiger PowerPC version
|
* [mistydemeo/tigerbrew](https://github.com/mistydemeo/tigerbrew): Experimental Tiger PowerPC version
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user