language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | Homebrew | brew | 0ef3e1e0dcbcd5aa55408fe81d23613e1c2c5e79.json | Preserve alias when installing formulae
Part of #567 | Library/Homebrew/test/test_formula.rb | @@ -8,13 +8,30 @@ def test_formula_instantiation
name = "formula_name"
path = Formulary.core_path(name)
spec = :stable
+ install_name = "formula_alias"
- f = klass.new(name, path, spec)
+ f = klass.new(name, path, spec, install_name: install_name)
assert_equal name, f.name
assert_equal path, f.path
+ assert_equal install_name, f.install_name
assert_raises(ArgumentError) { klass.new }
end
+ def test_install_ref_with_alias
+ name = "formula_name"
+ path = Formulary.core_path(name)
+ spec = :stable
+ install_name = "formula_alias"
+
+ f = Testball.new(name, path, spec, install_name: install_name)
+ assert_equal f.install_name, f.install_ref
+ end
+
+ def test_install_ref_with_non_alias
+ f = Testball.new
+ assert_equal f.path, f.install_ref
+ end
+
def test_prefix
f = Testball.new
assert_equal HOMEBREW_CELLAR/f.name/"0.1", f.prefix | true |
Other | Homebrew | brew | 0ef3e1e0dcbcd5aa55408fe81d23613e1c2c5e79.json | Preserve alias when installing formulae
Part of #567 | Library/Homebrew/test/test_formulary.rb | @@ -86,7 +86,9 @@ def test_factory_from_alias
alias_dir = CoreTap.instance.alias_dir
alias_dir.mkpath
FileUtils.ln_s @path, alias_dir/"foo"
- assert_kind_of Formula, Formulary.factory("foo")
+ result = Formulary.factory("foo")
+ assert_kind_of Formula, result
+ assert_equal "foo", result.install_name
ensure
alias_dir.rmtree
end | true |
Other | Homebrew | brew | 0ef3e1e0dcbcd5aa55408fe81d23613e1c2c5e79.json | Preserve alias when installing formulae
Part of #567 | Library/Homebrew/test/test_tab.rb | @@ -43,6 +43,7 @@ def test_defaults
assert_nil tab.stable_version
assert_nil tab.devel_version
assert_nil tab.head_version
+ assert_nil tab.install_name
assert_equal DevelopmentTools.default_compiler, tab.cxxstdlib.compiler
assert_nil tab.cxxstdlib.type
end
@@ -116,6 +117,7 @@ def test_from_file
assert_equal "2.14", tab.stable_version.to_s
assert_equal "2.15", tab.devel_version.to_s
assert_equal "HEAD-0000000", tab.head_version.to_s
+ assert_equal "test-formula", tab.install_name
end
def test_to_json
@@ -133,6 +135,7 @@ def test_to_json
assert_equal @tab.stable_version, tab.stable_version
assert_equal @tab.devel_version, tab.devel_version
assert_equal @tab.head_version, tab.head_version
+ assert_equal @tab.install_name, tab.install_name
end
def test_remap_deprecated_options | true |
Other | Homebrew | brew | 0ef3e1e0dcbcd5aa55408fe81d23613e1c2c5e79.json | Preserve alias when installing formulae
Part of #567 | Library/Homebrew/test/testball.rb | @@ -1,5 +1,5 @@
class Testball < Formula
- def initialize(name = "testball", path = Pathname.new(__FILE__).expand_path, spec = :stable)
+ def initialize(name = "testball", path = Pathname.new(__FILE__).expand_path, spec = :stable, install_name: name)
self.class.instance_eval do
stable.url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
stable.sha256 TESTBALL_SHA256 | true |
Other | Homebrew | brew | 0ef3e1e0dcbcd5aa55408fe81d23613e1c2c5e79.json | Preserve alias when installing formulae
Part of #567 | Library/Homebrew/test/testball_bottle.rb | @@ -1,5 +1,5 @@
class TestballBottle < Formula
- def initialize(name = "testball_bottle", path = Pathname.new(__FILE__).expand_path, spec = :stable)
+ def initialize(name = "testball_bottle", path = Pathname.new(__FILE__).expand_path, spec = :stable, install_name: name)
self.class.instance_eval do
stable.url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
stable.sha256 TESTBALL_SHA256 | true |
Other | Homebrew | brew | 2682b59b7f9bf668d73ee36e073f6e2a823f57ef.json | update-report: add newline if preinstall updated.
Fixes #858. | Library/Homebrew/cmd/update-report.rb | @@ -76,13 +76,16 @@ def update_report
if !ARGV.include?("--preinstall") && !ENV["HOMEBREW_UPDATE_FAILED"]
puts "Already up-to-date."
end
- elsif hub.empty?
- puts "No changes to formulae."
else
- hub.dump
- hub.reporters.each(&:migrate_tap_migration)
- hub.reporters.each(&:migrate_formula_rename)
- Descriptions.update_cache(hub)
+ if hub.empty?
+ puts "No changes to formulae."
+ else
+ hub.dump
+ hub.reporters.each(&:migrate_tap_migration)
+ hub.reporters.each(&:migrate_formula_rename)
+ Descriptions.update_cache(hub)
+ end
+ puts if ARGV.include?("--preinstall")
end
link_manpages | false |
Other | Homebrew | brew | 4422bd1f341e57038a8852ca9f8c46c31dbdbcad.json | audit: enforce https for Debian's anonscm | Library/Homebrew/cmd/audit.rb | @@ -1192,6 +1192,7 @@ def audit_urls
%r{^http://tools\.ietf\.org/},
%r{^http://launchpad\.net/},
%r{^http://bitbucket\.org/},
+ %r{^http://anonscm\.debian\.org/},
%r{^http://cpan\.metacpan\.org/},
%r{^http://hackage\.haskell\.org/},
%r{^http://(?:[^/]*\.)?archive\.org},
@@ -1202,6 +1203,8 @@ def audit_urls
problem "#{p} should be `https://cpan.metacpan.org/#{$1}`"
when %r{^(http|ftp)://ftp\.gnome\.org/pub/gnome/(.*)}i
problem "#{p} should be `https://download.gnome.org/#{$2}`"
+ when %r{^git://anonscm\.debian\.org/users/(.*)}i
+ problem "#{p} should be `https://anonscm.debian.org/git/users/#{$1}`"
end
end
| false |
Other | Homebrew | brew | 5f1abcf84210d20fe8276d0216a7c8e39f326398.json | docs: fix a typo in plist_options
While using `"true"` instead of `true` wouldn't break anything, it doesn't
seem to be expected, and using `"false"` instead of `false` _would_ break
things. | Library/Homebrew/formula.rb | @@ -2062,7 +2062,7 @@ def patch(strip = :p1, src = nil, &block)
# <pre>plist_options :manual => "foo"</pre>
#
# Or perhaps you'd like to give the user a choice? Ooh fancy.
- # <pre>plist_options :startup => "true", :manual => "foo start"</pre>
+ # <pre>plist_options :startup => true, :manual => "foo start"</pre>
def plist_options(options)
@plist_startup = options[:startup]
@plist_manual = options[:manual] | false |
Other | Homebrew | brew | 5b593ebb8958cc57cfbbd7013ca3d275466d66bf.json | Allow deprecated hash syntax in Cask headers | Library/Homebrew/cask/lib/hbc/source/path_base.rb | @@ -55,6 +55,10 @@ def test_cask(header_token, &block)
end
def build_cask(cask_class, header_token, &block)
+ if header_token.is_a?(Hash)
+ # Cask file is using old `cask :v1 => 'token'` syntax
+ header_token = header_token.values.first
+ end
raise Hbc::CaskTokenDoesNotMatchError.new(cask_token, header_token) unless cask_token == header_token
cask_class.new(cask_token, sourcefile_path: path, &block)
end | true |
Other | Homebrew | brew | 5b593ebb8958cc57cfbbd7013ca3d275466d66bf.json | Allow deprecated hash syntax in Cask headers | Library/Homebrew/cask/test/cask/dsl_test.rb | @@ -62,6 +62,15 @@
it "does not require a DSL version in the header" do
test_cask = Hbc.load("no-dsl-version")
+ test_cask.token.must_equal "no-dsl-version"
+ test_cask.url.to_s.must_equal "http://example.com/TestCask.dmg"
+ test_cask.homepage.must_equal "http://example.com/"
+ test_cask.version.to_s.must_equal "1.2.3"
+ end
+
+ it "may use deprecated DSL version hash syntax" do
+ test_cask = Hbc.load("with-dsl-version")
+ test_cask.token.must_equal "with-dsl-version"
test_cask.url.to_s.must_equal "http://example.com/TestCask.dmg"
test_cask.homepage.must_equal "http://example.com/"
test_cask.version.to_s.must_equal "1.2.3" | true |
Other | Homebrew | brew | 5b593ebb8958cc57cfbbd7013ca3d275466d66bf.json | Allow deprecated hash syntax in Cask headers | Library/Homebrew/cask/test/support/Casks/with-dsl-version.rb | @@ -0,0 +1,9 @@
+test_cask :v1 => 'with-dsl-version' do
+ version '1.2.3'
+ sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b'
+
+ url 'http://example.com/TestCask.dmg'
+ homepage 'http://example.com/'
+
+ app 'TestCask.app'
+end | true |
Other | Homebrew | brew | ab203a749f050486bd174fc7e29bd2a246333b80.json | search: handle name@v.v formulae.
Before this change:
```
~> brew search openssl@1.1
openssl@1.1 ✔
==> Did you mean to perform a regular expression search?
==> Surround your query with /slashes/ to search by regex.
``` | Library/Homebrew/cmd/search.rb | @@ -83,7 +83,7 @@ def search
end
if $stdout.tty?
- metacharacters = %w[\\ | ( ) [ ] { } ^ $ * + ? .]
+ metacharacters = %w[\\ | ( ) [ ] { } ^ $ * + ?]
bad_regex = metacharacters.any? do |char|
ARGV.any? do |arg|
arg.include?(char) && !arg.start_with?("/") | false |
Other | Homebrew | brew | 0b0893e26e801856fad96fda2a514c27f7140457.json | brew: execute update before tap
This seems generally like a good idea given that we're making syntax changes to
formulae & are going to keep doing so for a little while yet. Taps may have moved
over to that syntax, which then causes tap failures if brew isn't up-to-date.
Should fix situations like https://github.com/Homebrew/homebrew-php/issues/3545. | Library/Homebrew/brew.sh | @@ -247,7 +247,7 @@ update-preinstall() {
[[ -z "$HOMEBREW_NO_AUTO_UPDATE" ]] || return
[[ -z "$HOMEBREW_UPDATE_PREINSTALL" ]] || return
- if [[ "$HOMEBREW_COMMAND" = "install" || "$HOMEBREW_COMMAND" = "upgrade" ]]
+ if [[ "$HOMEBREW_COMMAND" = "install" || "$HOMEBREW_COMMAND" = "upgrade" || "$HOMEBREW_COMMAND" = "tap" ]]
then
brew update --preinstall
fi | false |
Other | Homebrew | brew | 6d54a250472a5bb303f69adc4db8970bb8b9e3e0.json | Brew-Test-Bot-For-Core-Contributors: fix broken link | share/doc/homebrew/Brew-Test-Bot-For-Core-Contributors.md | @@ -9,7 +9,7 @@ This job automatically builds any pull requests submitted to Homebrew/homebrew-c
## [Homebrew Testing](https://bot.brew.sh/job/Homebrew%20Testing/)
This job is manually triggered to run [`brew test-bot`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/test-bot.rb) with user-specified parameters. On a successful build it automatically uploads bottles.
-You can manually start this job with parameters to run [`brew test-bot`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/cmd/test-bot.rb) with the same parameters. It's often useful to pass a pull request URL, a commit URL, a commit SHA-1 and/or formula names to have `brew-test-bot` test them, report the results and produce bottles.
+You can manually start this job with parameters to run [`brew test-bot`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/test-bot.rb) with the same parameters. It's often useful to pass a pull request URL, a commit URL, a commit SHA-1 and/or formula names to have `brew-test-bot` test them, report the results and produce bottles.
## Bottling
To pull and bottle a pull request with `brew pull`: | false |
Other | Homebrew | brew | db88ca1e1871df380a6408dadc2bdb81a4b25f3e.json | Fix missing `magenta` in Tty. | Library/Homebrew/cask/lib/hbc/utils.rb | @@ -37,7 +37,7 @@ def odebug(title, *sput)
if $stdout.tty? && title.to_s.length > width
title = title.to_s[0, width - 3] + "..."
end
- puts "#{Tty.magenta}==> #{title}#{Tty.reset}"
+ puts "#{Tty.magenta}==>#{Tty.reset} #{Tty.white}#{title}#{Tty.reset}"
puts sput unless sput.empty?
end
end | true |
Other | Homebrew | brew | db88ca1e1871df380a6408dadc2bdb81a4b25f3e.json | Fix missing `magenta` in Tty. | Library/Homebrew/utils.rb | @@ -25,6 +25,10 @@ def white
bold 39
end
+ def magenta
+ bold 35
+ end
+
def red
underline 31
end | true |
Other | Homebrew | brew | 50fee143583b129a86a56bdc21d1f4ff4b9f5812.json | Unify heredoc style. | Library/Homebrew/cask/lib/hbc/cli.rb | @@ -187,10 +187,10 @@ def self.parser
end
opts.on("--binarydir=PATH") do
- opoo <<-EOF.undent
+ opoo <<-EOS.undent
Option --binarydir is obsolete!
Homebrew-Cask now uses the same location as your Homebrew installation for executable links.
- EOF
+ EOS
end
FLAGS.each do |flag, method|
@@ -246,11 +246,11 @@ def run(*args)
end
def purpose
- puts <<-PURPOSE.undent
+ puts <<-EOS.undent
brew-cask provides a friendly homebrew-style CLI workflow for the
administration of macOS applications distributed as binaries.
- PURPOSE
+ EOS
end
def usage | true |
Other | Homebrew | brew | 50fee143583b129a86a56bdc21d1f4ff4b9f5812.json | Unify heredoc style. | Library/Homebrew/cask/lib/hbc/cli/uninstall.rb | @@ -27,10 +27,10 @@ def self.run(*args)
single = versions.count == 1
- puts <<-EOF.undent
+ puts <<-EOS.undent
#{cask_token} #{versions.join(', ')} #{single ? 'is' : 'are'} still installed.
Remove #{single ? 'it' : 'them all'} with `brew cask uninstall --force #{cask_token}`.
- EOF
+ EOS
end
end
| true |
Other | Homebrew | brew | 50fee143583b129a86a56bdc21d1f4ff4b9f5812.json | Unify heredoc style. | Library/Homebrew/cask/lib/hbc/container/air.rb | @@ -11,12 +11,12 @@ def self.me?(criteria)
def self.installer_cmd
return @installer_cmd ||= INSTALLER_PATHNAME if installer_exist?
- raise Hbc::CaskError, <<-ERRMSG.undent
+ raise Hbc::CaskError, <<-EOS.undent
Adobe AIR runtime not present, try installing it via
brew cask install adobe-air
- ERRMSG
+ EOS
end
def self.installer_exist? | true |
Other | Homebrew | brew | 50fee143583b129a86a56bdc21d1f4ff4b9f5812.json | Unify heredoc style. | Library/Homebrew/cask/lib/hbc/system_command.rb | @@ -150,24 +150,24 @@ def self._parse_plist(command, output)
_warn_plist_garbage(command, Regexp.last_match[2])
xml = Plist.parse_xml(output)
unless xml.respond_to?(:keys) && !xml.keys.empty?
- raise Hbc::CaskError, <<-ERRMSG
+ raise Hbc::CaskError, <<-EOS
Empty result parsing plist output from command.
command was:
#{command.utf8_inspect}
output we attempted to parse:
#{output}
- ERRMSG
+ EOS
end
xml
rescue Plist::ParseError => e
- raise Hbc::CaskError, <<-ERRMSG
+ raise Hbc::CaskError, <<-EOS
Error parsing plist output from command.
command was:
#{command.utf8_inspect}
error was:
#{e}
output we attempted to parse:
#{output}
- ERRMSG
+ EOS
end
end | true |
Other | Homebrew | brew | 50fee143583b129a86a56bdc21d1f4ff4b9f5812.json | Unify heredoc style. | Library/Homebrew/cask/spec/cask/cli/cleanup_spec.rb | @@ -18,11 +18,11 @@
expect {
subject.cleanup!
- }.to output(<<-OUTPUT.undent).to_stdout
+ }.to output(<<-EOS.undent).to_stdout
==> Removing cached downloads
#{cached_download}
==> This operation has freed approximately #{disk_usage_readable(cleanup_size)} of disk space.
- OUTPUT
+ EOS
expect(cached_download.exist?).to eq(false)
end
@@ -38,11 +38,11 @@
expect {
subject.cleanup!
- }.to output(<<-OUTPUT.undent).to_stdout
+ }.to output(<<-EOS.undent).to_stdout
==> Removing cached downloads
skipping: #{cached_download} is locked
==> This operation has freed approximately #{disk_usage_readable(cleanup_size)} of disk space.
- OUTPUT
+ EOS
expect(cached_download.exist?).to eq(true)
end
@@ -56,10 +56,10 @@
expect {
subject.cleanup!
- }.to output(<<-OUTPUT.undent).to_stdout
+ }.to output(<<-EOS.undent).to_stdout
==> Removing cached downloads older than 10 days old
Nothing to do
- OUTPUT
+ EOS
expect(cached_download.exist?).to eq(true)
end | true |
Other | Homebrew | brew | 50fee143583b129a86a56bdc21d1f4ff4b9f5812.json | Unify heredoc style. | Library/Homebrew/cask/test/cask/artifact/uninstall_test.rb | @@ -42,7 +42,7 @@
let(:launchctl_remove_cmd) { %w[/bin/launchctl remove my.fancy.package.service] }
let(:unknown_response) { "launchctl list returned unknown response\n" }
let(:service_info) {
- <<-PLIST.undent
+ <<-EOS.undent
{
"LimitLoadToSessionType" = "Aqua";
"Label" = "my.fancy.package.service";
@@ -53,7 +53,7 @@
"argument";
);
};
- PLIST
+ EOS
}
describe "when launchctl job is owned by user" do
@@ -124,7 +124,7 @@
]
}
let(:pkg_info_plist) {
- <<-PLIST.undent
+ <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@@ -135,7 +135,7 @@
<string>/</string>
</dict>
</plist>
- PLIST
+ EOS
}
it "can uninstall" do | true |
Other | Homebrew | brew | 50fee143583b129a86a56bdc21d1f4ff4b9f5812.json | Unify heredoc style. | Library/Homebrew/cask/test/cask/artifact/zap_test.rb | @@ -43,7 +43,7 @@
let(:launchctl_remove_cmd) { %w[/bin/launchctl remove my.fancy.package.service] }
let(:unknown_response) { "launchctl list returned unknown response\n" }
let(:service_info) {
- <<-PLIST.undent
+ <<-EOS.undent
{
"LimitLoadToSessionType" = "Aqua";
"Label" = "my.fancy.package.service";
@@ -54,7 +54,7 @@
"argument";
);
};
- PLIST
+ EOS
}
describe "when launchctl job is owned by user" do
@@ -125,7 +125,7 @@
]
}
let(:pkg_info_plist) {
- <<-PLIST.undent
+ <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@@ -136,7 +136,7 @@
<string>/</string>
</dict>
</plist>
- PLIST
+ EOS
}
it "can zap" do | true |
Other | Homebrew | brew | 50fee143583b129a86a56bdc21d1f4ff4b9f5812.json | Unify heredoc style. | Library/Homebrew/cask/test/cask/cli/cat_test.rb | @@ -3,7 +3,7 @@
describe Hbc::CLI::Cat do
describe "given a basic Cask" do
before do
- @expected_output = <<-CLIOUTPUT.undent
+ @expected_output = <<-EOS.undent
test_cask 'basic-cask' do
version '1.2.3'
sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b'
@@ -13,7 +13,7 @@
app 'TestCask.app'
end
- CLIOUTPUT
+ EOS
end
it "displays the Cask file content about the specified Cask" do | true |
Other | Homebrew | brew | 50fee143583b129a86a56bdc21d1f4ff4b9f5812.json | Unify heredoc style. | Library/Homebrew/cask/test/cask/cli/create_test.rb | @@ -37,7 +37,7 @@ def self.editor_commands
it "drops a template down for the specified Cask" do
Hbc::CLI::Create.run("new-cask")
template = File.read(Hbc.path("new-cask"))
- template.must_equal <<-TEMPLATE.undent
+ template.must_equal <<-EOS.undent
cask 'new-cask' do
version ''
sha256 ''
@@ -49,7 +49,7 @@ def self.editor_commands
app ''
end
- TEMPLATE
+ EOS
end
it "throws away additional Cask arguments and uses the first" do | true |
Other | Homebrew | brew | 50fee143583b129a86a56bdc21d1f4ff4b9f5812.json | Unify heredoc style. | Library/Homebrew/cask/test/cask/cli/search_test.rb | @@ -4,11 +4,11 @@
it "lists the available Casks that match the search term" do
lambda {
Hbc::CLI::Search.run("photoshop")
- }.must_output <<-OUTPUT.gsub(%r{^ *}, "")
+ }.must_output <<-EOS.undent
==> Partial matches
adobe-photoshop-cc
adobe-photoshop-lightroom
- OUTPUT
+ EOS
end
it "shows that there are no Casks matching a search term that did not result in anything" do | true |
Other | Homebrew | brew | 50fee143583b129a86a56bdc21d1f4ff4b9f5812.json | Unify heredoc style. | Library/Homebrew/cask/test/cask/cli/uninstall_test.rb | @@ -57,11 +57,11 @@
timestamped_versions.each do |timestamped_version|
caskroom_path.join(".metadata", *timestamped_version, "Casks").tap(&:mkpath)
.join("#{token}.rb").open("w") do |caskfile|
- caskfile.puts <<-EOF.undent
+ caskfile.puts <<-EOS.undent
cask '#{token}' do
version '#{timestamped_version[0]}'
end
- EOF
+ EOS
end
caskroom_path.join(timestamped_version[0]).mkpath
end
@@ -112,13 +112,13 @@
saved_caskfile.dirname.mkpath
- IO.write saved_caskfile, <<-EOF.undent
+ IO.write saved_caskfile, <<-EOS.undent
cask 'ive-been-renamed' do
version :latest
app 'ive-been-renamed.app'
end
- EOF
+ EOS
end
after do | true |
Other | Homebrew | brew | 50fee143583b129a86a56bdc21d1f4ff4b9f5812.json | Unify heredoc style. | Library/Homebrew/cask/test/cask/dsl_test.rb | @@ -20,7 +20,7 @@
end
it "prints a warning that it has encountered an unexpected method" do
- expected = Regexp.compile(<<-EOREGEX.undent.lines.map(&:chomp).join(""))
+ expected = Regexp.compile(<<-EOS.undent.lines.map(&:chomp).join(""))
(?m)
Warning:
.*
@@ -29,7 +29,7 @@
brew update; brew cleanup; brew cask cleanup
.*
https://github.com/caskroom/homebrew-cask#reporting-bugs
- EOREGEX
+ EOS
TestHelper.must_output(self, attempt_unknown_method, expected)
end | true |
Other | Homebrew | brew | 50fee143583b129a86a56bdc21d1f4ff4b9f5812.json | Unify heredoc style. | Library/Homebrew/cask/test/cask/url_checker_test.rb | @@ -11,13 +11,13 @@
end
it "properly populates the response code and headers from an http response" do
- TestHelper.fake_response_for(TestHelper.test_cask.url, <<-RESPONSE.gsub(%r{^ *}, ""))
+ TestHelper.fake_response_for(TestHelper.test_cask.url, <<-EOS.undent)
HTTP/1.1 200 OK
Content-Type: application/x-apple-diskimage
ETag: "b4208f3e84967be4b078ecaa03fba941"
Content-Length: 23726161
Last-Modified: Sun, 12 Aug 2012 21:17:21 GMT
- RESPONSE
+ EOS
checker = Hbc::UrlChecker.new(TestHelper.test_cask, TestHelper.fake_fetcher)
checker.run | true |
Other | Homebrew | brew | 03352805c66c8f545fad59f7007f615a55d3e37b.json | tap: use utils link_path_manpages. | Library/Homebrew/tap.rb | @@ -248,26 +248,7 @@ def install(options = {})
end
def link_manpages
- return unless (path/"man").exist?
- conflicts = []
- (path/"man").find do |src|
- next if src.directory?
- dst = HOMEBREW_PREFIX/"share"/src.relative_path_from(path)
- next if dst.symlink? && src == dst.resolved_path
- if dst.exist?
- conflicts << dst
- next
- end
- dst.make_relative_symlink(src)
- end
- unless conflicts.empty?
- onoe <<-EOS.undent
- Could not link #{name} manpages to:
- #{conflicts.join("\n")}
-
- Please delete these files and run `brew tap --repair`.
- EOS
- end
+ link_path_manpages(path, "brew tap --repair")
end
# uninstall this {Tap}. | false |
Other | Homebrew | brew | 8cc027a3cd24b95120932c581c8b9eebb8c710f3.json | utils: add link_path_manpages method. | Library/Homebrew/utils.rb | @@ -594,3 +594,26 @@ def truncate_text_to_approximate_size(s, max_bytes, options = {})
out.encode!("UTF-8")
out
end
+
+def link_path_manpages(path, command)
+ return unless (path/"man").exist?
+ conflicts = []
+ (path/"man").find do |src|
+ next if src.directory?
+ dst = HOMEBREW_PREFIX/"share"/src.relative_path_from(path)
+ next if dst.symlink? && src == dst.resolved_path
+ if dst.exist?
+ conflicts << dst
+ next
+ end
+ dst.make_relative_symlink(src)
+ end
+ unless conflicts.empty?
+ onoe <<-EOS.undent
+ Could not link #{name} manpages to:
+ #{conflicts.join("\n")}
+
+ Please delete these files and run `#{command}`.
+ EOS
+ end
+end | false |
Other | Homebrew | brew | 1e1a8bf626b044b5772635f9ac28ce89c0b431db.json | Use version 3.1.0 of vendored `plist`. | Library/Homebrew/cask/lib/hbc.rb | @@ -36,7 +36,7 @@ module Hbc; end
require "hbc/verify"
require "hbc/version"
-require "vendor/plist"
+require "vendor/plist/plist"
module Hbc
include Hbc::Locations | true |
Other | Homebrew | brew | 1e1a8bf626b044b5772635f9ac28ce89c0b431db.json | Use version 3.1.0 of vendored `plist`. | Library/Homebrew/vendor/plist.rb | @@ -1,234 +0,0 @@
-#
-# = plist
-#
-# Copyright 2006-2010 Ben Bleything and Patrick May
-# Distributed under the MIT License
-#
-
-# Plist parses macOS xml property list files into ruby data structures.
-#
-# === Load a plist file
-# This is the main point of the library:
-#
-# r = Plist::parse_xml( filename_or_xml )
-module Plist
-# Note that I don't use these two elements much:
-#
-# + Date elements are returned as DateTime objects.
-# + Data elements are implemented as Tempfiles
-#
-# Plist::parse_xml will blow up if it encounters a Date element.
-# If you encounter such an error, or if you have a Date element which
-# can't be parsed into a Time object, please send your plist file to
-# plist@hexane.org so that I can implement the proper support.
- def Plist::parse_xml( filename_or_xml )
- listener = Listener.new
- #parser = REXML::Parsers::StreamParser.new(File.new(filename), listener)
- parser = StreamParser.new(filename_or_xml, listener)
- parser.parse
- listener.result
- end
-
- class Listener
- #include REXML::StreamListener
-
- attr_accessor :result, :open
-
- def initialize
- @result = nil
- @open = Array.new
- end
-
-
- def tag_start(name, attributes)
- @open.push PTag::mappings[name].new
- end
-
- def text( contents )
- @open.last.text = contents if @open.last
- end
-
- def tag_end(name)
- last = @open.pop
- if @open.empty?
- @result = last.to_ruby
- else
- @open.last.children.push last
- end
- end
- end
-
- class StreamParser
- def initialize( plist_data_or_file, listener )
- if plist_data_or_file.respond_to? :read
- @xml = plist_data_or_file.read
- elsif File.exists? plist_data_or_file
- @xml = File.read( plist_data_or_file )
- else
- @xml = plist_data_or_file
- end
-
- trim_to_xml_start!
-
- @listener = listener
- end
-
- def trim_to_xml_start!
- _, xml_tag, rest = @xml.partition(/^<\?xml/)
- @xml = [xml_tag, rest].join
- end
-
- TEXT = /([^<]+)/
- XMLDECL_PATTERN = /<\?xml\s+(.*?)\?>*/um
- DOCTYPE_PATTERN = /\s*<!DOCTYPE\s+(.*?)(\[|>)/um
- COMMENT_START = /\A<!--/u
- COMMENT_END = /.*?-->/um
-
-
- def parse
- plist_tags = PTag::mappings.keys.join('|')
- start_tag = /<(#{plist_tags})([^>]*)>/i
- end_tag = /<\/(#{plist_tags})[^>]*>/i
-
- require 'strscan'
-
- @scanner = StringScanner.new( @xml )
- until @scanner.eos?
- if @scanner.scan(COMMENT_START)
- @scanner.scan(COMMENT_END)
- elsif @scanner.scan(XMLDECL_PATTERN)
- elsif @scanner.scan(DOCTYPE_PATTERN)
- elsif @scanner.scan(start_tag)
- @listener.tag_start(@scanner[1], nil)
- if (@scanner[2] =~ /\/$/)
- @listener.tag_end(@scanner[1])
- end
- elsif @scanner.scan(TEXT)
- @listener.text(@scanner[1])
- elsif @scanner.scan(end_tag)
- @listener.tag_end(@scanner[1])
- else
- raise ParseError.new("Unimplemented element #{@xml}")
- end
- end
- end
- end
-
- class PTag
- @@mappings = { }
- def PTag::mappings
- @@mappings
- end
-
- def PTag::inherited( sub_class )
- key = sub_class.to_s.downcase
- key.gsub!(/^plist::/, '' )
- key.gsub!(/^p/, '') unless key == "plist"
-
- @@mappings[key] = sub_class
- end
-
- attr_accessor :text, :children
- def initialize
- @children = Array.new
- end
-
- def to_ruby
- raise ParseError.new("Unimplemented: " + self.class.to_s + "#to_ruby on #{self.inspect}")
- end
- end
-
- class PList < PTag
- def to_ruby
- children.first.to_ruby if children.first
- end
- end
-
- class PDict < PTag
- def to_ruby
- dict = Hash.new
- key = nil
-
- children.each do |c|
- if key.nil?
- key = c.to_ruby
- else
- dict[key] = c.to_ruby
- key = nil
- end
- end
-
- dict
- end
- end
-
- require 'cgi'
- class PKey < PTag
- def to_ruby
- CGI::unescapeHTML(text || '')
- end
- end
-
- class PString < PTag
- def to_ruby
- CGI::unescapeHTML(text || '')
- end
- end
-
- class PArray < PTag
- def to_ruby
- children.collect do |c|
- c.to_ruby
- end
- end
- end
-
- class PInteger < PTag
- def to_ruby
- text.to_i
- end
- end
-
- class PTrue < PTag
- def to_ruby
- true
- end
- end
-
- class PFalse < PTag
- def to_ruby
- false
- end
- end
-
- class PReal < PTag
- def to_ruby
- text.to_f
- end
- end
-
- require 'date'
- class PDate < PTag
- def to_ruby
- DateTime.parse(text)
- end
- end
-
- require 'base64'
- class PData < PTag
- def to_ruby
- data = Base64.decode64(text.gsub(/\s+/, ''))
-
- begin
- return Marshal.load(data)
- rescue Exception => e
- io = StringIO.new
- io.write data
- io.rewind
- return io
- end
- end
- end
-
- class ParseError < RuntimeError; end
-end | true |
Other | Homebrew | brew | 1e1a8bf626b044b5772635f9ac28ce89c0b431db.json | Use version 3.1.0 of vendored `plist`. | Library/Homebrew/vendor/plist/plist.rb | @@ -13,8 +13,8 @@
require 'cgi'
require 'stringio'
-require 'plist/generator'
-require 'plist/parser'
+require_relative 'plist/generator'
+require_relative 'plist/parser'
module Plist
VERSION = '3.1.0' | true |
Other | Homebrew | brew | 65579f27dd905e4026bb514f60e875cfc41cc368.json | cask tty removed | Library/Homebrew/cask/lib/hbc.rb | @@ -35,6 +35,7 @@ module Hbc; end
require "hbc/utils"
require "hbc/verify"
require "hbc/version"
+require "utils"
require "vendor/plist"
| true |
Other | Homebrew | brew | 65579f27dd905e4026bb514f60e875cfc41cc368.json | cask tty removed | Library/Homebrew/cask/lib/hbc/artifact/moved.rb | @@ -80,7 +80,7 @@ def summarize_artifact(artifact_spec)
target_abv = " (#{target.abv})"
else
warning = "Missing #{self.class.artifact_english_name}"
- warning = "#{Hbc::Utils::Tty.red.underline}#{warning}#{Hbc::Utils::Tty.reset}: "
+ warning = "#{Tty.red}#{warning}#{Tty.reset}: "
end
"#{warning}#{printable_target}#{target_abv}" | true |
Other | Homebrew | brew | 65579f27dd905e4026bb514f60e875cfc41cc368.json | cask tty removed | Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb | @@ -57,7 +57,7 @@ def summarize_artifact(artifact_spec)
return unless self.class.islink?(target)
- link_description = "#{Hbc::Utils::Tty.red.underline}Broken Link#{Hbc::Utils::Tty.reset}: " unless target.exist?
+ link_description = "#{Tty.red}Broken Link#{Tty.reset}: " unless target.exist?
target_readlink_abv = " (#{target.readlink.abv})" if target.readlink.exist?
"#{link_description}#{printable_target} -> #{target.readlink}#{target_readlink_abv}" | true |
Other | Homebrew | brew | 65579f27dd905e4026bb514f60e875cfc41cc368.json | cask tty removed | Library/Homebrew/cask/lib/hbc/checkable.rb | @@ -27,23 +27,23 @@ def warnings?
def result
if errors?
- "#{Hbc::Utils::Tty.red.underline}failed#{Hbc::Utils::Tty.reset}"
+ "#{Tty.red}failed#{Tty.reset}"
elsif warnings?
- "#{Hbc::Utils::Tty.yellow.underline}warning#{Hbc::Utils::Tty.reset}"
+ "#{Tty.yellow}warning#{Tty.reset}"
else
- "#{Hbc::Utils::Tty.green}passed#{Hbc::Utils::Tty.reset}"
+ "#{Tty.green}passed#{Tty.reset}"
end
end
def summary
summary = ["#{summary_header}: #{result}"]
errors.each do |error|
- summary << " #{Hbc::Utils::Tty.red}-#{Hbc::Utils::Tty.reset} #{error}"
+ summary << " #{Tty.red}-#{Tty.reset} #{error}"
end
warnings.each do |warning|
- summary << " #{Hbc::Utils::Tty.yellow}-#{Hbc::Utils::Tty.reset} #{warning}"
+ summary << " #{Tty.yellow}-#{Tty.reset} #{warning}"
end
summary.join("\n") | true |
Other | Homebrew | brew | 65579f27dd905e4026bb514f60e875cfc41cc368.json | cask tty removed | Library/Homebrew/cask/lib/hbc/cli/doctor.rb | @@ -124,11 +124,11 @@ def self.legacy_tap_pattern
end
def self.notfound_string
- "#{Hbc::Utils::Tty.red.underline}Not Found - Unknown Error#{Hbc::Utils::Tty.reset}"
+ "#{Tty.red}Not Found - Unknown Error#{Tty.reset}"
end
def self.error_string(string = "Error")
- "#{Hbc::Utils::Tty.red.underline}(#{string})#{Hbc::Utils::Tty.reset}"
+ "#{Tty.red}(#{string})#{Tty.reset}"
end
def self.render_with_none(string) | true |
Other | Homebrew | brew | 65579f27dd905e4026bb514f60e875cfc41cc368.json | cask tty removed | Library/Homebrew/cask/lib/hbc/cli/info.rb | @@ -25,7 +25,7 @@ def self.info(cask)
end
def self.formatted_url(url)
- "#{Hbc::Utils::Tty.underline}#{url}#{Hbc::Utils::Tty.reset}"
+ "#{Tty.em}#{url}#{Tty.reset}"
end
def self.installation_info(cask)
@@ -35,7 +35,7 @@ def self.installation_info(cask)
puts versioned_staged_path.to_s
.concat(" (")
- .concat(versioned_staged_path.exist? ? versioned_staged_path.abv : "#{Hbc::Utils::Tty.red}does not exist#{Hbc::Utils::Tty.reset}")
+ .concat(versioned_staged_path.exist? ? versioned_staged_path.abv : "#{Tty.red}does not exist#{Tty.reset}")
.concat(")")
end
else
@@ -45,7 +45,7 @@ def self.installation_info(cask)
def self.name_info(cask)
ohai cask.name.size > 1 ? "Names" : "Name"
- puts cask.name.empty? ? "#{Hbc::Utils::Tty.red}None#{Hbc::Utils::Tty.reset}" : cask.name
+ puts cask.name.empty? ? "#{Tty.red}None#{Tty.reset}" : cask.name
end
def self.github_info(cask) | true |
Other | Homebrew | brew | 65579f27dd905e4026bb514f60e875cfc41cc368.json | cask tty removed | Library/Homebrew/cask/lib/hbc/cli/style.rb | @@ -28,7 +28,7 @@ def install_rubocop
begin
Homebrew.install_gem_setup_path! "rubocop-cask", RUBOCOP_CASK_VERSION, "rubocop"
rescue SystemExit
- raise Hbc::CaskError, $stderr.string.chomp.sub("#{::Tty.red}Error#{::Tty.reset}: ", "")
+ raise Hbc::CaskError, $stderr.string.chomp.sub("#{Tty.red}Error#{Tty.reset}: ", "")
end
end
end | true |
Other | Homebrew | brew | 65579f27dd905e4026bb514f60e875cfc41cc368.json | cask tty removed | Library/Homebrew/cask/lib/hbc/installer.rb | @@ -87,7 +87,7 @@ def summary
s = if MacOS.version >= :lion && !ENV["HOMEBREW_NO_EMOJI"]
(ENV["HOMEBREW_INSTALL_BADGE"] || "\xf0\x9f\x8d\xba") + " "
else
- "#{Hbc::Utils::Tty.blue.bold}==>#{Hbc::Utils::Tty.reset.bold} Success!#{Hbc::Utils::Tty.reset} "
+ "#{Tty.blue}==>#{Tty.reset} #{Tty.white}Success!#{Tty.reset} "
end
s << "#{@cask} was successfully installed!"
end | true |
Other | Homebrew | brew | 65579f27dd905e4026bb514f60e875cfc41cc368.json | cask tty removed | Library/Homebrew/cask/lib/hbc/utils.rb | @@ -5,7 +5,6 @@ module Hbc::Utils; end
require "stringio"
require "hbc/utils/file"
-require "hbc/utils/tty"
UPDATE_CMD = "brew uninstall --force brew-cask; brew untap phinze/cask; brew untap caskroom/cask; brew update; brew cleanup; brew cask cleanup".freeze
ISSUES_URL = "https://github.com/caskroom/homebrew-cask#reporting-bugs".freeze
@@ -34,11 +33,11 @@ def tty?
def odebug(title, *sput)
if Hbc.respond_to?(:debug) && Hbc.debug
- width = Hbc::Utils::Tty.width * 4 - 6
+ width = Tty.width * 4 - 6
if $stdout.tty? && title.to_s.length > width
title = title.to_s[0, width - 3] + "..."
end
- puts "#{Hbc::Utils::Tty.magenta.bold}==>#{Hbc::Utils::Tty.reset.bold} #{title}#{Hbc::Utils::Tty.reset}"
+ puts "#{Tty.magenta}==> #{title}#{Tty.reset}"
puts sput unless sput.empty?
end
end
@@ -151,14 +150,13 @@ def self.path_occupied?(path)
def self.error_message_with_suggestions
<<-EOS.undent
- #{Hbc::Utils::Tty.reset.bold}
Most likely, this means you have an outdated version of Homebrew-Cask. Please run:
- #{Hbc::Utils::Tty.green.normal}#{UPDATE_CMD}
+ #{Tty.green}#{UPDATE_CMD}
- #{Hbc::Utils::Tty.reset.bold}If this doesn’t fix the problem, please report this bug:
+ #{Tty.reset}If this doesn’t fix the problem, please report this bug:
- #{Hbc::Utils::Tty.underline}#{ISSUES_URL}#{Hbc::Utils::Tty.reset}
+ #{Tty.em}#{ISSUES_URL}#{Tty.reset}
EOS
end | true |
Other | Homebrew | brew | 65579f27dd905e4026bb514f60e875cfc41cc368.json | cask tty removed | Library/Homebrew/cask/lib/hbc/utils/tty.rb | @@ -1,125 +0,0 @@
-# originally from Homebrew utils.rb
-
-class Hbc::Utils::Tty
- COLORS = {
- black: 0,
- red: 1,
- green: 2,
- yellow: 3,
- blue: 4,
- magenta: 5,
- cyan: 6,
- white: 7,
- default: 9,
- }.freeze
-
- ATTRIBUTES = {
- reset: 0,
- bold: 1,
- dim: 2,
- italic: 3,
- underline: 4,
- blink: 5,
- inverse: 7,
- invisible: 8,
- strikethrough: 9,
- normal: 22,
- }.freeze
-
- @sequence = []
-
- class << self
- COLORS.keys.each do |sym|
- define_method(sym) do
- foreground(COLORS[sym])
- end
- define_method("fg_#{sym}".to_sym) do
- foreground(COLORS[sym])
- end
- define_method("bg_#{sym}".to_sym) do
- background(COLORS[sym])
- end
- end
-
- ATTRIBUTES.keys.each do |sym|
- define_method(sym) do
- deferred_emit(ATTRIBUTES[sym])
- end
- end
-
- def width
- `/usr/bin/tput cols`.strip.to_i
- end
-
- def truncate(str)
- str.to_s[0, width - 4]
- end
-
- private
-
- def foreground(color)
- deferred_emit(to_foreground_code(color))
- end
-
- def background(color)
- deferred_emit(to_background_code(color))
- end
-
- def to_color_code(space, color)
- return unless (num = to_color_number(color))
- return space + num if num < space
- return space + 9 if num > space
- num
- end
-
- def to_foreground_code(color)
- to_color_code(30, color)
- end
-
- def to_background_code(color)
- to_color_code(40, color)
- end
-
- def to_color_number(color)
- COLORS[color] || color.is_a?(Integer) ? color : nil
- end
-
- def to_attribute_number(attribute)
- ATTRIBUTES[attribute] || attribute.is_a?(Integer) ? attribute : nil
- end
-
- def sanitize_integer(arg)
- return arg.to_i if arg.is_a?(Integer)
- return 0 if arg.to_s =~ %r{^0+$}
- if arg.respond_to?(:to_i) && (int = arg.to_i) > 0
- return int
- end
- $stderr.puts "Warning: bad Tty code #{arg}"
- ATTRIBUTES[:reset]
- end
-
- def deferred_emit(*codes)
- @sequence.concat Array(*codes).map(&method(:sanitize_integer))
- Hbc::Utils::Tty
- end
-
- def to_s
- sequence = @sequence
- @sequence = []
- return "" unless $stdout.tty?
- if sequence.empty?
- $stderr.puts "Warning: empty Tty sequence"
- sequence = [ATTRIBUTES[:reset]]
- end
- "#{initiate}#{sequence.join(';')}#{terminate}"
- end
-
- def initiate
- "\033["
- end
-
- def terminate
- "m"
- end
- end
-end | true |
Other | Homebrew | brew | 911edb0ed77859445c3a48f6abe5b9be5807ebf7.json | Add test for per-cask `cleanup`. | Library/Homebrew/cask/spec/cask/cli/cleanup_spec.rb | @@ -10,6 +10,32 @@
cache_location.rmtree
end
+ describe "cleanup" do
+ it "removes cached downloads of given casks" do
+ cleaned_up_cached_download = 'caffeine'
+
+ cached_downloads = [
+ cache_location.join("#{cleaned_up_cached_download}--latest.zip"),
+ cache_location.join("transmission--2.61.dmg"),
+ ]
+
+ cached_downloads.each(&FileUtils.method(:touch))
+
+ cleanup_size = Hbc::Utils.size_in_bytes(cached_downloads[0])
+
+ expect {
+ subject.cleanup(cleaned_up_cached_download)
+ }.to output(<<-EOS.undent).to_stdout
+ ==> Removing cached downloads for #{cleaned_up_cached_download}
+ #{cached_downloads[0]}
+ ==> This operation has freed approximately #{disk_usage_readable(cleanup_size)} of disk space.
+ EOS
+
+ expect(cached_downloads[0].exist?).to eq(false)
+ expect(cached_downloads[1].exist?).to eq(true)
+ end
+ end
+
describe "cleanup!" do
it "removes cached downloads" do
cached_download = cache_location.join("SomeDownload.dmg")
@@ -18,11 +44,11 @@
expect {
subject.cleanup!
- }.to output(<<-OUTPUT.undent).to_stdout
+ }.to output(<<-EOS.undent).to_stdout
==> Removing cached downloads
#{cached_download}
==> This operation has freed approximately #{disk_usage_readable(cleanup_size)} of disk space.
- OUTPUT
+ EOS
expect(cached_download.exist?).to eq(false)
end
@@ -38,11 +64,11 @@
expect {
subject.cleanup!
- }.to output(<<-OUTPUT.undent).to_stdout
+ }.to output(<<-EOS.undent).to_stdout
==> Removing cached downloads
skipping: #{cached_download} is locked
==> This operation has freed approximately #{disk_usage_readable(cleanup_size)} of disk space.
- OUTPUT
+ EOS
expect(cached_download.exist?).to eq(true)
end
@@ -56,10 +82,10 @@
expect {
subject.cleanup!
- }.to output(<<-OUTPUT.undent).to_stdout
+ }.to output(<<-EOS.undent).to_stdout
==> Removing cached downloads older than 10 days old
Nothing to do
- OUTPUT
+ EOS
expect(cached_download.exist?).to eq(true)
end | false |
Other | Homebrew | brew | 3c6529851991eed20c75ba4661a1734d8a889468.json | build: permit weak imports in Go reverse deps.
Go makes extensive use of weak imports so we need to allow them when
building Go-using software.
Closes https://github.com/Homebrew/homebrew-core/issues/4047. | Library/Homebrew/build.rb | @@ -79,6 +79,11 @@ def install
ENV.activate_extensions!
+ # Go makes extensive use of weak imports.
+ if formula_deps.any? { |f| f.name == "go" }
+ ENV.permit_weak_imports
+ end
+
if superenv?
ENV.keg_only_deps = keg_only_deps
ENV.deps = formula_deps | false |
Other | Homebrew | brew | 0dd320318706bed665038350f11a74a0fb8e7f34.json | Install Cask’s default tap if untapped. | Library/Homebrew/cask/lib/hbc/cli.rb | @@ -142,6 +142,7 @@ def self.process(arguments)
command_string, *rest = *arguments
rest = process_options(rest)
command = Hbc.help ? "help" : lookup_command(command_string)
+ Hbc.default_tap.install unless Hbc.default_tap.installed?
Hbc.init if should_init?(command)
run_command(command, *rest)
rescue Hbc::CaskError, Hbc::CaskSha256MismatchError => e | true |
Other | Homebrew | brew | 0dd320318706bed665038350f11a74a0fb8e7f34.json | Install Cask’s default tap if untapped. | Library/Homebrew/cask/lib/hbc/locations.rb | @@ -126,7 +126,7 @@ def screen_saverdir
attr_writer :default_tap
def default_tap
- @default_tap ||= Tap.fetch("caskroom/homebrew-cask")
+ @default_tap ||= Tap.fetch("caskroom", "homebrew-cask")
end
def path(query) | true |
Other | Homebrew | brew | 0dd320318706bed665038350f11a74a0fb8e7f34.json | Install Cask’s default tap if untapped. | Library/Homebrew/official_taps.rb | @@ -17,7 +17,6 @@
].freeze
OFFICIAL_CMD_TAPS = {
- "caskroom/cask" => ["cask"],
"homebrew/bundle" => ["bundle"],
"homebrew/services" => ["services"],
}.freeze | true |
Other | Homebrew | brew | 0dd320318706bed665038350f11a74a0fb8e7f34.json | Install Cask’s default tap if untapped. | Library/Homebrew/tap.rb | @@ -307,7 +307,7 @@ def formula_dir
@formula_dir ||= [path/"Formula", path/"HomebrewFormula", path].detect(&:directory?)
end
- # path to the directory of all casks for caskroom/cask {Tap}.
+ # path to the directory of all {Cask} files for this {Tap}.
def cask_dir
@cask_dir ||= path/"Casks"
end | true |
Other | Homebrew | brew | eea0da362bd01abc74e66e64909b0be11c01322e.json | audit: ensure correct version_scheme placement. | Library/Homebrew/cmd/audit.rb | @@ -209,6 +209,7 @@ def audit_file
[/^ version ["'][\S\ ]+["']/, "version"],
[/^ (sha1|sha256) ["'][\S\ ]+["']/, "checksum"],
[/^ revision/, "revision"],
+ [/^ version_scheme/, "version_scheme"],
[/^ head ["'][\S\ ]+["']/, "head"],
[/^ stable do/, "stable block"],
[/^ bottle do/, "bottle block"], | false |
Other | Homebrew | brew | cc2a90ec8d4dc8b26a7658f4424cf6949d0bf4cb.json | Formula-Cookbook: add version_scheme documentation. | share/doc/homebrew/Formula-Cookbook.md | @@ -193,6 +193,12 @@ Where a dependent of a formula fails against a new version of that dependency it
[`revision`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#revision%3D-class_method)s are also used for formulae that move from the system OpenSSL to the Homebrew-shipped OpenSSL without any other changes to that formula. This ensures users aren’t left exposed to the potential security issues of the outdated OpenSSL. An example of this can be seen in [this commit](https://github.com/Homebrew/homebrew/commit/6b9d60d474d72b1848304297d91adc6120ea6f96).
+## Version Scheme Changes
+
+Sometimes formulae have version schemes that change such that a direct comparison between two versions no longer produces the correct result. For example, a project might be version `13` and then decide to become `1.0.0`. As `13` is translated to `13.0.0` by our versioning system by default this requires intervention.
+
+Where a version scheme of a formula fails to recognise a new version as newer it must receive a [`version_scheme`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#version_scheme%3D-class_method). An example of this can be seen [here](https://github.com/Homebrew/homebrew-core/pull/4006).
+
## Double-check for dependencies
When you already have a lot of formulae installed, it's easy to miss a common dependency. You can double-check which libraries a binary links to with the `otool` command (perhaps you need to use `xcrun otool`): | false |
Other | Homebrew | brew | a5a1b2969fa6a515495b11f746f43ec005ed671b.json | version: fix parsing of URLs ending with version
https://github.com/lihaoyi/Ammonite/releases/download/0.7.4/0.7.4
was parsing as "0.7" not "0.7.4" since ".4" was being treated as a
legitimate file extension. At minimum, let's insist that a valid file
extension include at least one letter to avoid lopping off part of the
correct version string. | Library/Homebrew/test/test_versions.rb | @@ -438,8 +438,12 @@ def test_opam_version
"https://opam.ocaml.org/archives/easy-format.1.0.2+opam.tar.gz"
end
- def test_waf_version
+ def test_no_extension_version
assert_version_detected "1.8.12", "https://waf.io/waf-1.8.12"
+ assert_version_detected "0.7.1", "https://codeload.github.com/gsamokovarov/jump/tar.gz/v0.7.1"
+ assert_version_detected "0.9.1234", "https://my.datomic.com/downloads/free/0.9.1234"
+ assert_version_detected "0.9", "https://my.datomic.com/downloads/free/0.9.1t34"
+ assert_version_detected "1.2.3", "https://my.datomic.com/downloads/free/1.2.3"
end
def test_dash_separated_version | true |
Other | Homebrew | brew | a5a1b2969fa6a515495b11f746f43ec005ed671b.json | version: fix parsing of URLs ending with version
https://github.com/lihaoyi/Ammonite/releases/download/0.7.4/0.7.4
was parsing as "0.7" not "0.7.4" since ".4" was being treated as a
legitimate file extension. At minimum, let's insist that a valid file
extension include at least one letter to avoid lopping off part of the
correct version string. | Library/Homebrew/version.rb | @@ -294,6 +294,8 @@ def self._parse(spec)
spec.basename.to_s
elsif %r{((?:sourceforge\.net|sf\.net)/.*)/download$}.match(spec_s)
Pathname.new(spec.dirname).stem
+ elsif %r{\.[^a-zA-Z]+$}.match(spec_s)
+ Pathname.new(spec_s).basename
else
spec.stem
end | true |
Other | Homebrew | brew | bf05651a0130c4df1f334a99f515708184e5a133.json | remove ruby 1.8 compatible codes (#742) | Library/Homebrew/brew.rb | @@ -1,5 +1,9 @@
std_trap = trap("INT") { exit! 130 } # no backtrace thanks
+# check ruby version before requiring any modules.
+RUBY_TWO = RUBY_VERSION.split(".").first.to_i >= 2
+raise "Homebrew must be run under Ruby 2!" unless RUBY_TWO
+
require "pathname"
HOMEBREW_LIBRARY_PATH = Pathname.new(__FILE__).realpath.parent
$:.unshift(HOMEBREW_LIBRARY_PATH.to_s) | true |
Other | Homebrew | brew | bf05651a0130c4df1f334a99f515708184e5a133.json | remove ruby 1.8 compatible codes (#742) | Library/Homebrew/dev-cmd/test-bot.rb | @@ -49,22 +49,12 @@ module Homebrew
HOMEBREW_TAP_REGEX = %r{^([\w-]+)/homebrew-([\w-]+)$}
- if ruby_has_encoding?
- def fix_encoding!(str)
- # Assume we are starting from a "mostly" UTF-8 string
- str.force_encoding(Encoding::UTF_8)
- return str if str.valid_encoding?
- str.encode!(Encoding::UTF_16, :invalid => :replace)
- str.encode!(Encoding::UTF_8)
- end
- elsif require "iconv"
- def fix_encoding!(str)
- Iconv.conv("UTF-8//IGNORE", "UTF-8", str)
- end
- else
- def fix_encoding!(str)
- str
- end
+ def fix_encoding!(str)
+ # Assume we are starting from a "mostly" UTF-8 string
+ str.force_encoding(Encoding::UTF_8)
+ return str if str.valid_encoding?
+ str.encode!(Encoding::UTF_16, :invalid => :replace)
+ str.encode!(Encoding::UTF_8)
end
def resolve_test_tap
@@ -181,7 +171,7 @@ def run
verbose = ARGV.verbose?
# Step may produce arbitrary output and we read it bytewise, so must
# buffer it as binary and convert to UTF-8 once complete
- output = ruby_has_encoding? ? "".encode!("BINARY") : ""
+ output = "".encode!("BINARY")
working_dir = Pathname.new(@command.first == "git" ? @repository : Dir.pwd)
read, write = IO.pipe
@@ -1046,19 +1036,8 @@ def test_bot
def sanitize_output_for_xml(output)
unless output.empty?
# Remove invalid XML CData characters from step output.
- if ruby_has_encoding?
- # This is the regex for valid XML chars, but only works in Ruby 2.0+
- # /[\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}]/
- # For 1.9 compatibility, use the inverse of that, which stays under \u10000
- # invalid_xml_pat = /[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/
- # But Ruby won't allow you to reference surrogates, so we have:
- invalid_xml_pat = /[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/
- output = output.gsub(invalid_xml_pat, "\uFFFD")
- else
- # Invalid XML chars, as far as single-byte chars go
- output = output.delete("\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f" \
- "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f")
- end
+ invalid_xml_pat = /[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}]/
+ output = output.gsub(invalid_xml_pat, "\uFFFD")
# Truncate to 1MB to avoid hitting CI limits
if output.bytesize > MAX_STEP_OUTPUT_SIZE | true |
Other | Homebrew | brew | bf05651a0130c4df1f334a99f515708184e5a133.json | remove ruby 1.8 compatible codes (#742) | Library/Homebrew/extend/fileutils.rb | @@ -65,8 +65,7 @@ def run
Process.gid
end
begin
- # group_id.to_s makes OS X 10.6.7 (ruby-1.8.7-p174) and earlier happy.
- chown(nil, group_id.to_s, tmpdir)
+ chown(nil, group_id, tmpdir)
rescue Errno::EPERM
opoo "Failed setting group \"#{Etc.getgrgid(group_id).name}\" on #{tmpdir}"
end | true |
Other | Homebrew | brew | bf05651a0130c4df1f334a99f515708184e5a133.json | remove ruby 1.8 compatible codes (#742) | Library/Homebrew/extend/pathname.rb | @@ -445,39 +445,7 @@ def install_metafiles(from = Pathname.pwd)
end
end
- # We redefine these private methods in order to add the /o modifier to
- # the Regexp literals, which forces string interpolation to happen only
- # once instead of each time the method is called. This is fixed in 1.9+.
- if RUBY_VERSION <= "1.8.7"
- # @private
- alias_method :old_chop_basename, :chop_basename
-
- def chop_basename(path)
- base = File.basename(path)
- if /\A#{Pathname::SEPARATOR_PAT}?\z/o =~ base
- return nil
- else
- return path[0, path.rindex(base)], base
- end
- end
- private :chop_basename
-
- # @private
- alias_method :old_prepend_prefix, :prepend_prefix
-
- def prepend_prefix(prefix, relpath)
- if relpath.empty?
- File.dirname(prefix)
- elsif /#{SEPARATOR_PAT}/o =~ prefix
- prefix = File.dirname(prefix)
- prefix = File.join(prefix, "") if File.basename(prefix + "a") != "a"
- prefix + relpath
- else
- prefix + relpath
- end
- end
- private :prepend_prefix
- elsif RUBY_VERSION == "2.0.0"
+ if RUBY_VERSION == "2.0.0"
# https://bugs.ruby-lang.org/issues/9915
prepend Module.new {
def inspect | true |
Other | Homebrew | brew | bf05651a0130c4df1f334a99f515708184e5a133.json | remove ruby 1.8 compatible codes (#742) | Library/Homebrew/global.rb | @@ -22,16 +22,8 @@
HOMEBREW_REPOSITORY.extend(GitRepositoryExtension)
-if RbConfig.respond_to?(:ruby)
- RUBY_PATH = Pathname.new(RbConfig.ruby)
-else
- RUBY_PATH = Pathname.new(RbConfig::CONFIG["bindir"]).join(
- RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
- )
-end
+RUBY_PATH = Pathname.new(RbConfig.ruby)
RUBY_BIN = RUBY_PATH.dirname
-RUBY_TWO = RUBY_VERSION.split(".").first.to_i >= 2
-raise "Homebrew must be run under Ruby 2!" unless RUBY_TWO
HOMEBREW_USER_AGENT_CURL = ENV["HOMEBREW_USER_AGENT_CURL"]
HOMEBREW_USER_AGENT_RUBY = "#{ENV["HOMEBREW_USER_AGENT"]} ruby/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" | true |
Other | Homebrew | brew | bf05651a0130c4df1f334a99f515708184e5a133.json | remove ruby 1.8 compatible codes (#742) | Library/Homebrew/utils.rb | @@ -561,11 +561,6 @@ def number_readable(number)
numstr
end
-# True if this version of Ruby supports text encodings in its strings
-def ruby_has_encoding?
- String.method_defined?(:force_encoding)
-end
-
# Truncates a text string to fit within a byte size constraint,
# preserving character encoding validity. The returned string will
# be not much longer than the specified max_bytes, though the exact
@@ -579,13 +574,8 @@ def truncate_text_to_approximate_size(s, max_bytes, options = {})
glue = "\n[...snip...]\n"
max_bytes_in = [max_bytes - glue.bytesize, 1].max
- if ruby_has_encoding?
- bytes = s.dup.force_encoding("BINARY")
- glue_bytes = glue.encode("BINARY")
- else
- bytes = s
- glue_bytes = glue
- end
+ bytes = s.dup.force_encoding("BINARY")
+ glue_bytes = glue.encode("BINARY")
n_front_bytes = (max_bytes_in * front_weight).floor
n_back_bytes = max_bytes_in - n_front_bytes
if n_front_bytes == 0
@@ -599,10 +589,8 @@ def truncate_text_to_approximate_size(s, max_bytes, options = {})
back = bytes[-n_back_bytes..-1]
end
out = front + glue_bytes + back
- if ruby_has_encoding?
- out.force_encoding("UTF-8")
- out.encode!("UTF-16", :invalid => :replace)
- out.encode!("UTF-8")
- end
+ out.force_encoding("UTF-8")
+ out.encode!("UTF-16", :invalid => :replace)
+ out.encode!("UTF-8")
out
end | true |
Other | Homebrew | brew | 6a684f41993f4820b48b7487c32096ea72d4de2f.json | test_formula: add epoch tests | Library/Homebrew/test/test_formula.rb | @@ -583,7 +583,6 @@ def setup_tab_for_prefix(prefix, options = {})
def reset_outdated_versions
f.instance_variable_set(:@outdated_versions, nil)
- f.instance_variable_set(:@outdated_versions_head_fetched, nil)
end
def test_greater_different_tap_installed
@@ -732,4 +731,69 @@ def test_outdated_fetch_head
FileUtils.rm_rf HOMEBREW_CACHE/"testball--git"
FileUtils.rm_rf HOMEBREW_CELLAR/"testball"
end
+
+ def test_outdated_versions_version_scheme_changed
+ @f = formula("testball") do
+ url "foo"
+ version "20141010"
+ version_scheme 1
+ end
+
+ prefix = HOMEBREW_CELLAR.join("testball/0.1")
+ setup_tab_for_prefix(prefix, :versions => { "stable" => "0.1" })
+
+ refute_predicate f.outdated_versions, :empty?
+ ensure
+ prefix.rmtree
+ end
+
+ def test_outdated_versions_mixed_version_schemes
+ @f = formula("testball") do
+ url "foo"
+ version "20141010"
+ version_scheme 3
+ end
+
+ prefix_a = HOMEBREW_CELLAR.join("testball/20141009")
+ setup_tab_for_prefix(prefix_a, :versions => { "stable" => "20141009", "version_scheme" => 1 })
+
+ prefix_b = HOMEBREW_CELLAR.join("testball/2.14")
+ setup_tab_for_prefix(prefix_b, :versions => { "stable" => "2.14", "version_scheme" => 2 })
+
+ refute_predicate f.outdated_versions, :empty?
+ reset_outdated_versions
+
+ prefix_c = HOMEBREW_CELLAR.join("testball/20141009")
+ setup_tab_for_prefix(prefix_c, :versions => { "stable" => "20141009", "version_scheme" => 3 })
+
+ refute_predicate f.outdated_versions, :empty?
+ reset_outdated_versions
+
+ prefix_d = HOMEBREW_CELLAR.join("testball/20141011")
+ setup_tab_for_prefix(prefix_d, :versions => { "stable" => "20141009", "version_scheme" => 3 })
+ assert_predicate f.outdated_versions, :empty?
+ ensure
+ f.rack.rmtree
+ end
+
+ def test_outdated_versions_head_with_version_scheme
+ @f = formula("testball") do
+ url "foo"
+ version "1.0"
+ version_scheme 2
+ end
+
+ head_prefix = HOMEBREW_CELLAR.join("testball/HEAD")
+
+ setup_tab_for_prefix(head_prefix, :versions => { "stable" => "1.0", "version_scheme" => 1 })
+ refute_predicate f.outdated_versions, :empty?
+
+ reset_outdated_versions
+ head_prefix.rmtree
+
+ setup_tab_for_prefix(head_prefix, :versions => { "stable" => "1.0", "version_scheme" => 2 })
+ assert_predicate f.outdated_versions, :empty?
+ ensure
+ head_prefix.rmtree
+ end
end | false |
Other | Homebrew | brew | f085597cbdabab1138c96b7d928b4ae451a50e5d.json | Use epochs in tabs | Library/Homebrew/formula.rb | @@ -436,6 +436,7 @@ def latest_head_prefix
def head_version_outdated?(version, options={})
tab = Tab.for_keg(prefix(version))
+ return true if tab.version_scheme < version_scheme
return true if stable && tab.stable_version && tab.stable_version < stable.version
return true if devel && tab.devel_version && tab.devel_version < devel.version
@@ -1708,6 +1709,9 @@ class << self
# Used for creating new Homebrew versions schemes. For example, if we want
# to change version scheme from one to another, then we may need to update
# `version_scheme` of this {Formula} to be able to use new version scheme.
+ # E.g. to move from 20151020 scheme to 1.0.0 we need to increment
+ # `version_scheme`. Without this, the prior scheme will always equate to a
+ # higher version.
# `0` if unset.
#
# <pre>version_scheme 1</pre> | true |
Other | Homebrew | brew | f085597cbdabab1138c96b7d928b4ae451a50e5d.json | Use epochs in tabs | Library/Homebrew/tab.rb | @@ -37,6 +37,7 @@ def self.create(formula, compiler, stdlib)
"stable" => formula.stable ? formula.stable.version.to_s : nil,
"devel" => formula.devel ? formula.devel.version.to_s : nil,
"head" => formula.head ? formula.head.version.to_s : nil,
+ "version_scheme" => formula.version_scheme,
}
}
}
@@ -78,6 +79,7 @@ def self.from_file_content(content, path)
"stable" => nil,
"devel" => nil,
"head" => nil,
+ "version_scheme" => 0,
}
end
@@ -142,6 +144,7 @@ def self.for_formula(f)
"stable" => f.stable ? f.stable.version.to_s : nil,
"devel" => f.devel ? f.devel.version.to_s : nil,
"head" => f.head ? f.head.version.to_s : nil,
+ "version_scheme" => f.version_scheme,
}
}
end
@@ -168,6 +171,7 @@ def self.empty
"stable" => nil,
"devel" => nil,
"head" => nil,
+ "version_scheme" => 0,
}
}
}
@@ -271,6 +275,10 @@ def head_version
Version.create(versions["head"]) if versions["head"]
end
+ def version_scheme
+ versions["version_scheme"] || 0
+ end
+
def source_modified_time
Time.at(super)
end | true |
Other | Homebrew | brew | e423617d771b934da4c82ab30683d0a05aa20b45.json | remove ruby 1.8 compatible codes | Library/Homebrew/brew.rb | @@ -1,5 +1,9 @@
std_trap = trap("INT") { exit! 130 } # no backtrace thanks
+# check ruby version before requiring any modules.
+RUBY_TWO = RUBY_VERSION.split(".").first.to_i >= 2
+raise "Homebrew must be run under Ruby 2!" unless RUBY_TWO
+
require "pathname"
HOMEBREW_LIBRARY_PATH = Pathname.new(__FILE__).realpath.parent
$:.unshift(HOMEBREW_LIBRARY_PATH.to_s) | true |
Other | Homebrew | brew | e423617d771b934da4c82ab30683d0a05aa20b45.json | remove ruby 1.8 compatible codes | Library/Homebrew/dev-cmd/test-bot.rb | @@ -49,22 +49,12 @@ module Homebrew
HOMEBREW_TAP_REGEX = %r{^([\w-]+)/homebrew-([\w-]+)$}
- if ruby_has_encoding?
- def fix_encoding!(str)
- # Assume we are starting from a "mostly" UTF-8 string
- str.force_encoding(Encoding::UTF_8)
- return str if str.valid_encoding?
- str.encode!(Encoding::UTF_16, :invalid => :replace)
- str.encode!(Encoding::UTF_8)
- end
- elsif require "iconv"
- def fix_encoding!(str)
- Iconv.conv("UTF-8//IGNORE", "UTF-8", str)
- end
- else
- def fix_encoding!(str)
- str
- end
+ def fix_encoding!(str)
+ # Assume we are starting from a "mostly" UTF-8 string
+ str.force_encoding(Encoding::UTF_8)
+ return str if str.valid_encoding?
+ str.encode!(Encoding::UTF_16, :invalid => :replace)
+ str.encode!(Encoding::UTF_8)
end
def resolve_test_tap
@@ -181,7 +171,7 @@ def run
verbose = ARGV.verbose?
# Step may produce arbitrary output and we read it bytewise, so must
# buffer it as binary and convert to UTF-8 once complete
- output = ruby_has_encoding? ? "".encode!("BINARY") : ""
+ output = "".encode!("BINARY")
working_dir = Pathname.new(@command.first == "git" ? @repository : Dir.pwd)
read, write = IO.pipe
@@ -1046,19 +1036,8 @@ def test_bot
def sanitize_output_for_xml(output)
unless output.empty?
# Remove invalid XML CData characters from step output.
- if ruby_has_encoding?
- # This is the regex for valid XML chars, but only works in Ruby 2.0+
- # /[\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}]/
- # For 1.9 compatibility, use the inverse of that, which stays under \u10000
- # invalid_xml_pat = /[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/
- # But Ruby won't allow you to reference surrogates, so we have:
- invalid_xml_pat = /[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/
- output = output.gsub(invalid_xml_pat, "\uFFFD")
- else
- # Invalid XML chars, as far as single-byte chars go
- output = output.delete("\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f" \
- "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f")
- end
+ invalid_xml_pat = /[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}]/
+ output = output.gsub(invalid_xml_pat, "\uFFFD")
# Truncate to 1MB to avoid hitting CI limits
if output.bytesize > MAX_STEP_OUTPUT_SIZE | true |
Other | Homebrew | brew | e423617d771b934da4c82ab30683d0a05aa20b45.json | remove ruby 1.8 compatible codes | Library/Homebrew/extend/fileutils.rb | @@ -65,8 +65,7 @@ def run
Process.gid
end
begin
- # group_id.to_s makes OS X 10.6.7 (ruby-1.8.7-p174) and earlier happy.
- chown(nil, group_id.to_s, tmpdir)
+ chown(nil, group_id, tmpdir)
rescue Errno::EPERM
opoo "Failed setting group \"#{Etc.getgrgid(group_id).name}\" on #{tmpdir}"
end | true |
Other | Homebrew | brew | e423617d771b934da4c82ab30683d0a05aa20b45.json | remove ruby 1.8 compatible codes | Library/Homebrew/extend/pathname.rb | @@ -445,39 +445,7 @@ def install_metafiles(from = Pathname.pwd)
end
end
- # We redefine these private methods in order to add the /o modifier to
- # the Regexp literals, which forces string interpolation to happen only
- # once instead of each time the method is called. This is fixed in 1.9+.
- if RUBY_VERSION <= "1.8.7"
- # @private
- alias_method :old_chop_basename, :chop_basename
-
- def chop_basename(path)
- base = File.basename(path)
- if /\A#{Pathname::SEPARATOR_PAT}?\z/o =~ base
- return nil
- else
- return path[0, path.rindex(base)], base
- end
- end
- private :chop_basename
-
- # @private
- alias_method :old_prepend_prefix, :prepend_prefix
-
- def prepend_prefix(prefix, relpath)
- if relpath.empty?
- File.dirname(prefix)
- elsif /#{SEPARATOR_PAT}/o =~ prefix
- prefix = File.dirname(prefix)
- prefix = File.join(prefix, "") if File.basename(prefix + "a") != "a"
- prefix + relpath
- else
- prefix + relpath
- end
- end
- private :prepend_prefix
- elsif RUBY_VERSION == "2.0.0"
+ if RUBY_VERSION == "2.0.0"
# https://bugs.ruby-lang.org/issues/9915
prepend Module.new {
def inspect | true |
Other | Homebrew | brew | e423617d771b934da4c82ab30683d0a05aa20b45.json | remove ruby 1.8 compatible codes | Library/Homebrew/global.rb | @@ -22,16 +22,8 @@
HOMEBREW_REPOSITORY.extend(GitRepositoryExtension)
-if RbConfig.respond_to?(:ruby)
- RUBY_PATH = Pathname.new(RbConfig.ruby)
-else
- RUBY_PATH = Pathname.new(RbConfig::CONFIG["bindir"]).join(
- RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
- )
-end
+RUBY_PATH = Pathname.new(RbConfig.ruby)
RUBY_BIN = RUBY_PATH.dirname
-RUBY_TWO = RUBY_VERSION.split(".").first.to_i >= 2
-raise "Homebrew must be run under Ruby 2!" unless RUBY_TWO
HOMEBREW_USER_AGENT_CURL = ENV["HOMEBREW_USER_AGENT_CURL"]
HOMEBREW_USER_AGENT_RUBY = "#{ENV["HOMEBREW_USER_AGENT"]} ruby/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" | true |
Other | Homebrew | brew | e423617d771b934da4c82ab30683d0a05aa20b45.json | remove ruby 1.8 compatible codes | Library/Homebrew/utils.rb | @@ -561,11 +561,6 @@ def number_readable(number)
numstr
end
-# True if this version of Ruby supports text encodings in its strings
-def ruby_has_encoding?
- String.method_defined?(:force_encoding)
-end
-
# Truncates a text string to fit within a byte size constraint,
# preserving character encoding validity. The returned string will
# be not much longer than the specified max_bytes, though the exact
@@ -579,13 +574,8 @@ def truncate_text_to_approximate_size(s, max_bytes, options = {})
glue = "\n[...snip...]\n"
max_bytes_in = [max_bytes - glue.bytesize, 1].max
- if ruby_has_encoding?
- bytes = s.dup.force_encoding("BINARY")
- glue_bytes = glue.encode("BINARY")
- else
- bytes = s
- glue_bytes = glue
- end
+ bytes = s.dup.force_encoding("BINARY")
+ glue_bytes = glue.encode("BINARY")
n_front_bytes = (max_bytes_in * front_weight).floor
n_back_bytes = max_bytes_in - n_front_bytes
if n_front_bytes == 0
@@ -599,10 +589,8 @@ def truncate_text_to_approximate_size(s, max_bytes, options = {})
back = bytes[-n_back_bytes..-1]
end
out = front + glue_bytes + back
- if ruby_has_encoding?
- out.force_encoding("UTF-8")
- out.encode!("UTF-16", :invalid => :replace)
- out.encode!("UTF-8")
- end
+ out.force_encoding("UTF-8")
+ out.encode!("UTF-16", :invalid => :replace)
+ out.encode!("UTF-8")
out
end | true |
Other | Homebrew | brew | 9c7f24b84aea4ae1b465afa41445385ada4f2ffb.json | Add permit_weak_imports directive
Issue Homebrew/homebrew-core#3727 suggested we set -no_weak_imports for
new versions of Xcode to ensure that e.g. building on 10.11 against the
10.12 SDK doesn't result in a situation where autotools thinks symbols
exist that don't actually exist on the current platform.
Further discussion in golang/go#16770 revealed that some packages
require weak imports to build normally. | Library/Homebrew/extend/ENV/shared.rb | @@ -293,6 +293,8 @@ def warn_about_non_apple_gcc(name)
def permit_arch_flags; end
+ def permit_weak_imports; end
+
private
def cc=(val) | true |
Other | Homebrew | brew | 9c7f24b84aea4ae1b465afa41445385ada4f2ffb.json | Add permit_weak_imports directive
Issue Homebrew/homebrew-core#3727 suggested we set -no_weak_imports for
new versions of Xcode to ensure that e.g. building on 10.11 against the
10.12 SDK doesn't result in a situation where autotools thinks symbols
exist that don't actually exist on the current platform.
Further discussion in golang/go#16770 revealed that some packages
require weak imports to build normally. | Library/Homebrew/extend/os/mac/extend/ENV/std.rb | @@ -146,4 +146,8 @@ def x11
append "CFLAGS", "-I#{MacOS::X11.include}" unless MacOS::CLT.installed?
end
+
+ def permit_weak_imports
+ remove "LDFLAGS", "-Wl,-no_weak_imports"
+ end
end | true |
Other | Homebrew | brew | 9c7f24b84aea4ae1b465afa41445385ada4f2ffb.json | Add permit_weak_imports directive
Issue Homebrew/homebrew-core#3727 suggested we set -no_weak_imports for
new versions of Xcode to ensure that e.g. building on 10.11 against the
10.12 SDK doesn't result in a situation where autotools thinks symbols
exist that don't actually exist on the current platform.
Further discussion in golang/go#16770 revealed that some packages
require weak imports to build normally. | Library/Homebrew/extend/os/mac/extend/ENV/super.rb | @@ -107,6 +107,10 @@ def set_x11_env_if_installed
ENV.x11 = MacOS::X11.installed?
end
+ def permit_weak_imports
+ remove "HOMEBREW_CCCFG", "w"
+ end
+
# These methods are no longer necessary under superenv, but are needed to
# maintain an interface compatible with stdenv.
alias_method :macosxsdk, :noop | true |
Other | Homebrew | brew | e7c44c90c3fc187e86c6f76296109ecab465bddf.json | Brew-Test-Bot.md: fix broken link | share/doc/homebrew/Brew-Test-Bot.md | @@ -4,7 +4,7 @@ by [our Kickstarter in 2013](https://www.kickstarter.com/projects/homebrew/brew-
It comprises of four Mac Minis running in a data centre in England which host
[a Jenkins instance at http://bot.brew.sh](http://bot.brew.sh) and run the
-[`brew-test-bot.rb`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/cmd/test-bot.rb)
+[`brew test-bot.rb`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/test-bot.rb)
Ruby script to perform automated testing of commits to the master branch, pull
requests and custom builds requested by maintainers.
| false |
Other | Homebrew | brew | 3774b4641f4b001ae651c80e040b3b9959640b78.json | test/Gemfile.lock: remove json pin. | Library/Homebrew/test/Gemfile.lock | @@ -35,11 +35,10 @@ PLATFORMS
DEPENDENCIES
coveralls (= 0.8.14)
- json (~> 1.8)
minitest (~> 5.3)
mocha (~> 1.1)
rake (~> 10.3)
simplecov (= 0.12.0)!
BUNDLED WITH
- 1.11.2
+ 1.12.5 | false |
Other | Homebrew | brew | 823505a0584f5b114ebb29b3d66c5a1ca5ed399b.json | Fix minor issues in command help text formatting
- Inconsistent or unneeded indentation
- Missing or superfluous empty lines
- Missing or wrongly formatted arguments in command summary
- Missing punctuation | Library/Homebrew/cmd/audit.rb | @@ -9,11 +9,11 @@
#:
#: If `--online` is passed, additional slower checks that require a network
#: connection are run.
-#
+#:
#: If `--new-formula` is passed, various additional checks are run that check
#: if a new formula is eligable for Homebrew. This should be used when creating
#: new formulae and implies `--strict` and `--online`.
-#
+#:
#: If `--display-cop-names` is passed, the RuboCop cop name for each violation
#: is included in the output.
#: | true |
Other | Homebrew | brew | 823505a0584f5b114ebb29b3d66c5a1ca5ed399b.json | Fix minor issues in command help text formatting
- Inconsistent or unneeded indentation
- Missing or superfluous empty lines
- Missing or wrongly formatted arguments in command summary
- Missing punctuation | Library/Homebrew/cmd/gist-logs.rb | @@ -1,13 +1,13 @@
#: * `gist-logs` [`--new-issue`|`-n`] <formula>:
-#: Upload logs for a failed build of <formula> to a new Gist.
+#: Upload 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
-#: in several different ways. See [SPECIFYING FORMULAE][].
+#: <formula> is usually the name of the formula to install, but it can be specified
+#: in several different ways. See [SPECIFYING FORMULAE][].
#:
-#: If `--new-issue` is passed, automatically create a new issue in the appropriate
-#: GitHub repository as well as creating the Gist.
+#: If `--new-issue` is passed, automatically create a new issue in the appropriate
+#: GitHub repository as well as creating the Gist.
#:
-#: If no logs are found, an error message is presented.
+#: If no logs are found, an error message is presented.
require "formula"
require "system_config" | true |
Other | Homebrew | brew | 823505a0584f5b114ebb29b3d66c5a1ca5ed399b.json | Fix minor issues in command help text formatting
- Inconsistent or unneeded indentation
- Missing or superfluous empty lines
- Missing or wrongly formatted arguments in command summary
- Missing punctuation | Library/Homebrew/cmd/list.rb | @@ -1,8 +1,7 @@
#: * `list`, `ls` [`--full-name`]:
-#: List all installed formulae. If `--full-name` is passed, print formulae with
-#: fully-qualified names.
-#: If `--full-name` is not passed any other options (e.g. `-t`) are passed to
-#: `ls` which produces the actual output.
+#: List all installed formulae. If `--full-name` is passed, print formulae
+#: with fully-qualified names. If `--full-name` is not passed, any other
+#: options (e.g. `-t`) are passed to `ls` which produces the actual output.
#:
#: * `list`, `ls` `--unbrewed`:
#: List all files in the Homebrew prefix not installed by Homebrew. | true |
Other | Homebrew | brew | 823505a0584f5b114ebb29b3d66c5a1ca5ed399b.json | Fix minor issues in command help text formatting
- Inconsistent or unneeded indentation
- Missing or superfluous empty lines
- Missing or wrongly formatted arguments in command summary
- Missing punctuation | Library/Homebrew/cmd/log.rb | @@ -1,4 +1,4 @@
-#: * `log` [`git-log-options`] <formula> ...:
+#: * `log` [<git-log-options>] <formula> ...:
#: Show the git log for the given formulae. Options that `git-log`(1)
#: recognizes can be passed before the formula list.
| true |
Other | Homebrew | brew | 823505a0584f5b114ebb29b3d66c5a1ca5ed399b.json | Fix minor issues in command help text formatting
- Inconsistent or unneeded indentation
- Missing or superfluous empty lines
- Missing or wrongly formatted arguments in command summary
- Missing punctuation | Library/Homebrew/cmd/missing.rb | @@ -1,7 +1,6 @@
#: * `missing` [<formulae>]:
-#: Check the given <formulae> for missing dependencies.
-#:
-#: If no <formulae> are given, check all installed brews.
+#: Check the given <formulae> for missing dependencies. If no <formulae> are
+#: given, check all installed brews.
require "formula"
require "tab" | true |
Other | Homebrew | brew | 823505a0584f5b114ebb29b3d66c5a1ca5ed399b.json | Fix minor issues in command help text formatting
- Inconsistent or unneeded indentation
- Missing or superfluous empty lines
- Missing or wrongly formatted arguments in command summary
- Missing punctuation | Library/Homebrew/cmd/reinstall.rb | @@ -1,5 +1,5 @@
#: * `reinstall` <formula>:
-#: Uninstall then install <formula>
+#: Uninstall and then install <formula>.
require "formula_installer"
require "development_tools" | true |
Other | Homebrew | brew | 823505a0584f5b114ebb29b3d66c5a1ca5ed399b.json | Fix minor issues in command help text formatting
- Inconsistent or unneeded indentation
- Missing or superfluous empty lines
- Missing or wrongly formatted arguments in command summary
- Missing punctuation | Library/Homebrew/cmd/update.sh | @@ -1,11 +1,12 @@
-#: * `update` [`--merge`]:
+#: * `update` [`--merge`] [`--force`]:
#: Fetch the newest version of Homebrew and all formulae from GitHub using
-#: `git`(1).
+#: `git`(1).
#:
#: If `--merge` is specified then `git merge` is used to include updates
-#: (rather than `git rebase`).
+#: (rather than `git rebase`).
+#:
#: If `--force` is specified then always do a slower, full update check even
-#: if unnecessary.
+#: if unnecessary.
# Hide shellcheck complaint:
# shellcheck source=/dev/null | true |
Other | Homebrew | brew | 823505a0584f5b114ebb29b3d66c5a1ca5ed399b.json | Fix minor issues in command help text formatting
- Inconsistent or unneeded indentation
- Missing or superfluous empty lines
- Missing or wrongly formatted arguments in command summary
- Missing punctuation | Library/Homebrew/dev-cmd/bump-formula-pr.rb | @@ -1,6 +1,5 @@
#: * `bump-formula-pr` [`--devel`] [`--dry-run`] `--url=`<url> `--sha256=`<sha-256> <formula>:
#: * `bump-formula-pr` [`--devel`] [`--dry-run`] `--tag=`<tag> `--revision=`<revision> <formula>:
-#:
#: Creates a pull request to update the formula with a new url or a new tag.
#:
#: If a <url> is specified, the <sha-256> checksum of the new download must | true |
Other | Homebrew | brew | 823505a0584f5b114ebb29b3d66c5a1ca5ed399b.json | Fix minor issues in command help text formatting
- Inconsistent or unneeded indentation
- Missing or superfluous empty lines
- Missing or wrongly formatted arguments in command summary
- Missing punctuation | share/doc/homebrew/brew.1.html | @@ -48,11 +48,13 @@ <h2 id="COMMANDS">COMMANDS</h2>
style checks.</p>
<p>If <code>--online</code> is passed, additional slower checks that require a network
-connection are run.
-If <code>--new-formula</code> is passed, various additional checks are run that check
+connection are run.</p>
+
+<p>If <code>--new-formula</code> is passed, various additional checks are run that check
if a new formula is eligable for Homebrew. This should be used when creating
-new formulae and implies <code>--strict</code> and <code>--online</code>.
-If <code>--display-cop-names</code> is passed, the RuboCop cop name for each violation
+new formulae and implies <code>--strict</code> and <code>--online</code>.</p>
+
+<p>If <code>--display-cop-names</code> is passed, the RuboCop cop name for each violation
is included in the output.</p>
<p>If <code>--display-filename</code> is passed, every line of output is prefixed with the
@@ -168,15 +170,15 @@ <h2 id="COMMANDS">COMMANDS</h2>
<p>If <code>--force-bottle</code> is passed, download a bottle if it exists for the current
version of OS X, even if it would not be used during installation.</p></dd>
-<dt><code>gist-logs</code> [<code>--new-issue</code>|<code>-n</code>] <var>formula</var></dt><dd><p> Upload logs for a failed build of <var>formula</var> to a new Gist.</p>
+<dt><code>gist-logs</code> [<code>--new-issue</code>|<code>-n</code>] <var>formula</var></dt><dd><p>Upload logs for a failed build of <var>formula</var> to a new Gist.</p>
-<p> <var>formula</var> is usually the name of the formula to install, but it can be specified
- in several different ways. See <a href="#SPECIFYING-FORMULAE" title="SPECIFYING FORMULAE" data-bare-link="true">SPECIFYING FORMULAE</a>.</p>
+<p><var>formula</var> is usually the name of the formula to install, but it can be specified
+in several different ways. See <a href="#SPECIFYING-FORMULAE" title="SPECIFYING FORMULAE" data-bare-link="true">SPECIFYING FORMULAE</a>.</p>
-<p> If <code>--new-issue</code> is passed, automatically create a new issue in the appropriate
- GitHub repository as well as creating the Gist.</p>
+<p>If <code>--new-issue</code> is passed, automatically create a new issue in the appropriate
+GitHub repository as well as creating the Gist.</p>
-<p> If no logs are found, an error message is presented.</p></dd>
+<p>If no logs are found, an error message is presented.</p></dd>
<dt class="flush"><code>home</code></dt><dd><p>Open Homebrew's own homepage in a browser.</p></dd>
<dt><code>home</code> <var>formula</var></dt><dd><p>Open <var>formula</var>'s homepage in a browser.</p></dd>
<dt><code>info</code> <var>formula</var></dt><dd><p>Display information about <var>formula</var>.</p></dd>
@@ -263,10 +265,9 @@ <h2 id="COMMANDS">COMMANDS</h2>
<p>If provided, <code>--local</code> will symlink them into the user's <code>~/Applications</code>
directory instead of the system directory.</p></dd>
-<dt><code>list</code>, <code>ls</code> [<code>--full-name</code>]</dt><dd><p>List all installed formulae. If <code>--full-name</code> is passed, print formulae with
-fully-qualified names.
-If <code>--full-name</code> is not passed any other options (e.g. <code>-t</code>) are passed to
-<code>ls</code> which produces the actual output.</p></dd>
+<dt><code>list</code>, <code>ls</code> [<code>--full-name</code>]</dt><dd><p>List all installed formulae. If <code>--full-name</code> is passed, print formulae
+with fully-qualified names. If <code>--full-name</code> is not passed, any other
+options (e.g. <code>-t</code>) are passed to <code>ls</code> which produces the actual output.</p></dd>
<dt><code>list</code>, <code>ls</code> <code>--unbrewed</code></dt><dd><p>List all files in the Homebrew prefix not installed by Homebrew.</p></dd>
<dt><code>list</code>, <code>ls</code> [<code>--versions</code> [<code>--multiple</code>]] [<code>--pinned</code>] [<var>formulae</var>]</dt><dd><p>List the installed files for <var>formulae</var>. Combined with <code>--verbose</code>, recursively
list the contents of all subdirectories in each <var>formula</var>'s keg.</p>
@@ -278,16 +279,15 @@ <h2 id="COMMANDS">COMMANDS</h2>
<p>If <code>--pinned</code> is passed, show the versions of pinned formulae, or only the
specified (pinned) formulae if <var>formulae</var> are given.
See also <code>pin</code>, <code>unpin</code>.</p></dd>
-<dt><code>log</code> [<code>git-log-options</code>] <var>formula</var> ...</dt><dd><p>Show the git log for the given formulae. Options that <code>git-log</code>(1)
+<dt><code>log</code> [<var>git-log-options</var>] <var>formula</var> ...</dt><dd><p>Show the git log for the given formulae. Options that <code>git-log</code>(1)
recognizes can be passed before the formula list.</p></dd>
<dt><code>migrate</code> [<code>--force</code>] <var>formulae</var></dt><dd><p>Migrate renamed packages to new name, where <var>formulae</var> are old names of
packages.</p>
<p>If <code>--force</code> is passed, then treat installed <var>formulae</var> and passed <var>formulae</var>
like if they are from same taps and migrate them anyway.</p></dd>
-<dt><code>missing</code> [<var>formulae</var>]</dt><dd><p>Check the given <var>formulae</var> for missing dependencies.</p>
-
-<p>If no <var>formulae</var> are given, check all installed brews.</p></dd>
+<dt><code>missing</code> [<var>formulae</var>]</dt><dd><p>Check the given <var>formulae</var> for missing dependencies. If no <var>formulae</var> are
+given, check all installed brews.</p></dd>
<dt><code>options</code> [<code>--compact</code>] (<code>--all</code>|<code>--installed</code>|<var>formulae</var>)</dt><dd><p>Display install options specific to <var>formulae</var>.</p>
<p>If <code>--compact</code> is passed, show all options on a single line separated by
@@ -322,7 +322,7 @@ <h2 id="COMMANDS">COMMANDS</h2>
<p>If <code>--dry-run</code> or <code>-n</code> is passed, show what would be removed, but do not
actually remove anything.</p></dd>
-<dt><code>reinstall</code> <var>formula</var></dt><dd><p>Uninstall then install <var>formula</var></p></dd>
+<dt><code>reinstall</code> <var>formula</var></dt><dd><p>Uninstall and then install <var>formula</var>.</p></dd>
<dt><code>search</code>, <code>-S</code></dt><dd><p>Display all locally available formulae for brewing (including tapped ones).
No online search is performed if called without arguments.</p></dd>
<dt><code>search</code> [<code>--desc</code>] <var>text</var>|<code>/</code><var>text</var><code>/</code></dt><dd><p>Perform a substring search of formula names for <var>text</var>. If <var>text</var> is
@@ -438,13 +438,14 @@ <h2 id="COMMANDS">COMMANDS</h2>
<dt><code>unpin</code> <var>formulae</var></dt><dd><p>Unpin <var>formulae</var>, allowing them to be upgraded by <code>brew upgrade</code>. See also
<code>pin</code>.</p></dd>
<dt><code>untap</code> <var>tap</var></dt><dd><p>Remove a tapped repository.</p></dd>
-<dt><code>update</code> [<code>--merge</code>]</dt><dd><p>Fetch the newest version of Homebrew and all formulae from GitHub using
- <code>git</code>(1).</p>
+<dt><code>update</code> [<code>--merge</code>] [<code>--force</code>]</dt><dd><p>Fetch the newest version of Homebrew and all formulae from GitHub using
+<code>git</code>(1).</p>
<p>If <code>--merge</code> is specified then <code>git merge</code> is used to include updates
- (rather than <code>git rebase</code>).
-If <code>--force</code> is specified then always do a slower, full update check even
- if unnecessary.</p></dd>
+(rather than <code>git rebase</code>).</p>
+
+<p>If <code>--force</code> is specified then always do a slower, full update check even
+if unnecessary.</p></dd>
<dt><code>upgrade</code> [<var>install-options</var>] [<code>--cleanup</code>] [<code>--fetch-HEAD</code>] [<var>formulae</var>]</dt><dd><p>Upgrade outdated, unpinned brews.</p>
<p>Options for the <code>install</code> command are also valid here.</p> | true |
Other | Homebrew | brew | 823505a0584f5b114ebb29b3d66c5a1ca5ed399b.json | Fix minor issues in command help text formatting
- Inconsistent or unneeded indentation
- Missing or superfluous empty lines
- Missing or wrongly formatted arguments in command summary
- Missing punctuation | share/man/man1/brew.1 | @@ -66,7 +66,13 @@ If no \fIformulae\fR are provided, all of them are checked\.
If \fB\-\-strict\fR is passed, additional checks are run, including RuboCop style checks\.
.
.IP
-If \fB\-\-online\fR is passed, additional slower checks that require a network connection are run\. If \fB\-\-new\-formula\fR is passed, various additional checks are run that check if a new formula is eligable for Homebrew\. This should be used when creating new formulae and implies \fB\-\-strict\fR and \fB\-\-online\fR\. If \fB\-\-display\-cop\-names\fR is passed, the RuboCop cop name for each violation is included in the output\.
+If \fB\-\-online\fR is passed, additional slower checks that require a network connection are run\.
+.
+.IP
+If \fB\-\-new\-formula\fR is passed, various additional checks are run that check if a new formula is eligable for Homebrew\. This should be used when creating new formulae and implies \fB\-\-strict\fR and \fB\-\-online\fR\.
+.
+.IP
+If \fB\-\-display\-cop\-names\fR is passed, the RuboCop cop name for each violation is included in the output\.
.
.IP
If \fB\-\-display\-filename\fR is passed, every line of output is prefixed with the name of the file or formula being audited, to make the output easy to grep\.
@@ -344,7 +350,7 @@ If provided, \fB\-\-local\fR will symlink them into the user\'s \fB~/Application
.
.TP
\fBlist\fR, \fBls\fR [\fB\-\-full\-name\fR]
-List all installed formulae\. If \fB\-\-full\-name\fR is passed, print formulae with fully\-qualified names\. If \fB\-\-full\-name\fR is not passed any other options (e\.g\. \fB\-t\fR) are passed to \fBls\fR which produces the actual output\.
+List all installed formulae\. If \fB\-\-full\-name\fR is passed, print formulae with fully\-qualified names\. If \fB\-\-full\-name\fR is not passed, any other options (e\.g\. \fB\-t\fR) are passed to \fBls\fR which produces the actual output\.
.
.TP
\fBlist\fR, \fBls\fR \fB\-\-unbrewed\fR
@@ -361,7 +367,7 @@ If \fB\-\-versions\fR is passed, show the version number for installed formulae,
If \fB\-\-pinned\fR is passed, show the versions of pinned formulae, or only the specified (pinned) formulae if \fIformulae\fR are given\. See also \fBpin\fR, \fBunpin\fR\.
.
.TP
-\fBlog\fR [\fBgit\-log\-options\fR] \fIformula\fR \.\.\.
+\fBlog\fR [\fIgit\-log\-options\fR] \fIformula\fR \.\.\.
Show the git log for the given formulae\. Options that \fBgit\-log\fR(1) recognizes can be passed before the formula list\.
.
.TP
@@ -373,10 +379,7 @@ If \fB\-\-force\fR is passed, then treat installed \fIformulae\fR and passed \fI
.
.TP
\fBmissing\fR [\fIformulae\fR]
-Check the given \fIformulae\fR for missing dependencies\.
-.
-.IP
-If no \fIformulae\fR are given, check all installed brews\.
+Check the given \fIformulae\fR for missing dependencies\. If no \fIformulae\fR are given, check all installed brews\.
.
.TP
\fBoptions\fR [\fB\-\-compact\fR] (\fB\-\-all\fR|\fB\-\-installed\fR|\fIformulae\fR)
@@ -423,7 +426,7 @@ If \fB\-\-dry\-run\fR or \fB\-n\fR is passed, show what would be removed, but do
.
.TP
\fBreinstall\fR \fIformula\fR
-Uninstall then install \fIformula\fR
+Uninstall and then install \fIformula\fR\.
.
.TP
\fBsearch\fR, \fB\-S\fR
@@ -593,11 +596,14 @@ Unpin \fIformulae\fR, allowing them to be upgraded by \fBbrew upgrade\fR\. See a
Remove a tapped repository\.
.
.TP
-\fBupdate\fR [\fB\-\-merge\fR]
+\fBupdate\fR [\fB\-\-merge\fR] [\fB\-\-force\fR]
Fetch the newest version of Homebrew and all formulae from GitHub using \fBgit\fR(1)\.
.
.IP
-If \fB\-\-merge\fR is specified then \fBgit merge\fR is used to include updates (rather than \fBgit rebase\fR)\. If \fB\-\-force\fR is specified then always do a slower, full update check even if unnecessary\.
+If \fB\-\-merge\fR is specified then \fBgit merge\fR is used to include updates (rather than \fBgit rebase\fR)\.
+.
+.IP
+If \fB\-\-force\fR is specified then always do a slower, full update check even if unnecessary\.
.
.TP
\fBupgrade\fR [\fIinstall\-options\fR] [\fB\-\-cleanup\fR] [\fB\-\-fetch\-HEAD\fR] [\fIformulae\fR] | true |
Other | Homebrew | brew | 560918356738ee71aa7e7110d0e8aa6c8b3dbe4f.json | superenv: add LDFLAGS if disabling weak imports. | Library/Homebrew/extend/os/mac/extend/ENV/super.rb | @@ -81,6 +81,10 @@ def determine_cccfg
s << "s" if MacOS.version >= :mountain_lion
# Fix issue with >= 10.8 apr-1-config having broken paths
s << "a" if MacOS.version >= :mountain_lion
+ # Xcode 8 should be told to fail to link against weak links
+ # Issue from Apple engineer:
+ # https://github.com/Homebrew/homebrew-core/issues/3727
+ s << "w" if no_weak_imports?
s
end
| true |
Other | Homebrew | brew | 560918356738ee71aa7e7110d0e8aa6c8b3dbe4f.json | superenv: add LDFLAGS if disabling weak imports. | Library/Homebrew/shims/super/cc | @@ -258,8 +258,10 @@ class Cmd
case mode
when :ld
args << "-headerpad_max_install_names"
+ args << "-no_weak_imports" if no_weak_imports?
when :ccld, :cxxld
args << "-Wl,-headerpad_max_install_names"
+ args << "-Wl,-no_weak_imports" if no_weak_imports?
end
args
end
@@ -305,6 +307,10 @@ class Cmd
config.include?("K")
end
+ def no_weak_imports?
+ config.include?("w")
+ end
+
def canonical_path(path)
path = Pathname.new(path)
path = path.realpath if path.exist? | true |
Other | Homebrew | brew | 53d1000739bc29913ab956cff2748428b66f969d.json | ENV/std: add LDFLAGS if disabling weak imports. | Library/Homebrew/extend/os/mac/extend/ENV/std.rb | @@ -28,6 +28,11 @@ def setup_build_environment(formula = nil)
# depend on it already being installed to build itself.
ld64 if Formula["ld64"].installed?
end
+
+ # Xcode 8 should be told to fail to link against weak links
+ # Issue from Apple engineer:
+ # https://github.com/Homebrew/homebrew-core/issues/3727
+ append "LDFLAGS", "-Wl,-no_weak_imports" if no_weak_imports?
end
def homebrew_extra_pkg_config_paths | false |
Other | Homebrew | brew | b33fe79478992da827317111370ab15d280e72c5.json | mac/ENV/shared: add check for disabling weak imports. | Library/Homebrew/extend/os/mac/extend/ENV/shared.rb | @@ -1,2 +1,6 @@
module SharedEnvExtension
+ def no_weak_imports?
+ return false unless compiler == :clang
+ MacOS::Xcode.version >= "8.0" || MacOS::CLT.version >= "8.0"
+ end
end | false |
Other | Homebrew | brew | 74d4479246778ff73756fce2208ef04f2c45aafb.json | Add OS X-specific SharedEnvExtension. | Library/Homebrew/extend/ENV/shared.rb | @@ -329,3 +329,5 @@ def gcc_with_cxx11_support?(cc)
version && Version.create(version) >= Version.create("4.8")
end
end
+
+require "extend/os/extend/ENV/shared" | true |
Other | Homebrew | brew | 74d4479246778ff73756fce2208ef04f2c45aafb.json | Add OS X-specific SharedEnvExtension. | Library/Homebrew/extend/os/extend/ENV/shared.rb | @@ -0,0 +1,5 @@
+require "extend/ENV/shared"
+
+if OS.mac?
+ require "extend/os/mac/extend/ENV/shared"
+end | true |
Other | Homebrew | brew | 74d4479246778ff73756fce2208ef04f2c45aafb.json | Add OS X-specific SharedEnvExtension. | Library/Homebrew/extend/os/mac/extend/ENV/shared.rb | @@ -0,0 +1,2 @@
+module SharedEnvExtension
+end | true |
Other | Homebrew | brew | c6151951d6b685936adb8819db3957b12c95f5c9.json | cmd/postinstall: use Sandbox.formula? method. | Library/Homebrew/cmd/postinstall.rb | @@ -21,12 +21,10 @@ def run_post_install(formula)
args << "--devel"
end
- if Sandbox.available? && ARGV.sandbox?
- Sandbox.print_sandbox_message
- end
+ Sandbox.print_sandbox_message if Sandbox.formula?(formula)
Utils.safe_fork do
- if Sandbox.available? && ARGV.sandbox?
+ if Sandbox.formula?(formula)
sandbox = Sandbox.new
formula.logs.mkpath
sandbox.record_log(formula.logs/"sandbox.postinstall.log") | false |
Other | Homebrew | brew | 6375adc0ff00073740b49973aacfe81d4cd1099e.json | formula_installer: use Sandbox.formula? method. | Library/Homebrew/formula_installer.rb | @@ -588,15 +588,13 @@ def build
#{formula.path}
].concat(build_argv)
- if Sandbox.available? && ARGV.sandbox?
- Sandbox.print_sandbox_message
- end
+ Sandbox.print_sandbox_message if Sandbox.formula?(formula)
Utils.safe_fork do
# Invalidate the current sudo timestamp in case a build script calls sudo
system "/usr/bin/sudo", "-k"
- if Sandbox.available? && ARGV.sandbox?
+ if Sandbox.formula?(formula)
sandbox = Sandbox.new
formula.logs.mkpath
sandbox.record_log(formula.logs/"sandbox.build.log") | false |
Other | Homebrew | brew | 6e887fbf5ac5bc1fb551a3e4222ad1804b490def.json | sandbox: add formula? method and sandbox core.
Add a new `Sandbox.formula?` method to see if a given formula should be
sandboxed. Use the formula to check its tap against a list of
pre-approved taps where we know every formula builds under the sandbox
(currently just homebrew/core). | Library/Homebrew/sandbox.rb | @@ -3,11 +3,19 @@
class Sandbox
SANDBOX_EXEC = "/usr/bin/sandbox-exec".freeze
+ SANDBOXED_TAPS = [
+ "homebrew/core",
+ ].freeze
def self.available?
OS.mac? && File.executable?(SANDBOX_EXEC)
end
+ def self.formula?(formula)
+ return false unless available?
+ ARGV.sandbox? || SANDBOXED_TAPS.include?(formula.tap.to_s)
+ end
+
def self.test?
return false unless available?
!ARGV.no_sandbox? | true |
Other | Homebrew | brew | 6e887fbf5ac5bc1fb551a3e4222ad1804b490def.json | sandbox: add formula? method and sandbox core.
Add a new `Sandbox.formula?` method to see if a given formula should be
sandboxed. Use the formula to check its tap against a list of
pre-approved taps where we know every formula builds under the sandbox
(currently just homebrew/core). | Library/Homebrew/test/test_sandbox.rb | @@ -13,6 +13,22 @@ def teardown
@dir.rmtree
end
+ def test_formula?
+ f = formula { url "foo-1.0" }
+ f2 = formula { url "bar-1.0" }
+ f2.stubs(:tap).returns(Tap.fetch("test/tap"))
+
+ ARGV.stubs(:sandbox?).returns true
+ assert Sandbox.formula?(f),
+ "Formulae should be sandboxed if --sandbox was passed."
+
+ ARGV.stubs(:sandbox?).returns false
+ assert Sandbox.formula?(f),
+ "Formulae should be sandboxed if in a sandboxed tap."
+ refute Sandbox.formula?(f2),
+ "Formulae should not be sandboxed if not in a sandboxed tap."
+ end
+
def test_test?
ARGV.stubs(:no_sandbox?).returns false
assert Sandbox.test?, | true |
Other | Homebrew | brew | fed96385acc2ee10909870997950f2e48a86026f.json | sandbox: add test? method.
Simplify checking if we’re going to sandbox a test with `Sandbox.test?`. | Library/Homebrew/sandbox.rb | @@ -8,6 +8,11 @@ def self.available?
OS.mac? && File.executable?(SANDBOX_EXEC)
end
+ def self.test?
+ return false unless available?
+ !ARGV.no_sandbox?
+ end
+
def self.print_sandbox_message
unless @printed_sandbox_message
ohai "Using the sandbox" | true |
Other | Homebrew | brew | fed96385acc2ee10909870997950f2e48a86026f.json | sandbox: add test? method.
Simplify checking if we’re going to sandbox a test with `Sandbox.test?`. | Library/Homebrew/test/test_sandbox.rb | @@ -13,6 +13,12 @@ def teardown
@dir.rmtree
end
+ def test_test?
+ ARGV.stubs(:no_sandbox?).returns false
+ assert Sandbox.test?,
+ "Tests should be sandboxed unless --no-sandbox was passed."
+ end
+
def test_allow_write
@sandbox.allow_write @file
@sandbox.exec "touch", @file | true |
Other | Homebrew | brew | b40b072ed8486f91f3951bdd19bea3f04af3e75b.json | tab: fix Tab.for_formula versions (#687)
versions should be initialized even if formula is not installed | Library/Homebrew/tab.rb | @@ -138,6 +138,11 @@ def self.for_formula(f)
"path" => f.path.to_s,
"tap" => f.tap ? f.tap.name : f.tap,
"spec" => f.active_spec_sym.to_s,
+ "versions" => {
+ "stable" => f.stable ? f.stable.version.to_s : nil,
+ "devel" => f.devel ? f.devel.version.to_s : nil,
+ "head" => f.head ? f.head.version.to_s : nil,
+ }
}
end
| false |
Other | Homebrew | brew | 13dcdb3098d6c1089db937d5c122cf06a0631ac4.json | test_gpg2_requirement: add satisfied test | Library/Homebrew/test/test_gpg2_requirement.rb | @@ -0,0 +1,24 @@
+require "testing_env"
+require "requirements/gpg2_requirement"
+require "fileutils"
+
+class GPG2RequirementTests < Homebrew::TestCase
+ def setup
+ @dir = Pathname.new(mktmpdir)
+ (@dir/"bin/gpg").write <<-EOS.undent
+ #!/bin/bash
+ echo 2.0.30
+ EOS
+ FileUtils.chmod 0755, @dir/"bin/gpg"
+ end
+
+ def teardown
+ FileUtils.rm_rf @dir
+ end
+
+ def test_satisfied
+ with_environment("PATH" => @dir/"bin") do
+ assert_predicate GPG2Requirement.new, :satisfied?
+ end
+ end
+end | false |
Other | Homebrew | brew | 15916338888e48e70edc4ade7f0aff94e3607e76.json | gpg_requirement: add standalone requirement
GPG 1.x has stopped receiving new features, some of which we may well want to
take advantage of sooner or later in Homebrew. Upstream has also been attempting
to work out for a while how well used it still is which suggests it may "go away"
at some point in the future.
Debian is also in the process of migrating GnuPG 1.x to a `gpg1` executable
whilst GnuPG 2.1.x assumes the `gpg` executable. There's a detailed video
discussion of this from DebConf 2015 at:
http://meetings-archive.debian.net/pub/debian-meetings/2015/debconf15/GnuPG_in_Debian_report.webm
It's unsafe to assume every `gpg` executable is going to forever equal 1.x and
every `gpg2` executable is going to forever equal 2.x. MacGPG2 has been symlinking
2.x as a vanilla `gpg` for a while, for example, and we will be soon as well.
You'll still be able to plonk the `libexec/bin` path of `gpg` in your PATH to
access a vanilla `gpg` 1.x executable if you want to, but we're not going to
actively keep adding gpg1 support to formulae going forwards. There's really no
reason why 99.9% of projects should not or cannot use `gpg2` these days.
This uses detection methods to determine regardless of what the executable
is called we're always hitting a 2.0 GnuPG or nothing. | Library/Homebrew/requirements.rb | @@ -1,6 +1,7 @@
require "requirement"
require "requirements/apr_requirement"
require "requirements/fortran_requirement"
+require "requirements/gpg_requirement"
require "requirements/language_module_requirement"
require "requirements/minimum_macos_requirement"
require "requirements/maximum_macos_requirement" | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.