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 | 0a2dd832b932d492c23d2a2b6d06baa3d5879e79.json | Install specific Rubocop version.
Closes Homebrew/homebrew#39620. | Library/Homebrew/cmd/style.rb | @@ -6,7 +6,7 @@ def style
ARGV.formulae.map(&:path)
end
- Homebrew.install_gem_setup_path! "rubocop"
+ Homebrew.install_gem_setup_path! "rubocop", "0.31.0"
args = [
"--format", "simple", "--config", | true |
Other | Homebrew | brew | 0a2dd832b932d492c23d2a2b6d06baa3d5879e79.json | Install specific Rubocop version.
Closes Homebrew/homebrew#39620. | Library/Homebrew/utils.rb | @@ -121,13 +121,16 @@ def self.git_last_commit
HOMEBREW_REPOSITORY.cd { `git show -s --format="%cr" HEAD 2>/dev/null`.chuzzle }
end
- def self.install_gem_setup_path! gem, executable=gem
+ def self.install_gem_setup_path! gem, version=nil, executable=gem
require "rubygems"
ENV["PATH"] = "#{Gem.use... | true |
Other | Homebrew | brew | d78686b42102bd25ecade0ac9006dc9baf150c39.json | SUPPORTERS.md: add another backer URL. | SUPPORTERS.md | @@ -445,7 +445,7 @@ These wonderful people supported our Kickstarter by giving us £10 or more:
* [Slobodan Miskovic](https://miskovic.ca)
* [Kurt Ostergaard](http://KurtOstergaard.com)
* [Simply Business](http://www.simplybusiness.co.uk/)
-* Tate Johnson
+* [Tate Johnson](http://tatey.com)
* [Gerry Cardinal III](ht... | false |
Other | Homebrew | brew | 64c092708747eb6d989430ba947b9378b5aab59e.json | sandbox: fix the rules
1. `script` (used to fake the tty) requires write access to /dev/ptmx
and /dev/ttys*
2. sandbox profile only accepts `[0-9]` instead of `\d`. | Library/Homebrew/sandbox.rb | @@ -110,10 +110,11 @@ class SandboxProfile
(debug deny) ; log all denied operations to /var/log/system.log
<%= rules.join("\n") %>
(allow file-write*
+ (literal "/dev/ptmx")
(literal "/dev/dtracehelper")
(literal "/dev/null")
- (regex #"^/dev/fd/\\d+$")
- ... | false |
Other | Homebrew | brew | 41ecce78982e9e1ca6ece946005dbd7a79c72e95.json | Push URL audits down to ResourceAuditor | Library/Homebrew/cmd/audit.rb | @@ -313,119 +313,6 @@ def audit_urls
if homepage =~ %r[^http://((?:build|cloud|developer|download|extensions|git|glade|help|library|live|nagios|news|people|projects|rt|static|wiki|www)\.)?gnome\.org]
problem "Gnome homepages should be https:// links (URL is #{homepage})."
end
-
- urls = @specs.map(&... | false |
Other | Homebrew | brew | 5c414dca5b5affb374bb5409b6d5564a448498dd.json | add audit check for explicit Python linkage
Verifies that CPython extension modules are not explicitly linked to a
Python framework, which should never be necessary.
Python's distutils uses -undefined dynamic_lookup, as seen here:
https://github.com/python/cpython/blob/9a77656/configure.ac#L2214-L2245
Closes Homebre... | Library/Homebrew/formula_cellar_checks.rb | @@ -156,6 +156,23 @@ def check_openssl_links
EOS
end
+ def check_python_framework_links lib
+ python_modules = Pathname.glob lib/"python*/site-packages/**/*.so"
+ framework_links = python_modules.select do |obj|
+ dlls = obj.dynamically_linked_libraries
+ dlls.any? { |dll| /Python\.framework/... | false |
Other | Homebrew | brew | 86612c253db302a4e5e2c4790f1cadc1d31812c6.json | anticipate python 3.5 in .pth audit | Library/Homebrew/formula_cellar_checks.rb | @@ -127,7 +127,7 @@ def check_shadowed_headers
end
def check_easy_install_pth lib
- pth_found = Dir["#{lib}/python{2.7,3.4}/site-packages/easy-install.pth"].map { |f| File.dirname(f) }
+ pth_found = Dir["#{lib}/python{2.7,3}*/site-packages/easy-install.pth"].map { |f| File.dirname(f) }
return if pth_... | false |
Other | Homebrew | brew | 83bcde23170ceed42f6b86b5ea66a5ce20e00ff4.json | Update links to GitHub's personal access token
The link for the page that allows creation of API tokens has changed
from /settings/applications to /settings/tokens. Also the wording
on that page calls them "personal access tokens", so update
Homebrew to be consistent with that.
Closes Homebrew/homebrew#39378.
Signed... | Library/Homebrew/cmd/gist-logs.rb | @@ -27,7 +27,7 @@ def gistify_logs f
auth = :AUTH_TOKEN
unless HOMEBREW_GITHUB_API_TOKEN
- puts 'You can create an API token: https://github.com/settings/applications'
+ puts 'You can create a personal access token: https://github.com/settings/tokens'
puts 'and then set HOMEBREW_G... | true |
Other | Homebrew | brew | 83bcde23170ceed42f6b86b5ea66a5ce20e00ff4.json | Update links to GitHub's personal access token
The link for the page that allows creation of API tokens has changed
from /settings/applications to /settings/tokens. Also the wording
on that page calls them "personal access tokens", so update
Homebrew to be consistent with that.
Closes Homebrew/homebrew#39378.
Signed... | Library/Homebrew/manpages/brew.1.md | @@ -554,8 +554,8 @@ can take several different forms:
editors will do strange things in this case.
* HOMEBREW\_GITHUB\_API\_TOKEN:
- A personal GitHub API Access token, which you can create at
- <https://github.com/settings/applications>. If set, GitHub will allow you a
+ A personal access token for ... | true |
Other | Homebrew | brew | 83bcde23170ceed42f6b86b5ea66a5ce20e00ff4.json | Update links to GitHub's personal access token
The link for the page that allows creation of API tokens has changed
from /settings/applications to /settings/tokens. Also the wording
on that page calls them "personal access tokens", so update
Homebrew to be consistent with that.
Closes Homebrew/homebrew#39378.
Signed... | Library/Homebrew/utils.rb | @@ -332,7 +332,7 @@ def initialize(error)
super <<-EOS.undent
GitHub #{error}
HOMEBREW_GITHUB_API_TOKEN may be invalid or expired, check:
- https://github.com/settings/applications
+ https://github.com/settings/tokens
EOS
end
end | true |
Other | Homebrew | brew | 83bcde23170ceed42f6b86b5ea66a5ce20e00ff4.json | Update links to GitHub's personal access token
The link for the page that allows creation of API tokens has changed
from /settings/applications to /settings/tokens. Also the wording
on that page calls them "personal access tokens", so update
Homebrew to be consistent with that.
Closes Homebrew/homebrew#39378.
Signed... | share/man/man1/brew.1 | @@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BREW" "1" "April 2015" "Homebrew" "brew"
+.TH "BREW" "1" "May 2015" "Homebrew" "brew"
.
.SH "NAME"
\fBbrew\fR \- The missing package manager for OS X
@@ -579,7 +579,7 @@ If set, Homebrew will use this editor when... | true |
Other | Homebrew | brew | 241831e263fc87bce3205204e296f11374878872.json | Add upgrade --all flag to bash completion script
Closes Homebrew/homebrew#39359.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Contributions/brew_bash_completion.sh | @@ -413,6 +413,7 @@ _brew_upgrade ()
case "$cur" in
--*)
__brewcomp "
+ --all
--build-from-source --build-bottle --force-bottle
--debug
--verbose | false |
Other | Homebrew | brew | 2e3a0263d4c91525dbb907122c87e90af75c20a2.json | audit: require https for all *.googlecode.com resources
Closes Homebrew/homebrew#39206.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/audit.rb | @@ -381,6 +381,8 @@ def audit_urls
end
# Check for Google Code download urls, https:// is preferred
+ # Intentionally not extending this to SVN repositories due to certificate
+ # issues.
urls.grep(%r[^http://.*\.googlecode\.com/files.*]) do |u|
problem "Use https:// URLs for downloads fro... | false |
Other | Homebrew | brew | 74ea4bd31c44fec56b76aa0e6816003322e905d6.json | fileutils: use rm_rf to clean temp dir
Honestly, I don't know why git is broken under sandbox. But this seems
fix the problem in Homebrew/homebrew#38978.
Closes Homebrew/homebrew#39138.
Signed-off-by: Xu Cheng <xucheng@me.com> | Library/Homebrew/extend/fileutils.rb | @@ -19,7 +19,7 @@ def mktemp(prefix=name)
cd(prev)
end
ensure
- ignore_interrupts { rm_r(tmp) }
+ ignore_interrupts { rm_rf(tmp) }
end
end
module_function :mktemp | false |
Other | Homebrew | brew | fe588311cc7894818d6a6e9a8d916d26c47a0b47.json | Use predicate method | Library/Homebrew/cmd/test-bot.rb | @@ -147,7 +147,7 @@ def run
File.write(log_file_path, @output) if ARGV.include? "--keep-logs"
end
- exit 1 if ARGV.include?("--fail-fast") && @status == :failed
+ exit 1 if ARGV.include?("--fail-fast") && failed?
end
private | false |
Other | Homebrew | brew | a14085acd31b06bcac7b12c8d36b5951a2f71033.json | Default HOMEBREW_TEMP to Dir.tmpdir | Library/Homebrew/config.rb | @@ -49,7 +49,7 @@ def mkpath
HOMEBREW_LOGS = Pathname.new(ENV['HOMEBREW_LOGS'] || '~/Library/Logs/Homebrew/').expand_path
-HOMEBREW_TEMP = Pathname.new(ENV.fetch('HOMEBREW_TEMP', '/tmp'))
+HOMEBREW_TEMP = Pathname.new(ENV["HOMEBREW_TEMP"] || Dir.tmpdir)
if not defined? HOMEBREW_LIBRARY_PATH
HOMEBREW_LIBRARY_... | false |
Other | Homebrew | brew | ba26567b0309d70030df9929d949c7988b250c4c.json | Manage sandbox test resources in setup/teardown | Library/Homebrew/test/test_sandbox.rb | @@ -4,25 +4,25 @@
class SandboxTest < Homebrew::TestCase
def setup
skip "sandbox not implemented" unless Sandbox.available?
+ @sandbox = Sandbox.new
+ @dir = Pathname.new(Dir.mktmpdir)
+ @file = @dir/"foo"
+ end
+
+ def teardown
+ @dir.rmtree
end
def test_allow_write
- s = Sandbox.new
... | false |
Other | Homebrew | brew | ff34b1af3b0baf0ab64b3ad7bc2ec8972a8f3527.json | manpage: add missing document
Closes Homebrew/homebrew#38351.
Closes Homebrew/homebrew#38960.
Signed-off-by: Xu Cheng <xucheng@me.com> | Library/Homebrew/manpages/brew.1.md | @@ -94,7 +94,7 @@ Note that these flags should only appear after a command.
The options `--set-name` and `--set-version` each take an argument and allow
you to explicitly set the name and version of the package you are creating.
- * `deps [--1] [-n] [--union] [--tree] [--all] [--installed]` <formulae>:
+ ... | true |
Other | Homebrew | brew | ff34b1af3b0baf0ab64b3ad7bc2ec8972a8f3527.json | manpage: add missing document
Closes Homebrew/homebrew#38351.
Closes Homebrew/homebrew#38960.
Signed-off-by: Xu Cheng <xucheng@me.com> | share/man/man1/brew.1 | @@ -101,7 +101,7 @@ If \fB\-\-no\-fetch\fR is passed, Homebrew will not download \fIURL\fR to the ca
The options \fB\-\-set\-name\fR and \fB\-\-set\-version\fR each take an argument and allow you to explicitly set the name and version of the package you are creating\.
.
.TP
-\fBdeps [\-\-1] [\-n] [\-\-union] [\-\-tr... | true |
Other | Homebrew | brew | cac6f2f07079c28450240800ba2ffd3b4104ea35.json | Fix variable name | Library/Homebrew/cmd/test.rb | @@ -38,7 +38,7 @@ def test
Utils.safe_fork do
if Sandbox.available? && ARGV.sandbox?
sandbox = Sandbox.new
- formula.logs.mkpath
+ f.logs.mkpath
sandbox.record_log(f.logs/"sandbox.test.log")
sandbox.allow_write_temp_and_cache
... | false |
Other | Homebrew | brew | b42259f628eb6c7452b3d54b54b1fbd699c8c794.json | Fix variable name | Library/Homebrew/cmd/test.rb | @@ -39,7 +39,7 @@ def test
if Sandbox.available? && ARGV.sandbox?
sandbox = Sandbox.new
formula.logs.mkpath
- sandbox.record_log(formula.logs/"sandbox.test.log")
+ sandbox.record_log(f.logs/"sandbox.test.log")
sandbox.allow_write_temp_and_cache
... | false |
Other | Homebrew | brew | c72505925184d305387ba6fab40c9501e7b3881b.json | upgrade: announce usage of --all.
Tell users that we will soon be migrating `--all` so it is required if
you wish to upgrade all formulae.
Closes Homebrew/homebrew#38572. | Library/Homebrew/cmd/upgrade.rb | @@ -5,10 +5,17 @@ module Homebrew
def upgrade
Homebrew.perform_preinstall_checks
- if ARGV.named.empty?
+ if ARGV.include?("--all") || ARGV.named.empty?
+ unless ARGV.include? "--all"
+ opoo <<-EOS.undent
+ brew upgrade with no arguments will change behaviour soon!
+ It cur... | true |
Other | Homebrew | brew | c72505925184d305387ba6fab40c9501e7b3881b.json | upgrade: announce usage of --all.
Tell users that we will soon be migrating `--all` so it is required if
you wish to upgrade all formulae.
Closes Homebrew/homebrew#38572. | Library/Homebrew/manpages/brew.1.md | @@ -390,11 +390,15 @@ Note that these flags should only appear after a command.
If `--rebase` is specified then `git pull --rebase` is used.
- * `upgrade [install-options]` [<formulae>]:
+ * `upgrade [--all] [install-options]` [<formulae>]:
Upgrade outdated, unpinned brews.
Options for the `insta... | true |
Other | Homebrew | brew | c72505925184d305387ba6fab40c9501e7b3881b.json | upgrade: announce usage of --all.
Tell users that we will soon be migrating `--all` so it is required if
you wish to upgrade all formulae.
Closes Homebrew/homebrew#38572. | share/man/man1/brew.1 | @@ -415,13 +415,16 @@ Fetch the newest version of Homebrew and all formulae from GitHub using \fBgit\f
If \fB\-\-rebase\fR is specified then \fBgit pull \-\-rebase\fR is used\.
.
.TP
-\fBupgrade [install\-options]\fR [\fIformulae\fR]
+\fBupgrade [\-\-all] [install\-options]\fR [\fIformulae\fR]
Upgrade outdated, unp... | true |
Other | Homebrew | brew | 8fe0b5681056fe2540aba05721bfc6cde363e8d8.json | Add support for extracting LHA archives | Library/Homebrew/download_strategy.rb | @@ -63,6 +63,10 @@ def lzippath
"#{HOMEBREW_PREFIX}/opt/lzip/bin/lzip"
end
+ def lhapath
+ "#{HOMEBREW_PREFIX}/opt/lha/bin/lha"
+ end
+
def cvspath
@cvspath ||= %W[
/usr/bin/cvs
@@ -192,6 +196,8 @@ def stage
when :lzip
with_system_path { pipe_to_tar(lzippath) }
chdir
+ ... | true |
Other | Homebrew | brew | 8fe0b5681056fe2540aba05721bfc6cde363e8d8.json | Add support for extracting LHA archives | Library/Homebrew/extend/pathname.rb | @@ -211,6 +211,8 @@ def compression_type
return :gzip_only
when ".bz2"
return :bzip2_only
+ when ".lha", ".lzh"
+ return :lha
end
# Get enough of the file to detect common file types | true |
Other | Homebrew | brew | 1f80d93d1b7921e35c8cfefcf7f6fbc1bb907a44.json | Acceptable-Formulae.md: fix a space. | share/doc/homebrew/Acceptable-Formulae.md | @@ -58,7 +58,7 @@ point it to the downloaded archive in order to avoid loading.
### We don’t like binary formulae
Our policy is that formulae in the core repository
([Homebrew/homebrew](https://github.com/Homebrew/homebrew)) must be built
-from source (or produce cross-platform binaries like e.g. Java).Binary-only
+... | false |
Other | Homebrew | brew | 71c7781ecd673722b1fe8a9547cb57e9e6fb55a5.json | remove Bintray.version method
Closes Homebrew/homebrew#38587.
Signed-off-by: Xu Cheng <xucheng@me.com> | Library/Homebrew/bottles.rb | @@ -55,10 +55,6 @@ def self.repository(tap=nil)
return "bottles" if tap.to_s.empty?
"bottles-#{tap.sub(/^homebrew\/(homebrew-)?/i, "")}"
end
-
- def self.version(path)
- BottleVersion.parse(path).to_s
- end
end
class BottleCollector | false |
Other | Homebrew | brew | b3a38ea871434dae7c84f14c9e7ef9d8d968bb92.json | brew-test-bot: use pkg_version when uploading bottles | Library/Homebrew/cmd/test-bot.rb | @@ -771,8 +771,14 @@ def test_bot
formula_packaged = {}
Dir.glob("*.bottle*.tar.gz") do |filename|
- version = Bintray.version filename
formula_name = bottle_filename_formula_name filename
+ canonical_formula_name = if tap
+ "#{tap}/#{formula_name}"
+ else
+ ... | false |
Other | Homebrew | brew | e1611c4c224e83a1231cd1e5726bda37834feb87.json | brew-pull: use pkg_version when publishing bottles | Library/Homebrew/cmd/pull.rb | @@ -170,8 +170,7 @@ def pull
changed_formulae.each do |f|
ohai "Publishing on Bintray:"
package = Bintray.package f.name
- bottle = Bottle.new(f, f.bottle_specification)
- version = Bintray.version(bottle.url)
+ version = f.pkg_version
c... | false |
Other | Homebrew | brew | 913c12fd43909469829023d6d7d3de92e9503406.json | Keep subprocess code inside begin block | Library/Homebrew/utils/fork.rb | @@ -8,9 +8,8 @@ def self.safe_fork(&block)
read, write = IO.pipe
pid = fork do
- ENV["HOMEBREW_ERROR_PIPE"] = server.path
-
begin
+ ENV["HOMEBREW_ERROR_PIPE"] = server.path
server.close
read.close
write.fcntl(Fcntl::F_SETFD, Fcntl... | false |
Other | Homebrew | brew | f5d6d80d5bac2c83a89021481812b461c54cfba3.json | ENV.deparallelize: add block form for temporary change
Closes Homebrew/homebrew#39026. | Library/Homebrew/extend/ENV/std.rb | @@ -78,8 +78,22 @@ def determine_pkg_config_libdir
paths.select { |d| File.directory? d }.join(File::PATH_SEPARATOR)
end
+ # Removes the MAKEFLAGS environment variable, causing make to use a single job.
+ # This is useful for makefiles with race conditions.
+ # When passed a block, MAKEFLAGS is removed onl... | true |
Other | Homebrew | brew | f5d6d80d5bac2c83a89021481812b461c54cfba3.json | ENV.deparallelize: add block form for temporary change
Closes Homebrew/homebrew#39026. | Library/Homebrew/extend/ENV/super.rb | @@ -241,8 +241,21 @@ def determine_cccfg
public
+ # Removes the MAKEFLAGS environment variable, causing make to use a single job.
+ # This is useful for makefiles with race conditions.
+ # When passed a block, MAKEFLAGS is removed only for the duration of the block and is restored after its completion.
+ # R... | true |
Other | Homebrew | brew | f5d6d80d5bac2c83a89021481812b461c54cfba3.json | ENV.deparallelize: add block form for temporary change
Closes Homebrew/homebrew#39026. | Library/Homebrew/test/test_ENV.rb | @@ -114,6 +114,14 @@ def test_switching_compilers_updates_compiler
assert_equal compiler, @env.compiler
end
end
+
+ def test_deparallelize_block_form_restores_makeflags
+ @env['MAKEFLAGS'] = '-j4'
+ @env.deparallelize do
+ assert_nil @env['MAKEFLAGS']
+ end
+ assert_equal '-j4', @env['M... | true |
Other | Homebrew | brew | ec7b513a538a779e4ae585dfc9656865d0fb1e57.json | search: add homebrew/tex to search params
Closes Homebrew/homebrew#38855.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/search.rb | @@ -15,7 +15,7 @@ def search
elsif ARGV.include? '--debian'
exec_browser "https://packages.debian.org/search?keywords=#{ARGV.next}&searchon=names&suite=all§ion=all"
elsif ARGV.include? '--opensuse'
- exec_browser "http://software.opensuse.org/search?q=#{ARGV.next}"
+ exec_browser "https:/... | false |
Other | Homebrew | brew | f56101a26ad435dcf87fec6363fc18b0c7938e58.json | Migrating-A-Formula-To-A-Tap: add commit format. | share/doc/homebrew/Migrating-A-Formula-To-A-Tap.md | @@ -2,7 +2,7 @@
There are times when we may wish to migrate a formula from Homebrew's core (the main repository) into a tap (another repository). To do this:
1. Create a pull request to the new tap adding the formula file as-is from the main Homebrew repository. Fix any test failures that may occur due to the stric... | false |
Other | Homebrew | brew | fbc47d86ad799124f2ae9c7fcf842bf3d39a46d8.json | sandbox: add deny_write_homebrew_library method | Library/Homebrew/cmd/postinstall.rb | @@ -25,9 +25,7 @@ def run_post_install(formula)
sandbox.allow_write_log(formula)
sandbox.allow_write_cellar(formula)
sandbox.allow_write_path HOMEBREW_PREFIX
- sandbox.deny_write_path HOMEBREW_LIBRARY
- sandbox.deny_write_path HOMEBREW_REPOSITORY/".git"
- sandbox.deny_wri... | true |
Other | Homebrew | brew | fbc47d86ad799124f2ae9c7fcf842bf3d39a46d8.json | sandbox: add deny_write_homebrew_library method | Library/Homebrew/sandbox.rb | @@ -53,6 +53,12 @@ def allow_write_log(formula)
allow_write_path HOMEBREW_LOGS/formula.name
end
+ def deny_write_homebrew_library
+ deny_write_path HOMEBREW_LIBRARY
+ deny_write_path HOMEBREW_REPOSITORY/".git"
+ deny_write HOMEBREW_BREW_FILE
+ end
+
def exec(*args)
begin
seatbelt = T... | true |
Other | Homebrew | brew | 4db3e51c8ec307ba0d068e4403f7a66805b3c3ff.json | test_pkg_version: remove illegal testcase
`Version` will not end with /_\d+/.
Closes Homebrew/homebrew#38822.
Signed-off-by: Xu Cheng <xucheng@me.com> | Library/Homebrew/test/test_pkg_version.rb | @@ -12,7 +12,6 @@ def test_parse
assert_equal PkgVersion.new(Version.new("1.0"), 0), PkgVersion.parse("1.0")
assert_equal PkgVersion.new(Version.new("1.0"), 0), PkgVersion.parse("1.0_0")
assert_equal PkgVersion.new(Version.new("2.1.4"), 0), PkgVersion.parse("2.1.4_0")
- assert_equal PkgVersion.new(Ver... | false |
Other | Homebrew | brew | 39b890e255fbee0f1bce1cc1e9ead28ff4be9e2e.json | Remove test that may alter the repository | Library/Homebrew/test/test_ENV.rb | @@ -127,24 +127,12 @@ def setup
class SuperenvTests < Homebrew::TestCase
include SharedEnvTests
- attr_reader :env, :bin
-
def setup
@env = {}.extend(Superenv)
- @bin = HOMEBREW_REPOSITORY/"Library/ENV/#{MacOS::Xcode.version}"
- bin.mkpath
- end
-
- def test_bin
- assert_equal bin, Superenv.bi... | false |
Other | Homebrew | brew | d4c8f83381b909c7448c435244745d9ad08cc54b.json | Inline error message | Library/Homebrew/global.rb | @@ -107,9 +107,3 @@ module Homebrew
require 'compat' unless ARGV.include? "--no-compat" or ENV['HOMEBREW_NO_COMPAT']
ORIGINAL_PATHS = ENV['PATH'].split(File::PATH_SEPARATOR).map{ |p| Pathname.new(p).expand_path rescue nil }.compact.freeze
-
-SUDO_BAD_ERRMSG = <<-EOS.undent
- You can use brew with sudo, but only if... | true |
Other | Homebrew | brew | d4c8f83381b909c7448c435244745d9ad08cc54b.json | Inline error message | Library/brew.rb | @@ -102,7 +102,12 @@ def require? path
if sudo_check.include? cmd
if Process.uid.zero? and not File.stat(HOMEBREW_BREW_FILE).uid.zero?
- raise "Cowardly refusing to `sudo brew #{cmd}`\n#{SUDO_BAD_ERRMSG}"
+ raise <<-EOS.undent
+ Cowardly refusing to `sudo brew #{cmd}`
+ You can use bre... | true |
Other | Homebrew | brew | 6278e08aec7697f15bfdc1c9a1032f8612f5357b.json | Use real repo to run tests | Library/Homebrew/test/test_ENV.rb | @@ -127,24 +127,12 @@ def setup
class SuperenvTests < Homebrew::TestCase
include SharedEnvTests
- attr_reader :env, :bin
-
def setup
@env = {}.extend(Superenv)
- @bin = HOMEBREW_REPOSITORY/"Library/ENV/#{MacOS::Xcode.version}"
- bin.mkpath
- end
-
- def test_bin
- assert_equal bin, Superenv.bi... | true |
Other | Homebrew | brew | 6278e08aec7697f15bfdc1c9a1032f8612f5357b.json | Use real repo to run tests | Library/Homebrew/test/test_formula.rb | @@ -178,19 +178,7 @@ def test_path
end
def test_factory
- name = 'foo-bar'
- path = HOMEBREW_PREFIX+"Library/Formula/#{name}.rb"
- path.dirname.mkpath
- File.open(path, 'w') do |f|
- f << %{
- class #{Formulary.class_s(name)} < Formula
- url 'foo-1.0'
- end
- }
- ... | true |
Other | Homebrew | brew | 6278e08aec7697f15bfdc1c9a1032f8612f5357b.json | Use real repo to run tests | Library/Homebrew/test/testing_env.rb | @@ -1,6 +1,7 @@
# Require this file to build a testing environment.
-$:.push(File.expand_path(__FILE__+'/../..'))
+repo_root = Pathname.new File.expand_path("../../../..", __FILE__)
+$: << repo_root.join("Library", "Homebrew").to_s
require 'extend/module'
require 'extend/fileutils'
@@ -19,8 +20,10 @@
# Consta... | true |
Other | Homebrew | brew | 033964fe87afe7ee95837c4e0050d3c6253e03c2.json | pull: fetch bottles with --retry. | Library/Homebrew/cmd/pull.rb | @@ -177,7 +177,7 @@ def pull
"https://api.bintray.com/content/homebrew/#{repo}/#{package}/#{version}/publish"
puts
sleep 2
- safe_system "brew", "fetch", "--force-bottle", f.name
+ safe_system "brew", "fetch", "--retry", "--force-bottle", f.name
... | false |
Other | Homebrew | brew | e370cd784bd678704046f3f508a016811ed8d725.json | formula_cellar_checks: fix memcached shadowing. | Library/Homebrew/formula_cellar_checks.rb | @@ -108,11 +108,8 @@ def check_shadowed_headers
return if formula.name == formula_name
end
- if MacOS.version < :mavericks &&
- (formula.name.start_with?("postgresql") ||
- formula.name.start_with?("memcached"))
- return
- end
+ return if MacOS.version < :mavericks && formula.name... | false |
Other | Homebrew | brew | 36576333274a609b6546d7f4c05f05909d87cfda.json | formula_cellar_checks: ignore memcached shadowing. | Library/Homebrew/formula_cellar_checks.rb | @@ -108,7 +108,12 @@ def check_shadowed_headers
return if formula.name == formula_name
end
- return if MacOS.version < :mavericks && formula.name.start_with?("postgresql")
+ if MacOS.version < :mavericks &&
+ (formula.name.start_with?("postgresql") ||
+ formula.name.start_with?("memcached... | false |
Other | Homebrew | brew | 2f757ee5aae8fb480118196c0e62e43b165715ca.json | bottle_version: support openssl style | Library/Homebrew/bottle_version.rb | @@ -7,6 +7,10 @@ def self._parse spec
m = /[a-z]{3}\d-(\d{1}-\d{8})/.match(stem)
return m.captures.first unless m.nil?
+ # e.g. 1.0.2a-1 from openssl-1.0.2a-1.yosemite.bottle.1.tar.gz
+ m = /-(\d+\.\d+(\.\d+)+[a-z]-\d+)/.match(stem)
+ return m.captures.first unless m.nil?
+
# e.g. perforce-201... | true |
Other | Homebrew | brew | 2f757ee5aae8fb480118196c0e62e43b165715ca.json | bottle_version: support openssl style | Library/Homebrew/test/test_bottle_versions.rb | @@ -80,4 +80,9 @@ def test_gcc_versions_style
assert_version_detected '5-20150215',
'gcc5-5-20150215.yosemite.bottle.tar.gz'
end
+
+ def test_openssl_style
+ assert_version_detected '1.0.2a-1',
+ 'openssl-1.0.2a-1.yosemite.bottle.1.tar.gz'
+ end
end | true |
Other | Homebrew | brew | 47aae82d33a0dc76e5f759658480b4fa4fe0bd04.json | Remove bad test | Library/Homebrew/test/test_formula.rb | @@ -242,16 +242,6 @@ def test_head_ignores_revisions
assert_equal PkgVersion.parse('HEAD'), f.pkg_version
end
- def test_raises_when_non_formula_constant_exists
- const = :SomeConst
- Object.const_set(const, Module.new)
- begin
- assert_raises(FormulaUnavailableError) { Formulary.factory("some_... | false |
Other | Homebrew | brew | 338a08d8d6f10596593bfdf5ebc80e83c390069f.json | Ask the formula if it can be cleaned up once | Library/Homebrew/cmd/cleanup.rb | @@ -42,12 +42,10 @@ def cleanup_cellar
def cleanup_formula f
if f.installed?
eligible_kegs = f.rack.subdirs.map { |d| Keg.new(d) }.select { |k| f.pkg_version > k.version }
- eligible_kegs.each do |keg|
- if f.can_cleanup?
- cleanup_keg(keg)
- else
- opoo "Skipping (ol... | false |
Other | Homebrew | brew | 505d06c1761dfb89961b4f6b8093c5d62248e5fb.json | Simplify cleanup eligibility check | Library/Homebrew/cmd/cleanup.rb | @@ -124,12 +124,9 @@ def can_cleanup?
true
elsif opt_prefix.directory?
# SHA records were added to INSTALL_RECEIPTS the same day as opt symlinks
- !Formula.installed.
- select{ |ff| ff.deps.map{ |d| d.to_s }.include? name }.
- map{ |ff| ff.rack.subdirs rescue [] }.
- flatten... | false |
Other | Homebrew | brew | c2dcd91bd1ff2b88836089043bbfffacbbc5c6f3.json | Eliminate a place where ARGV is mutated | Library/Homebrew/build.rb | @@ -36,13 +36,6 @@ def post_superenv_hacks
end
end
- def pre_superenv_hacks
- # Allow a formula to opt-in to the std environment.
- if (formula.env.std? || deps.any? { |d| d.name == "scons" }) && ARGV.env != "super"
- ARGV.unshift "--env=std"
- end
- end
-
def effective_build_options_for(de... | true |
Other | Homebrew | brew | c2dcd91bd1ff2b88836089043bbfffacbbc5c6f3.json | Eliminate a place where ARGV is mutated | Library/Homebrew/formula_installer.rb | @@ -435,7 +435,12 @@ def sanitized_ARGV_options
args << "--verbose" if verbose?
args << "--debug" if debug?
args << "--cc=#{ARGV.cc}" if ARGV.cc
- args << "--env=#{ARGV.env}" if ARGV.env
+
+ if ARGV.env
+ args << "--env=#{ARGV.env}"
+ elsif formula.env.std? || formula.recursive_dependencies... | true |
Other | Homebrew | brew | 06f72ab38f7330eaef9a4cc05dd31b35e8bf26f5.json | move safe_fork into a standalone method | Library/Homebrew/formula_installer.rb | @@ -11,8 +11,6 @@
require 'cmd/tap'
require 'hooks/bottles'
require 'debrew'
-require 'fcntl'
-require 'socket'
require 'sandbox'
class FormulaInstaller
@@ -458,19 +456,13 @@ def build_argv
end
def build
- socket_path = "#{Dir.mktmpdir("homebrew", HOMEBREW_TEMP)}/socket"
- server = UNIXServer.new(s... | true |
Other | Homebrew | brew | 06f72ab38f7330eaef9a4cc05dd31b35e8bf26f5.json | move safe_fork into a standalone method | Library/Homebrew/utils.rb | @@ -4,6 +4,7 @@
require 'utils/json'
require 'utils/inreplace'
require 'utils/popen'
+require 'utils/fork'
require 'open-uri'
class Tty | true |
Other | Homebrew | brew | 06f72ab38f7330eaef9a4cc05dd31b35e8bf26f5.json | move safe_fork into a standalone method | Library/Homebrew/utils/fork.rb | @@ -0,0 +1,44 @@
+require "fcntl"
+require "socket"
+
+module Utils
+ def self.safe_fork(&block)
+ socket_path = "#{Dir.mktmpdir("homebrew", HOMEBREW_TEMP)}/socket"
+ server = UNIXServer.new(socket_path)
+ ENV["HOMEBREW_ERROR_PIPE"] = socket_path
+ read, write = IO.pipe
+
+ pid = fork do
+ begin
+ ... | true |
Other | Homebrew | brew | 3cc24528bffc615db84eab91f2ee8a82c77a9901.json | Revert "brew pull: add automatic tap repair"
This reverts commit bcd34ded9e4b17b8658b7ae947cd392a4e5942c0.
Closes Homebrew/homebrew#38658.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/pull.rb | @@ -187,8 +187,6 @@ def pull
ohai 'Patch changed:'
safe_system "git", "diff-tree", "-r", "--stat", revision, "HEAD"
- safe_system "brew", "tap", "--repair" if tap_name
-
if ARGV.include? '--install'
changed_formulae.each do |f|
ohai "Installing #{f.name}" | false |
Other | Homebrew | brew | 399388d8b9a29333135bd7bf2c4f7f159569d89b.json | brew pull: add automatic tap repair
At the moment, every time I pull a new formulae from a tap, I have to
fetch it with the fully qualified name, `brew fetch
homebrew/versions/duck123 `, which is fine, but then I also have to
install, test, and audit it in the same way, which isn’t fixed until I
tap repair, which gets... | Library/Homebrew/cmd/pull.rb | @@ -187,6 +187,8 @@ def pull
ohai 'Patch changed:'
safe_system "git", "diff-tree", "-r", "--stat", revision, "HEAD"
+ safe_system "brew", "tap", "--repair" if tap_name
+
if ARGV.include? '--install'
changed_formulae.each do |f|
ohai "Installing #{f.name}" | false |
Other | Homebrew | brew | 9cfd768bfef094122000bafbfee8172c8812afeb.json | formula: add more API docs for directories.
Closes Homebrew/homebrew#38571. | Library/Homebrew/formula.rb | @@ -262,6 +262,8 @@ def installed_prefix
end
end
+ # The currently installed version for this formula. Will raise an exception
+ # if the formula is not installed.
def installed_version
require 'keg'
Keg.new(installed_prefix).version
@@ -272,41 +274,140 @@ def installed_version
def prefix(v=... | false |
Other | Homebrew | brew | c86166c43e1b980bc39bfc6c7646de984337ee85.json | pull: increase bottle publish wait timeout. | Library/Homebrew/cmd/pull.rb | @@ -176,7 +176,7 @@ def pull
"-u#{bintray_user}:#{bintray_key}", "-X", "POST",
"https://api.bintray.com/content/homebrew/#{repo}/#{package}/#{version}/publish"
puts
- sleep 1
+ sleep 2
safe_system "brew", "fetch", "--force-bottle", f.name
... | false |
Other | Homebrew | brew | a5c4eb2d3eae9e2fd7b7f0fd431fe763688af82b.json | cmake: adjust standard built type
Moves from None to Release, but comments out the standard release
CFLAGS so we can continue using our own.
Bumped Libgit2 as an example/test to play with.
Closes Homebrew/homebrew#37332, hopefully.
Closes Homebrew/homebrew#37361.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/formula.rb | @@ -466,17 +466,17 @@ def inspect
end
# Standard parameters for CMake builds.
- # Using Build Type "None" tells cmake to use our CFLAGS,etc. settings.
- # Setting it to Release would ignore our flags.
# Setting CMAKE_FIND_FRAMEWORK to "LAST" tells CMake to search for our
# libraries before trying to uti... | false |
Other | Homebrew | brew | ac16822a16bc1fb33ca020f26b74e81ff85028e9.json | Prioritize TapDependency in parse_string_spec
test-bot expects the dependencies returned from SoftwareSpec#deps to
satisfy is_a?(TapDependency) if they come from a tap which might need to
be tapped. | Library/Homebrew/dependency_collector.rb | @@ -89,12 +89,12 @@ def parse_spec(spec, tags)
end
def parse_string_spec(spec, tags)
- if tags.empty?
+ if HOMEBREW_TAP_FORMULA_REGEX === spec
+ TapDependency.new(spec, tags)
+ elsif tags.empty?
Dependency.new(spec, tags)
elsif (tag = tags.first) && LANGUAGE_MODULES.include?(tag)
... | false |
Other | Homebrew | brew | f5c8e3fdbd87ba53ea582d20fb539e9a83eb1d5c.json | Use UNIXSocket to pass file descriptor
This is a more standard way to pass fd in UNIX world.
At the same time, it helps to remove a few hacks and
simplifies the code in the sandbox.
Closes Homebrew/homebrew#38434.
Signed-off-by: Xu Cheng <xucheng@me.com> | Library/Homebrew/build.rb | @@ -10,6 +10,7 @@
require "extend/ENV"
require "debrew"
require "fcntl"
+require "socket"
class Build
attr_reader :formula, :deps, :reqs
@@ -172,7 +173,7 @@ def fixopt f
end
begin
- error_pipe = IO.new(ENV["HOMEBREW_ERROR_PIPE"].to_i, "w")
+ error_pipe = UNIXSocket.open(ENV["HOMEBREW_ERROR_PIPE"], &:recv... | true |
Other | Homebrew | brew | f5c8e3fdbd87ba53ea582d20fb539e9a83eb1d5c.json | Use UNIXSocket to pass file descriptor
This is a more standard way to pass fd in UNIX world.
At the same time, it helps to remove a few hacks and
simplifies the code in the sandbox.
Closes Homebrew/homebrew#38434.
Signed-off-by: Xu Cheng <xucheng@me.com> | Library/Homebrew/formula_installer.rb | @@ -11,6 +11,8 @@
require 'cmd/tap'
require 'hooks/bottles'
require 'debrew'
+require 'fcntl'
+require 'socket'
class FormulaInstaller
include FormulaCellarChecks
@@ -455,6 +457,9 @@ def build_argv
end
def build
+ socket_path = "#{Dir.mktmpdir("homebrew", HOMEBREW_TEMP)}/socket"
+ server = UNIXSe... | true |
Other | Homebrew | brew | 3587dc441e0c7f649dbda67a12e4b4c87e434885.json | Remove duplication from cleanup methods | Library/Homebrew/cmd/cleanup.rb | @@ -25,14 +25,7 @@ def cleanup_logs
return unless HOMEBREW_LOGS.directory?
time = Time.now - 2 * 7 * 24 * 60 * 60 # two weeks
HOMEBREW_LOGS.subdirs.each do |dir|
- if dir.mtime < time
- if ARGV.dry_run?
- puts "Would remove: #{dir}"
- else
- puts "Removing: #{dir}..."... | false |
Other | Homebrew | brew | cfc8ac0190a21375c98d004d6e400c74413b3dc0.json | test-bot: override existing Bintray bottles. | Library/Homebrew/cmd/test-bot.rb | @@ -786,8 +786,10 @@ def test_bot
formula_packaged[formula_name] = true
end
- content_url = "https://api.bintray.com/content/homebrew/#{bintray_repo}/#{bintray_package}/#{version}/#{filename}"
- content_url += "?publish=1&override=1" if existing_bottle
+ content_url = "https:/... | false |
Other | Homebrew | brew | 6370ccf9a81bbd9c0b4ddb6068a91c649529d514.json | list: exclude pypy from unbrewed
Excludes the PyPy paths from the unbrewed list, since we do the same
with Python.
Closes Homebrew/homebrew#38399. | Library/Homebrew/cmd/list.rb | @@ -34,6 +34,10 @@ def list
lib/gio/*
lib/node_modules/*
lib/python[23].[0-9]/*
+ lib/pypy/*
+ lib/pypy3/*
+ share/pypy/*
+ share/pypy3/*
share/doc/homebrew/*
share/info/dir
share/man/man1/brew.1 | false |
Other | Homebrew | brew | 27092cabc4bda0904e1616bb2e5d4d949dbd3178.json | Switch PkgVersion to use composition
Comparing PkgVersion and Version objects can produce nonsensical
results. For example, equality is not symmetric:
irb(main):002:0> PkgVersion.new("1.0", 0) == Version.new("1.0")
=> false
irb(main):003:0> Version.new("1.0") == PkgVersion.new("1.0", 0)
=> true
Rather than attempt t... | Library/Homebrew/pkg_version.rb | @@ -1,36 +1,45 @@
-require 'version'
+require "version"
-class PkgVersion < Version
- attr_reader :version, :revision
+class PkgVersion
+ include Comparable
RX = /\A(.+?)(?:_(\d+))?\z/
def self.parse(path)
_, version, revision = *path.match(RX)
- new(version, revision)
+ version = Version.new(v... | true |
Other | Homebrew | brew | 27092cabc4bda0904e1616bb2e5d4d949dbd3178.json | Switch PkgVersion to use composition
Comparing PkgVersion and Version objects can produce nonsensical
results. For example, equality is not symmetric:
irb(main):002:0> PkgVersion.new("1.0", 0) == Version.new("1.0")
=> false
irb(main):003:0> Version.new("1.0") == PkgVersion.new("1.0", 0)
=> true
Rather than attempt t... | Library/Homebrew/test/test_pkg_version.rb | @@ -7,13 +7,13 @@ def v(version)
end
def test_parse
- assert_equal PkgVersion.new("1.0", 1), PkgVersion.parse("1.0_1")
- assert_equal PkgVersion.new("1.0", 1), PkgVersion.parse("1.0_1")
- assert_equal PkgVersion.new("1.0", 0), PkgVersion.parse("1.0")
- assert_equal PkgVersion.new("1.0", 0), PkgVersi... | true |
Other | Homebrew | brew | 1b5fc1fb02691f0868f855443f1393568fe2b465.json | audit: enforce https for bare bintray.com domain
Closes Homebrew/homebrew#38302.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/audit.rb | @@ -338,7 +338,7 @@ def audit_urls
problem "Fossies urls should be https://, not http (url is #{p})."
when %r[^http://mirrors\.kernel\.org/]
problem "mirrors.kernel urls should be https://, not http (url is #{p})."
- when %r[^http://[^/]*\.bintray\.com/]
+ when %r[^http://([^/]*\.|)bi... | false |
Other | Homebrew | brew | 7de2d56f5282de4a46452ea15da4f6063c1bbbb5.json | Simplify versions code | Library/Homebrew/formula_versions.rb | @@ -7,22 +7,12 @@ class FormulaVersions
ErrorDuringExecution, LoadError,
]
- attr_reader :f
+ attr_reader :name, :repository, :entry_name
- def initialize(f)
- @f = f
- end
-
- def repository
- @repository ||= if f.tap?
- HOMEBREW_LIBRARY.join("Taps", f.tap)
- else
- HOMEBREW_REPOSIT... | false |
Other | Homebrew | brew | f51439329ba86ae6bbb9c513b03ec4f3eb23ef43.json | Remove dead code | Library/Homebrew/formula_versions.rb | @@ -25,19 +25,6 @@ def entry_name
@entry_name ||= f.path.relative_path_from(repository).to_s
end
- def each
- versions = Set.new
- rev_list do |rev|
- version = version_at_revision(rev)
- next if version.nil?
- yield version, rev if versions.add?(version)
- end
- end
-
- def reposit... | false |
Other | Homebrew | brew | 6ca42964cb20a321be56180df9c568c1c016e84e.json | pathname: remove hyphen from BOTTLE_EXTNAME_RX
A hyphen is not a valid character in a Ruby symbol, and the bottle
tag should be a valid Ruby symbol for its use in the bottle stanza.
Closes Homebrew/homebrew#38235.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/extend/pathname.rb | @@ -7,7 +7,7 @@
class Pathname
include MachO
- BOTTLE_EXTNAME_RX = /(\.[-a-z0-9_]+\.bottle\.(\d+\.)?tar\.gz)$/
+ BOTTLE_EXTNAME_RX = /(\.[a-z0-9_]+\.bottle\.(\d+\.)?tar\.gz)$/
def install *sources
sources.each do |src| | false |
Other | Homebrew | brew | f6946cd9f644cb9686bf5541e11e463c0e8195af.json | audit: enforce https on *.bintray.com urls
Closes Homebrew/homebrew#38209.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/audit.rb | @@ -338,6 +338,8 @@ def audit_urls
problem "Fossies urls should be https://, not http (url is #{p})."
when %r[^http://mirrors\.kernel\.org/]
problem "mirrors.kernel urls should be https://, not http (url is #{p})."
+ when %r[^http://[^/]*\.bintray\.com/]
+ problem "Bintray urls shou... | false |
Other | Homebrew | brew | af66c12108466fe541403638a8742a9dc78039e3.json | Formula Cookbook: clarify new use of tag revision. | share/doc/homebrew/Formula-Cookbook.md | @@ -566,13 +566,14 @@ end
Homebrew understands `git`, `svn`, and `hg` URLs, and has a way to specify `cvs` repositories as a URL as well. You can test whether the `HEAD` is being built with `build.head?`.
-To use a specific commit, tag, or branch from a repository, specify head with the `:revision`, `:tag`, or `:b... | false |
Other | Homebrew | brew | 150c052970c59b8ce4cda7c4b7d1128e60f416c3.json | add reference to Vim Syntax for Homebrew formulae
A simple vim plugin created by me. Hope it can help formula authors who use vim.
Closes Homebrew/homebrew#38150.
Signed-off-by: Xu Cheng <xucheng@me.com> | share/doc/homebrew/Tips-N'-Tricks.md | @@ -123,3 +123,7 @@ This sets the HOMEBREW_NO_EMOJI environment variable, causing homebrew to hide a
## Sublime text: Syntax for formulae including the diff
In Sublime Text 2/3, you can use Package Control to install [Homebrew-formula-syntax](https://github.com/samueljohn/Homebrew-formula-syntax).
+
+## Vim Syntax ... | false |
Other | Homebrew | brew | 9b75afcf4ae735cb197f0ef835e0052c94cdb666.json | Make Version#<=> allocation-free | Library/Homebrew/version.rb | @@ -201,8 +201,33 @@ def <=>(other)
return 1 if head? && !other.head?
return -1 if !head? && other.head?
- max = [tokens.length, other.tokens.length].max
- pad_to(max) <=> other.pad_to(max)
+ ltokens = tokens
+ rtokens = other.tokens
+ max = max(ltokens.length, rtokens.length)
+ l = r = 0
... | false |
Other | Homebrew | brew | 522f7ea8c729ef6a5fddc5921ba045713236c28d.json | Add tests for cp_path_sub | Library/Homebrew/test/test_pathname.rb | @@ -124,6 +124,18 @@ def test_install_renamed_directory
@dst.install @src
assert_equal "a", File.read(@dst+@src.basename+@file.basename)
end
+
+ def test_cp_path_sub_file
+ @file.write "a"
+ @file.cp_path_sub @src, @dst
+ assert_equal "a", File.read(@dst+"foo")
+ end
+
+ def test_cp_path_sub_di... | false |
Other | Homebrew | brew | 8a8de3a29678eb64e7686bc5e35701edb84e9946.json | Add test for InstallRenamed on directories | Library/Homebrew/test/test_pathname.rb | @@ -117,6 +117,13 @@ def test_install_renamed
assert_equal "a", File.read(@dst+@file.basename)
assert_equal "b", File.read(@dst+"#{@file.basename}.default")
end
+
+ def test_install_renamed_directory
+ @dst.extend(InstallRenamed)
+ @file.write "a"
+ @dst.install @src
+ assert_equal "a", File.r... | false |
Other | Homebrew | brew | 4c21ad30d85b6b4e43c64c31c9466ca292df8216.json | Adjust variable in InstallRenamed test | Library/Homebrew/test/test_pathname.rb | @@ -107,15 +107,15 @@ def test_install_creates_intermediate_directories
end
def test_install_renamed
- @dir.extend(InstallRenamed)
+ @dst.extend(InstallRenamed)
@file.write "a"
- @dir.install @file
+ @dst.install @file
@file.write "b"
- @dir.install @file
+ @dst.install @file
- ... | false |
Other | Homebrew | brew | 60fe954bfd6a8fe50ff576cd502ef92c25d41fe6.json | unpack: expand destdir in case a relative path is given
Fixes Homebrew/homebrew#38067. | Library/Homebrew/cmd/unpack.rb | @@ -13,7 +13,7 @@ def unpack
raise FormulaUnspecifiedError if formulae.empty?
if dir = ARGV.value("destdir")
- unpack_dir = Pathname.new(dir)
+ unpack_dir = Pathname.new(dir).expand_path
unpack_dir.mkpath
else
unpack_dir = Pathname.pwd | false |
Other | Homebrew | brew | 148ebcb72e609b3b49002cdf40a5620f4ec67344.json | Eliminate chdir from pathname tests | Library/Homebrew/test/test_pathname.rb | @@ -119,61 +119,55 @@ class PathnameInstallTests < PathnameExtensionTests
def setup_install_test
(@src+'a.txt').write 'This is sample file a.'
(@src+'b.txt').write 'This is sample file b.'
- cd(@src) { yield }
end
def test_install
- setup_install_test do
- @dst.install 'a.txt'
- end
+... | false |
Other | Homebrew | brew | b49d3bd0a99d2ffb7d85e0fd3a13decf820ff85c.json | Pull install tests into a separate class | Library/Homebrew/test/test_pathname.rb | @@ -95,6 +95,27 @@ def test_install_removes_original
refute_predicate @file, :exist?
end
+ def test_install_creates_intermediate_directories
+ touch @file
+ refute_predicate @dir, :directory?
+ @dir.install(@file)
+ assert_predicate @dir, :directory?
+ end
+
+ def test_install_renamed
+ @dir... | false |
Other | Homebrew | brew | 53b7d45de8f38d1998e5c23a77064ae3df4be522.json | Do less work inside chdir blocks | Library/Homebrew/test/test_pathname.rb | @@ -96,100 +96,95 @@ def test_install_removes_original
end
def setup_install_test
- cd @src do
- (@src+'a.txt').write 'This is sample file a.'
- (@src+'b.txt').write 'This is sample file b.'
- yield
- end
+ (@src+'a.txt').write 'This is sample file a.'
+ (@src+'b.txt').write 'This is ... | false |
Other | Homebrew | brew | 1351f67e91c75451fb2c7ce8f024adb86dcb542d.json | Make install_p and install_symlink_p private | Library/Homebrew/extend/pathname.rb | @@ -57,7 +57,7 @@ def install_p(src, new_basename)
FileUtils.mv src, dst
end
end
- protected :install_p
+ private :install_p
# Creates symlinks to sources in this folder.
def install_symlink *sources
@@ -79,7 +79,7 @@ def install_symlink_p(src, new_basename)
mkpath
FileUtils.ln_sf(src... | false |
Other | Homebrew | brew | edf205f5ca025254a286db4d057fe9badbf6baf0.json | aspell-dictionaries: use sha256 for resources
Closes Homebrew/homebrew#37962.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/aspell-dictionaries.rb | @@ -32,7 +32,7 @@ def aspell_dictionaries
resource "#{r.name}" do
url "#{r.url}"
mirror "#{r.mirrors.first}"
- sha1 "#{r.cached_download.sha1}"
+ sha256 "#{r.cached_download.sha256}"
end
EOS | false |
Other | Homebrew | brew | 68c7e1e30cbb96eee50472c19f866414188a5d65.json | Add protected reader for version value | Library/Homebrew/version.rb | @@ -192,7 +192,7 @@ def detected_from_url?
end
def head?
- @version == 'HEAD'
+ version == "HEAD"
end
def <=>(other)
@@ -207,16 +207,18 @@ def <=>(other)
alias_method :eql?, :==
def hash
- @version.hash
+ version.hash
end
def to_s
- @version.dup
+ version.dup
end
... | false |
Other | Homebrew | brew | 03b309cc76f24f503e50fc4a830147242fdb84e8.json | Fix NullToken equality | Library/Homebrew/version.rb | @@ -30,6 +30,8 @@ def initialize(value=nil)
def <=>(other)
case other
+ when NullToken
+ 0
when NumericToken
other.value == 0 ? 0 : -1
when AlphaToken, BetaToken, RCToken | false |
Other | Homebrew | brew | 0d4f241d481ee5bc356366c7a1383541338d3365.json | Remove explicit type check | Library/Homebrew/version.rb | @@ -17,6 +17,10 @@ def inspect
def to_s
value.to_s
end
+
+ def numeric?
+ false
+ end
end
class NullToken < Token
@@ -76,6 +80,10 @@ def <=>(other)
-Integer(other <=> self)
end
end
+
+ def numeric?
+ true
+ end
end
class CompositeToken < String... | false |
Other | Homebrew | brew | 02cb05f22b4e66536409cd90dd7253d8ac7cd07d.json | audit: enforce https for apache.org
- including all apache.org subdomains
- for `homepage` as well
Closes Homebrew/homebrew#37778.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/audit.rb | @@ -301,6 +301,10 @@ def audit_urls
problem "Github Pages links should be https:// (URL is #{homepage})."
end
+ if homepage =~ %r[^http://[^/]*\.apache\.org/]
+ problem "Apache homepages should be https:// links (URL is #{homepage})."
+ end
+
# There's an auto-redirect here, but this mista... | false |
Other | Homebrew | brew | fffba3dc7d9bdab6bbce5bed6a096e284fd78fd5.json | test-bot: remove another invalid XML character. | Library/Homebrew/cmd/test-bot.rb | @@ -823,7 +823,7 @@ def test_bot
if step.has_output?
# Remove invalid XML CData characters from step output.
- output = step.output.delete("\000\a\b\e\f")
+ output = step.output.delete("\000\a\b\e\f\x1f")
if output.bytesize > BYTES_IN_1_MEGABYTE
... | false |
Other | Homebrew | brew | db05618561550c36d2d41b0ff5e6fea4bd6019d2.json | Use Dir.mktmpdir instead of shelling out to mktemp
Closes Homebrew/homebrew#37616. | Library/Homebrew/extend/fileutils.rb | @@ -1,29 +1,25 @@
-require 'fileutils'
+require "fileutils"
+require "tmpdir"
# We enhance FileUtils to make our Formula code more readable.
module FileUtils
# Create a temporary directory then yield. When the block returns,
# recursively delete the temporary directory.
def mktemp(prefix=name)
- # I u... | false |
Other | Homebrew | brew | b03faffcc10ab7d174c8164d28739e71f9c9ce97.json | Remove unused argument | Library/Homebrew/utils.rb | @@ -326,23 +326,21 @@ def initialize(error)
end
end
- def open url, headers={}, &block
+ def open(url, &block)
# This is a no-op if the user is opting out of using the GitHub API.
return if ENV['HOMEBREW_NO_GITHUB_API']
require "net/https"
- default_headers = {
+ headers = {
... | false |
Other | Homebrew | brew | 2356131e5fc79983a53142a8cb71710fc97c01e8.json | Remove unnecessary default argument
This method is always called with two arguments. | Library/Homebrew/version.rb | @@ -161,7 +161,7 @@ def detected_from_url?
end
end
- def self.detect(url, specs={})
+ def self.detect(url, specs)
if specs.has_key?(:tag)
FromURL.new(specs[:tag][/((?:\d+\.)*\d+)/, 1])
else | false |
Other | Homebrew | brew | 097d5242c3c2b0a60694fa090f435d1a15e24e67.json | Simplify skip_executables option | Library/Homebrew/keg_fix_install_names.rb | @@ -73,8 +73,7 @@ def change_install_name(old, new, file)
# Note that this doesn't attempt to distinguish between libstdc++ versions,
# for instance between Apple libstdc++ and GNU libstdc++
def detect_cxx_stdlibs(options={})
- options = { :skip_executables => false }.merge(options)
- skip_executables = ... | false |
Other | Homebrew | brew | 83080be4c1c84290bed5ed077bcb37f243c106d4.json | Use https for issue URL. | Library/Homebrew/os.rb | @@ -8,7 +8,7 @@ def self.linux?
end
if OS.mac?
- ISSUES_URL = "http://git.io/brew-troubleshooting"
+ ISSUES_URL = "https://git.io/brew-troubleshooting"
PATH_OPEN = "/usr/bin/open"
elsif OS.linux?
ISSUES_URL = "https://github.com/Homebrew/linuxbrew/wiki/troubleshooting" | false |
Other | Homebrew | brew | 21314474cdfa99e85b291bfc7480b3e253774fc8.json | audit: Clarify GNU url warning message
"ftpmirror.gnu.org" must have a protocol prefix of "http", not
"https".
Closes Homebrew/homebrew#37567.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/audit.rb | @@ -311,7 +311,7 @@ def audit_urls
# Check GNU urls; doesn't apply to mirrors
urls.grep(%r[^(?:https?|ftp)://(?!alpha).+/gnu/]) do |u|
- problem "\"ftpmirror.gnu.org\" is preferred for GNU software (url is #{u})."
+ problem "\"http://ftpmirror.gnu.org\" is preferred for GNU software (url is #{u}).... | false |
Other | Homebrew | brew | 4057a68e6e074d9e3e42a7e94f89723804f9f998.json | add bottle? method to Tab
Closes Homebrew/homebrew#37621. | Library/Homebrew/tab.rb | @@ -155,6 +155,10 @@ def build_bottle?
built_as_bottle && !poured_from_bottle
end
+ def bottle?
+ built_as_bottle
+ end
+
def to_json
attributes = {
"used_options" => used_options.as_flags, | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.