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
1fb16775328d6022643856de146d54d4654e880e.json
Linuxbrew: Move ISSUES_URL to os from global Closes Homebrew/linuxbrew#103 Closes Homebrew/homebrew#30830. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Library/Homebrew/os.rb
@@ -7,10 +7,11 @@ def self.linux? /linux/i === RUBY_PLATFORM end - # Utilities if OS.mac? + ISSUES_URL = "https://github.com/Homebrew/homebrew/wiki/troubleshooting" PATH_OPEN = "/usr/bin/open" elsif OS.linux? + ISSUES_URL = "https://github.com/Homebrew/linuxbrew/wiki/troubleshooting" PA...
true
Other
Homebrew
brew
f906d13ef29c102839fd55250adbb01109e8404d.json
Remove dead code
Library/Contributions/cmd/brew-test-bot.rb
@@ -42,10 +42,10 @@ def initialize test, command, options={} @time = 0 end - def log_file_path full_path=true + def log_file_path file = "#{@category}.#{@name}.txt" - return file unless @test.log_root and full_path - @test.log_root + file + root = @test.log_root + root ? root + file : file ...
false
Other
Homebrew
brew
a7ca4bc3002d9977e988d5407f702b773e52a135.json
Remove intermediate variable
Library/Contributions/cmd/brew-test-bot.rb
@@ -101,8 +101,7 @@ def run end Process.wait(pid) - end_time = Time.now - @time = end_time - start_time + @time = Time.now - start_time success = $?.success? @status = success ? :passed : :failed
false
Other
Homebrew
brew
3b7c5af4315acdd8160d2308445a8ef6fe5141e6.json
Add test for InstallRenamed module
Library/Homebrew/test/test_pathname.rb
@@ -1,6 +1,7 @@ require 'testing_env' require 'tmpdir' require 'extend/pathname' +require 'install_renamed' class PathnameExtensionTests < Homebrew::TestCase include FileUtils @@ -197,4 +198,16 @@ def test_install_creates_intermediate_directories @dir.install(@file) assert_predicate @dir, :directory?...
false
Other
Homebrew
brew
6cad17caef241b93fc0218e39e4f889d158c7e9c.json
brew-test-bot: use git to do the diff filtering
Library/Contributions/cmd/brew-test-bot.rb
@@ -252,15 +252,11 @@ def single_commit? start_revision, end_revision return unless diff_start_sha1 != diff_end_sha1 return if @url and not steps.last.passed? - diff_stat = git "diff-tree", "-r", "--name-status", + git( + "diff-tree", "-r", "--name-only", "--diff-filter=AM", diff_start_sha...
false
Other
Homebrew
brew
845c4b7f2f7e050b1495051f91b7246b8af89f4a.json
brew-pull: use git to do the diff filtering
Library/Contributions/cmd/brew-pull.rb
@@ -87,19 +87,15 @@ def tap arg end Utils.popen_read( - "git", "diff-tree", "-r", "--name-status", - revision, "HEAD", "--", formula_dir, &:read + "git", "diff-tree", "-r", "--name-only", + "--diff-filter=AM", revision, "HEAD", "--", formula_dir ).each_line do |line| - status, filename = line....
false
Other
Homebrew
brew
677cd519778ab66e19699d847b03a2f3d958bd2a.json
Use Utils.popen_read in XQuartz version codepath
Library/Homebrew/os/mac.rb
@@ -231,13 +231,13 @@ def app_with_bundle_id(*ids) def mdfind(*ids) return [] unless OS.mac? (@mdfind ||= {}).fetch(ids) do - @mdfind[ids] = `/usr/bin/mdfind "#{mdfind_query(*ids)}"`.split("\n") + @mdfind[ids] = Utils.popen_read("/usr/bin/mdfind", mdfind_query(*ids), &:read).split("\n")...
true
Other
Homebrew
brew
677cd519778ab66e19699d847b03a2f3d958bd2a.json
Use Utils.popen_read in XQuartz version codepath
Library/Homebrew/os/mac/xquartz.rb
@@ -56,7 +56,9 @@ def bundle_path end def version_from_mdls(path) - version = `mdls -raw -nullMarker "" -name kMDItemVersion "#{path}" 2>/dev/null`.strip + version = Utils.popen_read( + "/usr/bin/mdls", "-raw", "-nullMarker", "", "-name", "kMDItemVersion", path.to_s, &:read + ...
true
Other
Homebrew
brew
284389a6bd4bf88269b4db580015e8590dd76a37.json
Make comment in Pathname#install more accurate
Library/Homebrew/extend/pathname.rb
@@ -45,22 +45,19 @@ def install_p src, new_basename = nil src = src.to_s dst = dst.to_s - # if it's a symlink, don't resolve it to a file because if we are moving - # files one by one, it's likely we will break the symlink by moving what - # it points to before we move it - # and also broken sym...
false
Other
Homebrew
brew
126d2133ab824072f526bc88830a5b9948247bfb.json
Fix method signature
Library/Homebrew/patch.rb
@@ -3,8 +3,8 @@ require 'erb' class Patch - def self.create(strip, io=nil, &block) - case strip ||= :p1 + def self.create(strip, io, &block) + case strip when :DATA, IO, StringIO IOPatch.new(strip, :p1) when String
true
Other
Homebrew
brew
126d2133ab824072f526bc88830a5b9948247bfb.json
Fix method signature
Library/Homebrew/test/test_patch.rb
@@ -3,7 +3,7 @@ class PatchTests < Homebrew::TestCase def test_create_simple - patch = Patch.create(:p2) + patch = Patch.create(:p2, nil) assert_kind_of ExternalPatch, patch assert_predicate patch, :external? assert_equal :p2, patch.strip @@ -17,7 +17,7 @@ def test_create_io end def t...
true
Other
Homebrew
brew
07f0f60908f8bd40b7032ebaadcf16371f2f2136.json
Deprecate some contributions. This is just a starting point to start discussion. I think we have a few options with contributions: - Stop accepting them altogether and move the ones we need/use/support into core commands - Accept them on an unsupported basis and require they be added manually to the PATH - Active...
Library/Contributions/cmd/brew-beer.rb
@@ -176,4 +176,11 @@ Thanks for brewin' EOS +opoo <<-EOS.undent + brew beer is deprecated and going to be removed at some point in the + future. If you would like to volunteer to maintain it in a tap please get in + contact with us. Thanks! + +EOS + puts HOMEBREW_BEER
true
Other
Homebrew
brew
07f0f60908f8bd40b7032ebaadcf16371f2f2136.json
Deprecate some contributions. This is just a starting point to start discussion. I think we have a few options with contributions: - Stop accepting them altogether and move the ones we need/use/support into core commands - Accept them on an unsupported basis and require they be added manually to the PATH - Active...
Library/Contributions/cmd/brew-bundle-dir.rb
@@ -44,6 +44,12 @@ def usage USAGE end +opoo <<-EOS.undent + brew bundle-dir is unsupported and will be removed soon. + Please feel free volunteer to support it in a tap. + +EOS + # command. command = ARGV.first
true
Other
Homebrew
brew
07f0f60908f8bd40b7032ebaadcf16371f2f2136.json
Deprecate some contributions. This is just a starting point to start discussion. I think we have a few options with contributions: - Stop accepting them altogether and move the ones we need/use/support into core commands - Accept them on an unsupported basis and require they be added manually to the PATH - Active...
Library/Contributions/cmd/brew-bundle.rb
@@ -27,6 +27,13 @@ def usage exit end +opoo <<-EOS.undent + brew bundle is unsupported and will be replaced with another, + incompatible version at some point. + Please feel free volunteer to support it in a tap. + +EOS + usage if ARGV.include?('--help') || ARGV.include?('-h') path = 'Brewfile'
true
Other
Homebrew
brew
07f0f60908f8bd40b7032ebaadcf16371f2f2136.json
Deprecate some contributions. This is just a starting point to start discussion. I think we have a few options with contributions: - Stop accepting them altogether and move the ones we need/use/support into core commands - Accept them on an unsupported basis and require they be added manually to the PATH - Active...
Library/Contributions/cmd/brew-graph
@@ -5,6 +5,7 @@ $ brew graph | dot -Tsvg -ohomebrew.html $ open homebrew.html """ from __future__ import with_statement +from __future__ import print_function from contextlib import contextmanager import re @@ -14,7 +15,7 @@ import sys def run(command, print_command=False): "Run a command, returning the ...
true
Other
Homebrew
brew
07f0f60908f8bd40b7032ebaadcf16371f2f2136.json
Deprecate some contributions. This is just a starting point to start discussion. I think we have a few options with contributions: - Stop accepting them altogether and move the ones we need/use/support into core commands - Accept them on an unsupported basis and require they be added manually to the PATH - Active...
Library/Contributions/cmd/brew-server
@@ -12,6 +12,13 @@ require 'cmd/search' require 'rubygems' +opoo <<-EOS.undent + brew server is unsupported and will be removed soon. + You should use http://braumeister.org instead. + Please feel free volunteer to support it in a tap. + +EOS + begin require 'sinatra' rescue LoadError
true
Other
Homebrew
brew
07f0f60908f8bd40b7032ebaadcf16371f2f2136.json
Deprecate some contributions. This is just a starting point to start discussion. I think we have a few options with contributions: - Stop accepting them altogether and move the ones we need/use/support into core commands - Accept them on an unsupported basis and require they be added manually to the PATH - Active...
Library/Contributions/cmd/brew-services.rb
@@ -366,4 +366,12 @@ def generate_plist(data = nil) # Start the cli dispatch stuff. # + +opoo <<-EOS.undent + brew services is unsupported and will be removed soon. + You should use launchctl instead. + Please feel free volunteer to support it in a tap. + +EOS + ServicesCli.run!
true
Other
Homebrew
brew
07f0f60908f8bd40b7032ebaadcf16371f2f2136.json
Deprecate some contributions. This is just a starting point to start discussion. I think we have a few options with contributions: - Stop accepting them altogether and move the ones we need/use/support into core commands - Accept them on an unsupported basis and require they be added manually to the PATH - Active...
Library/Contributions/cmd/brew-versions.rb
@@ -4,9 +4,10 @@ raise FormulaUnspecifiedError if ARGV.named.empty? opoo <<-EOS.undent - brew-versions is unsupported and may be removed soon. - Please use the homebrew-versions tap instead: + brew-versions is unsupported and will be removed soon. + You should use the homebrew-versions tap instead: https:/...
true
Other
Homebrew
brew
07f0f60908f8bd40b7032ebaadcf16371f2f2136.json
Deprecate some contributions. This is just a starting point to start discussion. I think we have a few options with contributions: - Stop accepting them altogether and move the ones we need/use/support into core commands - Accept them on an unsupported basis and require they be added manually to the PATH - Active...
Library/Contributions/cmd/brew-which.rb
@@ -3,17 +3,14 @@ module Homebrew def which_versions which_brews=nil opoo <<-EOS.undent - brew-which is unsupported and may be removed soon. + brew which is unsupported and will be removed soon. - To see which versions are installed: - brew list --versions - - To query formula info...
true
Other
Homebrew
brew
5fee415d45272fd19f9007271f58dae9f3b6ee7c.json
Add 10.10 pkgconfig files
Library/ENV/pkgconfig/10.10/libcurl.pc
@@ -0,0 +1,39 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# ...
true
Other
Homebrew
brew
5fee415d45272fd19f9007271f58dae9f3b6ee7c.json
Add 10.10 pkgconfig files
Library/ENV/pkgconfig/10.10/libexslt.pc
@@ -0,0 +1,12 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + + +Name: libexslt +Version: 0.8.17 +Description: EXSLT Extension library +Requires: libxml-2.0 +Libs: -L${libdir} -lexslt -lxslt -lxml2 -lz -lpthread -licucore -lm +Cflags: -I${includedir}
true
Other
Homebrew
brew
5fee415d45272fd19f9007271f58dae9f3b6ee7c.json
Add 10.10 pkgconfig files
Library/ENV/pkgconfig/10.10/libxml-2.0.pc
@@ -0,0 +1,13 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include +modules=1 + +Name: libXML +Version: 2.9.0 +Description: libXML library version2. +Requires: +Libs: -L${libdir} -lxml2 +Libs.private: -lpthread -lz -lm +Cflags: -I${includedir}/libxml2
true
Other
Homebrew
brew
5fee415d45272fd19f9007271f58dae9f3b6ee7c.json
Add 10.10 pkgconfig files
Library/ENV/pkgconfig/10.10/libxslt.pc
@@ -0,0 +1,12 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + + +Name: libxslt +Version: 1.1.28 +Description: XSLT library version 2. +Requires: libxml-2.0 +Libs: -L${libdir} -lxslt -lxml2 -lz -lpthread -licucore -lm +Cflags: -I${includedir}
true
Other
Homebrew
brew
724362a77bd46a5600217d673d636c731b48e787.json
Move TeXmacs to boneyard. Does not compile with modern C++ compilers. Closes Homebrew/homebrew#27386.
Library/Homebrew/tap_migrations.rb
@@ -55,6 +55,7 @@ "sundials" => "homebrew/science", "syslog-ng" => "homebrew/boneyard", "tetgen" => "homebrew/science", + "texmacs" => "homebrew/boneyard", "tmap" => "homebrew/boneyard", "urweb" => "homebrew/boneyard", "wkhtmltopdf" => "homebrew/boneyard",
false
Other
Homebrew
brew
7ee49db51e27b4403d3f24747262d9c9891c8477.json
Remove proc handling from BuildEnvironment
Library/Homebrew/build_environment.rb
@@ -1,8 +1,6 @@ require 'set' class BuildEnvironment - attr_accessor :proc - def initialize(*settings) @settings = Set.new(*settings) end @@ -24,36 +22,11 @@ def std? def userpaths? @settings.include? :userpaths end - - def modify_build_environment(receiver) - receiver.instance_eval(&proc...
true
Other
Homebrew
brew
7ee49db51e27b4403d3f24747262d9c9891c8477.json
Remove proc handling from BuildEnvironment
Library/Homebrew/test/test_build_environment.rb
@@ -23,31 +23,6 @@ def test_userpaths? @env << :userpaths assert_predicate @env, :userpaths? end - - def test_modify_build_environment - @env.proc = Proc.new { raise StandardError } - assert_raises(StandardError) do - @env.modify_build_environment(self) - end - end - - def test_marshal - ...
true
Other
Homebrew
brew
9822faa56a1f99ab97b6e44bccf363c005172197.json
Simplify BuildEnvironmentDSL test setup
Library/Homebrew/test/test_build_environment.rb
@@ -52,11 +52,9 @@ def test_env_block_with_argument class BuildEnvironmentDSLTests < Homebrew::TestCase def make_instance(&block) - Class.new do - extend BuildEnvironmentDSL - def env; self.class.env end - class_eval(&block) - end.new + obj = Object.new.extend(BuildEnvironmentDSL) + obj...
false
Other
Homebrew
brew
8c4569b7c2af62983cfeb241be15d910b3aa15f4.json
Fix BuildEnvironment initializer
Library/Homebrew/build_environment.rb
@@ -4,7 +4,7 @@ class BuildEnvironment attr_accessor :proc def initialize(*settings) - @settings = Set.new(settings) + @settings = Set.new(*settings) end def merge(*args)
false
Other
Homebrew
brew
dd3446ded19ea88dc85bb5bff670c4b2a128c207.json
Remove inaccurate comment
Library/Homebrew/global.rb
@@ -42,7 +42,7 @@ def mkpath end HOMEBREW_CACHE = cache -undef cache # we use a function to prevent adding home_cache to the global scope +undef cache # Where brews installed via URL are cached HOMEBREW_CACHE_FORMULA = HOMEBREW_CACHE+"Formula"
false
Other
Homebrew
brew
a5a2141a1569bada1397b0b369311deea2888630.json
Hide the cxxstdlib data structure better
Library/Homebrew/cxxstdlib.rb
@@ -35,7 +35,7 @@ def compatible_with?(other) end def check_dependencies(formula, deps) - unless formula.class.cxxstdlib.include? :skip + unless formula.skip_cxxstdlib_check? deps.each do |dep| # Software is unlikely to link against anything from its # buildtime deps, so it doesn'...
true
Other
Homebrew
brew
a5a2141a1569bada1397b0b369311deea2888630.json
Hide the cxxstdlib data structure better
Library/Homebrew/formula.rb
@@ -247,6 +247,10 @@ def skip_clean? path self.class.skip_clean_paths.include? to_check end + def skip_cxxstdlib_check? + self.class.cxxstdlib.include?(:skip) + end + # yields self with current working directory set to the uncompressed tarball def brew validate_attributes :name, :version
true
Other
Homebrew
brew
dae83fc89586938ca6bebcf22c1c38022bb91303.json
Drop pointless string split
Library/Homebrew/exceptions.rb
@@ -179,8 +179,7 @@ def dump puts puts "#{Tty.red}READ THIS#{Tty.reset}: #{Tty.em}#{ISSUES_URL}#{Tty.reset}" if formula.tap? - user, repo = formula.tap.split '/' - tap_issues_url = "https://github.com/#{user}/#{repo}/issues" + tap_issues_url = "https://github.com/#{f.tap}/issue...
false
Other
Homebrew
brew
7bd4f76b8ca090e3dd266e68e0a7fe1b1c41277b.json
Check File.file? first to avoid second stat()
Library/Homebrew/utils.rb
@@ -185,7 +185,7 @@ def puts_columns items, star_items=[] def which cmd, path=ENV['PATH'] path.split(File::PATH_SEPARATOR).each do |p| pcmd = File.expand_path(File.join(p, cmd)) - return Pathname.new(pcmd) if File.executable?(pcmd) && !File.directory?(pcmd) + return Pathname.new(pcmd) if File.file?(pcmd)...
false
Other
Homebrew
brew
6a0720071e32b7e4031db0470bc9fb3056f46a75.json
Use Formula tap methods
Library/Homebrew/formula_versions.rb
@@ -13,8 +13,8 @@ def initialize(f) end def repository - @repository ||= if f.path.to_s =~ HOMEBREW_TAP_DIR_REGEX - HOMEBREW_REPOSITORY/"Library/Taps/#$1/#$2" + @repository ||= if f.tap? + HOMEBREW_LIBRARY.join("Taps", f.tap) else HOMEBREW_REPOSITORY end
false
Other
Homebrew
brew
f8fb74ff76f4f6b779bcaccee94bdb442f2ea51a.json
Escape paths in regexps
Library/Homebrew/cmd/tap.rb
@@ -123,7 +123,7 @@ def tap_ref(path) case path.to_s when HOMEBREW_TAP_PATH_REGEX "#$1/#$2/#{File.basename($3, '.rb')}" - when %r{^#{HOMEBREW_LIBRARY}/Formula/(.+)} + when %r{^#{Regexp.escape(HOMEBREW_LIBRARY.to_s)}/Formula/(.+)}o "Homebrew/homebrew/#{File.basename($1, '.rb')}" else ...
true
Other
Homebrew
brew
f8fb74ff76f4f6b779bcaccee94bdb442f2ea51a.json
Escape paths in regexps
Library/Homebrew/cmd/update.rb
@@ -266,7 +266,7 @@ def removed_tapped_formula def select_formula key fetch(key, []).map do |path| case path.to_s - when Regexp.new(HOMEBREW_LIBRARY + "/Formula") + when %r{^#{Regexp.escape(HOMEBREW_LIBRARY.to_s)}/Formula}o path.basename(".rb").to_s when HOMEBREW_TAP_PATH_REGEX ...
true
Other
Homebrew
brew
f8fb74ff76f4f6b779bcaccee94bdb442f2ea51a.json
Escape paths in regexps
Library/Homebrew/tap_constants.rb
@@ -3,6 +3,6 @@ # match taps' formula, e.g. someuser/sometap/someformula HOMEBREW_TAP_FORMULA_REGEX = %r{^([\w-]+)/([\w-]+)/([\w+-]+)$} # match taps' directory path, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap -HOMEBREW_TAP_DIR_REGEX = %r{#{HOMEBREW_LIBRARY}/Taps/([\w-]+)/([\w-]+)} +HOMEBREW_TAP_DIR_REGEX = %r{#{Reg...
true
Other
Homebrew
brew
9c757d6ee25c1acc2be8b74b3d1718456cd0ac9b.json
Remove remaining references to "--fresh" This option was removed in 8cdf4d8ebf439eb9a9ffcaa0e455ced9459e1e41 because it did not do anything.
Library/Contributions/brew_fish_completion.fish
@@ -131,7 +131,6 @@ complete -c brew -s d -l debug -n '__fish_complete_brew_command install' -d "Ope complete -c brew -s f -l force -n '__fish_complete_brew_command force' -d "Install formula even if blacklisted" complete -c brew -s i -l interactive -n '__fish_complete_brew_command install' -d "Open a subshell to ins...
true
Other
Homebrew
brew
9c757d6ee25c1acc2be8b74b3d1718456cd0ac9b.json
Remove remaining references to "--fresh" This option was removed in 8cdf4d8ebf439eb9a9ffcaa0e455ced9459e1e41 because it did not do anything.
Library/Contributions/cmd/brew-pull.rb
@@ -136,7 +136,7 @@ def tap arg changed_formulae.each do |f| ohai "Installing #{formula}" install = f.installed? ? 'upgrade' : 'install' - safe_system 'brew', install, '--debug', '--fresh', formula + safe_system 'brew', install, '--debug', formula end end end
true
Other
Homebrew
brew
4ab696e4f272d36b630b6aef33c8d1b9a7f82ef0.json
brew-pull: avoid the "var = ... rescue nil" dance
Library/Contributions/cmd/brew-pull.rb
@@ -80,7 +80,6 @@ def tap arg changed_formulae = [] - if tap_dir formula_dir = %w[Formula HomebrewFormula].find { |d| tap_dir.join(d).directory? } || "" else @@ -95,9 +94,12 @@ def tap arg # Don't try and do anything to removed files. if status == "A" || status == "M" name = File.base...
false
Other
Homebrew
brew
01dc9c4900b42d8d3556c316dbcb4a8597d8b7f4.json
brew-pull: rescue a specific exception
Library/Contributions/cmd/brew-pull.rb
@@ -73,7 +73,7 @@ def tap arg begin safe_system 'git', 'am', *patch_args - rescue => e + rescue ErrorDuringExecution system 'git', 'am', '--abort' odie 'Patch failed to apply: aborted.' end
false
Other
Homebrew
brew
9a9328eef485e8321e1242b4a291215fde959198.json
brew-pull: use diff-tree and simplify diff parsing
Library/Contributions/cmd/brew-pull.rb
@@ -80,12 +80,22 @@ def tap arg changed_formulae = [] - `git diff #{revision}.. --name-status`.each_line do |line| + + if tap_dir + formula_dir = %w[Formula HomebrewFormula].find { |d| tap_dir.join(d).directory? } || "" + else + formula_dir = "Library/Formula" + end + + Utils.popen_read( + "git", "...
false
Other
Homebrew
brew
cf4080a9e0517efc16a71b686e80c3ebcc38f5a2.json
Remove a RUBY_VERSION check, add a FIXME comment
Library/Homebrew/extend/pathname.rb
@@ -273,9 +273,8 @@ def verify_checksum expected raise ChecksumMismatchError.new(self, expected, actual) unless expected == actual end - if '1.9' <= RUBY_VERSION - alias_method :to_str, :to_s - end + # FIXME eliminate the places where we rely on this method + alias_method :to_str, :to_s unless method_d...
false
Other
Homebrew
brew
2d8a3ac35a71641c786de9f41389a3e5003b7141.json
Use popen wrapper Closes Homebrew/homebrew#30678.
Library/Homebrew/cmd/bottle.rb
@@ -63,7 +63,7 @@ def keg_contains string, keg end # Use strings to search through the file for each string - IO.popen("strings -t x - '#{file}'", "rb") do |io| + Utils.popen_read("strings", "-t", "x", "-", file.to_s) do |io| until io.eof? str = io.readline.chomp @@ -168,...
true
Other
Homebrew
brew
2d8a3ac35a71641c786de9f41389a3e5003b7141.json
Use popen wrapper Closes Homebrew/homebrew#30678.
Library/Homebrew/cmd/doctor.rb
@@ -27,7 +27,7 @@ def which path def get_mounts path=nil vols = [] # get the volume of path, if path is nil returns all volumes - raw_df = IO.popen("/bin/df -P #{path}", "rb", &:read) + raw_df = Utils.popen_read("/bin/df", "-P", path, &:read) raw_df.split("\n").each do |line| case line ...
true
Other
Homebrew
brew
2d8a3ac35a71641c786de9f41389a3e5003b7141.json
Use popen wrapper Closes Homebrew/homebrew#30678.
Library/Homebrew/download_strategy.rb
@@ -144,7 +144,7 @@ def fetch def buffered_write(tool) target = File.basename(basename_without_params, tarball_path.extname) - IO.popen("#{tool} -f '#{tarball_path}' -c", "rb") do |pipe| + Utils.popen_read(tool, "-f", tarball_path.to_s, "-c") do |pipe| File.open(target, "wb") do |f| buf ...
true
Other
Homebrew
brew
2d8a3ac35a71641c786de9f41389a3e5003b7141.json
Use popen wrapper Closes Homebrew/homebrew#30678.
Library/Homebrew/formula_versions.rb
@@ -39,7 +39,7 @@ def repository_path def rev_list(branch="HEAD") repository.cd do - IO.popen("git rev-list --abbrev-commit --remove-empty #{branch} -- #{entry_name}") do |io| + Utils.popen_read("git", "rev-list", "--abbrev-commit", "--remove-empty", branch, "--", entry_name) do |io| yield ...
true
Other
Homebrew
brew
2d8a3ac35a71641c786de9f41389a3e5003b7141.json
Use popen wrapper Closes Homebrew/homebrew#30678.
Library/Homebrew/keg_fix_install_names.rb
@@ -86,7 +86,7 @@ def detect_cxx_stdlibs(opts={:skip_executables => false}) end def each_unique_file_matching string - IO.popen("/usr/bin/fgrep -lr '#{string}' '#{self}' 2>/dev/null", "rb") do |io| + Utils.popen_read("/usr/bin/fgrep", "-lr", string, to_s) do |io| hardlinks = Set.new until ...
true
Other
Homebrew
brew
2d8a3ac35a71641c786de9f41389a3e5003b7141.json
Use popen wrapper Closes Homebrew/homebrew#30678.
Library/Homebrew/os/mac/hardware.rb
@@ -140,10 +140,7 @@ def sse4_2? def sysctl_bool(property) (@properties ||= {}).fetch(property) do - result = nil - IO.popen("/usr/sbin/sysctl -n '#{property}' 2>/dev/null") do |f| - result = f.gets.to_i # should be 0 or 1 - end + result = Utils.popen_read("/usr/sbin/sysctl", "-n", ...
true
Other
Homebrew
brew
ad27b21cd11a4e28f4174ebb54df357d6b6221a0.json
Add popen wrapper that does not invoke the shell
Library/Homebrew/test/test_utils.rb
@@ -5,4 +5,10 @@ def test_put_columns_empty # Issue #217 put columns with new results fails. assert_silent { puts_columns [] } end + + def test_popen_read + out = Utils.popen_read("/bin/sh", "-c", "echo success", &:read).chomp + assert_equal "success", out + assert_predicate $?, :success? + end ...
true
Other
Homebrew
brew
ad27b21cd11a4e28f4174ebb54df357d6b6221a0.json
Add popen wrapper that does not invoke the shell
Library/Homebrew/utils.rb
@@ -3,6 +3,7 @@ require 'os/mac' require 'utils/json' require 'utils/inreplace' +require 'utils/popen' require 'open-uri' class Tty
true
Other
Homebrew
brew
ad27b21cd11a4e28f4174ebb54df357d6b6221a0.json
Add popen wrapper that does not invoke the shell
Library/Homebrew/utils/popen.rb
@@ -0,0 +1,20 @@ +module Utils + def self.popen_read(*args, &block) + popen(args, "rb", &block) + end + + def self.popen_write(*args, &block) + popen(args, "wb", &block) + end + + def self.popen(args, mode) + IO.popen("-", mode) do |pipe| + if pipe + yield pipe + else + STDERR.reop...
true
Other
Homebrew
brew
f666b76c39f4f25d1dea9477cd9a69f0b46c2af1.json
Add more tests documenting linking behavior
Library/Homebrew/test/test_keg.rb
@@ -15,6 +15,7 @@ def setup @keg = Keg.new(keg) @dst = HOMEBREW_PREFIX.join("bin", "helloworld") + @nonexistent = Pathname.new("/some/nonexistent/path") @mode = OpenStruct.new @@ -42,7 +43,9 @@ def test_linking_keg def test_unlinking_keg @keg.link + assert_predicate @dst, :symlink? ...
false
Other
Homebrew
brew
60fc7eb0edba51e29de0981e9662fd6b51bd651b.json
Avoid chdir just to make a symlink
Library/Homebrew/test/test_keg.rb
@@ -82,9 +82,7 @@ def test_link_overwrite end def test_link_overwrite_broken_symlinks - cd HOMEBREW_PREFIX/"bin" do - ln_s "nowhere", "helloworld" - end + @dst.make_symlink "nowhere" @mode.overwrite = true assert_equal 3, @keg.link(@mode) assert_predicate @keg, :linked?
false
Other
Homebrew
brew
083448d55d90400c10fa352bf676f5cfe1c2c16d.json
Move repeated pathname into setup
Library/Homebrew/test/test_keg.rb
@@ -14,6 +14,7 @@ def setup end @keg = Keg.new(keg) + @dst = HOMEBREW_PREFIX.join("bin", "helloworld") @mode = OpenStruct.new @@ -62,20 +63,19 @@ def test_linking_fails_when_already_linked end def test_linking_fails_when_files_exist - touch HOMEBREW_PREFIX/"bin/helloworld" + touch ...
false
Other
Homebrew
brew
9c5943d97a0737bfa410b4653fd244e3ce13ec39.json
bottle: use revision to find bottle block too.
Library/Homebrew/cmd/bottle.rb
@@ -239,7 +239,7 @@ def merge odie 'Bottle block update failed!' unless string else update_or_add = 'add' - string = s.sub!(/( (url|sha1|sha256|head|version|mirror) ['"][\S ]+['"]\n+)+/m, '\0' + output + "\n") + string = s.sub!(/( (url|sha1|sha256|head|versio...
false
Other
Homebrew
brew
b78308d2d5a8dd26818eba88bb58ee547d6dfdb0.json
Fix Formula#<=> on trunk Ruby Arguably this method shouldn't exist and sort_by(&:name) used instead.
Library/Homebrew/formula.rb
@@ -301,9 +301,12 @@ def == other def hash name.hash end - def <=> b - name <=> b.name + + def <=>(other) + return unless Formula === other + name <=> other.name end + def to_s name end
true
Other
Homebrew
brew
b78308d2d5a8dd26818eba88bb58ee547d6dfdb0.json
Fix Formula#<=> on trunk Ruby Arguably this method shouldn't exist and sort_by(&:name) used instead.
Library/Homebrew/test/test_formula.rb
@@ -139,6 +139,10 @@ def test_comparison_with_non_formula_objects_does_not_raise refute_equal TestBall.new, Object.new end + def test_sort_operator + assert_nil TestBall.new <=> Object.new + end + def test_class_naming assert_equal 'ShellFm', Formulary.class_s('shell.fm') assert_equal 'Fooxx...
true
Other
Homebrew
brew
729ee39994faf25803d50e33dec0620dae5d964e.json
Add missing require
Library/Contributions/cmd/brew-test-bot.rb
@@ -20,6 +20,7 @@ # --ci-testing-upload: Homebrew CI testing bottle upload. require 'formula' +require 'extend/ENV' require 'utils' require 'date' require 'rexml/document'
false
Other
Homebrew
brew
cabc451ca8a0047347ab0ecbec88b87167c37030.json
Add min_version to X11Dependency inspect string
Library/Homebrew/requirements/x11_dependency.rb
@@ -38,4 +38,8 @@ def <=> other def eql?(other) super && min_version == other.min_version end + + def inspect + "#<#{self.class.name}: #{name.inspect} #{tags.inspect} min_version=#{min_version}>" + end end
false
Other
Homebrew
brew
07e00061a7b8b4c831f6d94e6ee4fbb9804e7723.json
Pass relative paths into link exceptions
Library/Homebrew/keg.rb
@@ -37,7 +37,7 @@ def suggestion def to_s s = [] - s << "Could not symlink #{src.relative_path_from(Pathname(keg))}" + s << "Could not symlink #{src}" s << "Target #{dst}" << suggestion s << <<-EOS.undent To force the link and overwrite all conflicting files: @@ -52,7 +52,...
false
Other
Homebrew
brew
177eee419a455c3fc759d6a75c392f30be50a4dc.json
Replace find_all + each with grep
Library/Homebrew/extend/set.rb
@@ -5,8 +5,7 @@ def add new # smileys only return super new unless new.respond_to? :> - objs = find_all { |o| o.class == new.class } - objs.each do |o| + grep(new.class) do |o| return self if o > new delete o end
false
Other
Homebrew
brew
fe3e802c500935f74d403dd7e7f0f740f89d44ba.json
X11Dependency objects: fix hash equality
Library/Homebrew/requirements/x11_dependency.rb
@@ -34,4 +34,8 @@ def <=> other return unless X11Dependency === other min_version <=> other.min_version end + + def eql?(other) + super && min_version == other.min_version + end end
true
Other
Homebrew
brew
fe3e802c500935f74d403dd7e7f0f740f89d44ba.json
X11Dependency objects: fix hash equality
Library/Homebrew/test/test_x11_dependency.rb
@@ -19,6 +19,13 @@ def test_not_eql_when_hashes_differ assert !y.eql?(x) end + def test_different_min_version + x = X11Dependency.new + y = X11Dependency.new("x11", %w[2.5]) + refute x.eql?(y) + refute y.eql?(x) + end + def test_x_env x = X11Dependency.new x.stubs(:satisfied?).retur...
true
Other
Homebrew
brew
fc2d403a825b187f9979e7808344aab7ed533900.json
X11Dependency: use Version objects
Library/Homebrew/requirements/x11_dependency.rb
@@ -11,12 +11,16 @@ class X11Dependency < Requirement def initialize(name="x11", tags=[]) @name = name - @min_version = tags.shift if /(\d\.)+\d/ === tags.first + if /(\d\.)+\d/ === tags.first + @min_version = Version.new(tags.shift) + else + @min_version = Version.new("0.0.0") + end ...
true
Other
Homebrew
brew
fc2d403a825b187f9979e7808344aab7ed533900.json
X11Dependency: use Version objects
Library/Homebrew/test/test_dependency_collector.rb
@@ -69,7 +69,7 @@ def test_x11_no_tag def test_x11_min_version @d.add :x11 => '2.5.1' - assert_equal "2.5.1", find_requirement(X11Dependency).min_version + assert_equal "2.5.1", find_requirement(X11Dependency).min_version.to_s end def test_x11_tag @@ -80,7 +80,7 @@ def test_x11_tag def test_x...
true
Other
Homebrew
brew
3f6827374f5d48ad8e44802650f2c4e2aa7bd9a6.json
Use to_a definition from Enumerable
Library/Homebrew/dependencies.rb
@@ -22,9 +22,6 @@ def *(arg) @deps * arg end - def to_a - @deps - end alias_method :to_ary, :to_a def optional
true
Other
Homebrew
brew
3f6827374f5d48ad8e44802650f2c4e2aa7bd9a6.json
Use to_a definition from Enumerable
Library/Homebrew/options.rb
@@ -109,9 +109,6 @@ def concat(o) self end - def to_a - @options.to_a - end alias_method :to_ary, :to_a def inspect
true
Other
Homebrew
brew
804872fc94738e5a33c6bab11f8721747142b2a8.json
Use sort_by in missing deps doctor check
Library/Homebrew/cmd/doctor.rb
@@ -891,16 +891,16 @@ def check_tmpdir def check_missing_deps return unless HOMEBREW_CELLAR.exist? - s = Set.new + missing = Set.new Homebrew.missing_deps(Formula.installed).each_value do |deps| - s.merge deps + missing.merge(deps) end - if s.length > 0 then <<-EOS.undent + if missing.any? then ...
false
Other
Homebrew
brew
6a1ad36fbd99b75f67cbc234cb887218b2d9d8cc.json
Use sort_by in PrettyListing
Library/Homebrew/cmd/list.rb
@@ -85,7 +85,7 @@ def list_pinned class PrettyListing def initialize path - Pathname.new(path).children.sort{ |a,b| a.to_s.downcase <=> b.to_s.downcase }.each do |pn| + Pathname.new(path).children.sort_by { |p| p.to_s.downcase }.each do |pn| case pn.basename.to_s when 'bin', 'sbin' pn...
false
Other
Homebrew
brew
c2228c0d0f266b5984530ffc169ba247c5f18037.json
Remove default argument from make_relative_symlink All callers of this method now pass a mode object.
Library/Homebrew/keg.rb
@@ -336,7 +336,7 @@ def resolve_any_conflicts dst, mode puts "Won't resolve conflicts for symlink #{dst} as it doesn't resolve into the Cellar" if ARGV.verbose? end - def make_relative_symlink dst, src, mode=OpenStruct.new + def make_relative_symlink dst, src, mode if dst.symlink? && dst.exist? && dst....
false
Other
Homebrew
brew
4ea3997d9c29d37befb415a5e9b3e3f88b184fff.json
Pass the mode through the optlink method
Library/Homebrew/keg.rb
@@ -301,7 +301,7 @@ def link mode=OpenStruct.new unless mode.dry_run make_relative_symlink(linked_keg_record, path, mode) - optlink + optlink(mode) end rescue LinkError unlink @@ -310,9 +310,9 @@ def link mode=OpenStruct.new ObserverPathnameExtension.total end - def optli...
false
Other
Homebrew
brew
548d66be59d8c44eccae72c85f2996b3df0cd57a.json
Simplify optlink method delete/unlink on a directory is the same operation as rmdir.
Library/Homebrew/keg.rb
@@ -311,13 +311,7 @@ def link mode=OpenStruct.new end def optlink - if opt_record.symlink? - opt_record.delete - elsif opt_record.directory? - opt_record.rmdir - elsif opt_record.exist? - opt_record.delete - end + opt_record.delete if opt_record.symlink? || opt_record.exist? m...
false
Other
Homebrew
brew
c0baad7e68940c9783dcfe04b87918ef4029e24b.json
Add tests around opt links
Library/Homebrew/test/test_keg.rb
@@ -125,4 +125,23 @@ def test_unlink_ignores_DS_Store_when_pruning_empty_dirs refute_predicate HOMEBREW_PREFIX/"lib/foo", :directory? refute_predicate HOMEBREW_PREFIX/"lib/foo/.DS_Store", :exist? end + + def test_existing_opt_link + @keg.opt_record.make_relative_symlink Pathname.new(@keg) + @keg.opt...
false
Other
Homebrew
brew
d792b6465524dbcefa7876e2fb63c8e7b6074aa8.json
Add methods for manipulating the opt record
Library/Homebrew/keg.rb
@@ -163,14 +163,19 @@ def remove_linked_keg_record linked_keg_record.parent.rmdir_if_possible end + def optlinked? + opt_record.symlink? && path == opt_record.resolved_path + end + + def remove_opt_record + opt_record.unlink + opt_record.parent.rmdir_if_possible + end + def uninstall path...
false
Other
Homebrew
brew
4c05d411f3345c083c933b3666229cd555162e0d.json
Add a method for getting the repo HEAD
Library/Homebrew/cmd/config.rb
@@ -44,10 +44,7 @@ def clt end def head - head = HOMEBREW_REPOSITORY.cd do - `git rev-parse --verify -q HEAD 2>/dev/null`.chomp - end - if head.empty? then "(none)" else head end + Homebrew.git_head || "(none)" end def origin
true
Other
Homebrew
brew
4c05d411f3345c083c933b3666229cd555162e0d.json
Add a method for getting the repo HEAD
Library/Homebrew/tab.rb
@@ -14,18 +14,14 @@ def self.create f, compiler, stdlib, args build = f.build.dup build.args = args - sha = HOMEBREW_REPOSITORY.cd do - `git rev-parse --verify -q HEAD 2>/dev/null`.chuzzle - end - Tab.new :used_options => build.used_options, :unused_options => build.unused_optio...
true
Other
Homebrew
brew
4c05d411f3345c083c933b3666229cd555162e0d.json
Add a method for getting the repo HEAD
Library/Homebrew/utils.rb
@@ -112,6 +112,10 @@ def self.system cmd, *args Process.wait(pid) $?.success? end + + def self.git_head + HOMEBREW_REPOSITORY.cd { `git rev-parse --verify -q HEAD 2>/dev/null`.chuzzle } + end end def with_system_path
true
Other
Homebrew
brew
c904c71792233c5564a5b73814bfbb8d81389b50.json
Fix tab tests
Library/Homebrew/test/test_tab.rb
@@ -55,7 +55,7 @@ def test_universal? end def test_options - assert_equal (@used + @unused).to_a, @tab.options.to_a + assert_equal (@used + @unused).sort, @tab.options.sort end def test_cxxstdlib @@ -75,9 +75,9 @@ def test_from_file path = Pathname.new(TEST_DIRECTORY).join("fixtures", "receip...
false
Other
Homebrew
brew
ac687d3b5f3654d8eaea8d4b8fc86905ef0a9f36.json
Remove explicit self
Library/Homebrew/tab.rb
@@ -40,9 +40,9 @@ def self.for_keg keg path = keg.join(FILENAME) if path.exist? - self.from_file(path) + from_file(path) else - self.dummy_tab + dummy_tab end end
false
Other
Homebrew
brew
07171f55275f5aee010a6b529300f2b448863642.json
Test that the tab round-trips through JSON
Library/Homebrew/test/test_tab.rb
@@ -9,15 +9,15 @@ def setup @unused << Option.new("with-baz") << Option.new("without-qux") @tab = Tab.new({ - :used_options => @used, - :unused_options => @unused, + :used_options => @used.map(&:to_s), + :unused_options => @unused.map(&:to_s), :built_as_bottle ...
false
Other
Homebrew
brew
cd91709120d3666a0dc41076798749a07c1365db.json
Fix typo in tab test setup This is one of the many problems with using OpenStruct.
Library/Homebrew/test/test_tab.rb
@@ -11,7 +11,7 @@ def setup @tab = Tab.new({ :used_options => @used, :unused_options => @unused, - :build_as_bottle => false, + :built_as_bottle => false, :poured_from_bottle => true, :tapped_from => "Homebrew/homebrew", :time => nil...
false
Other
Homebrew
brew
391bc4c981311209cf15610c6eb272143e3a6415.json
Normalize paths before calling Tab.from_file
Library/Homebrew/tab.rb
@@ -32,7 +32,7 @@ def self.create f, compiler, stdlib, args def self.from_file path tab = Tab.new Utils::JSON.load(File.read(path)) - tab.tabfile = path.realpath + tab.tabfile = path tab end @@ -51,7 +51,15 @@ def self.for_name name end def self.for_formula f - paths = [f.opt_prefix...
true
Other
Homebrew
brew
391bc4c981311209cf15610c6eb272143e3a6415.json
Normalize paths before calling Tab.from_file
Library/Homebrew/test/test_tab.rb
@@ -93,7 +93,6 @@ def setup @f.prefix.mkpath @path = @f.prefix.join(Tab::FILENAME) @path.write Pathname.new(TEST_DIRECTORY).join("fixtures", "receipt.json").read - @path = @path.realpath end def teardown
true
Other
Homebrew
brew
34db1bd1efc0204a4a8c8c77e12eb233980c7576.json
Remove test that is now covered by tab tests
Library/Homebrew/test/test_stdlib.rb
@@ -2,7 +2,6 @@ require 'test/testball' require 'formula' require 'cxxstdlib' -require 'tab' class CxxStdlibTests < Homebrew::TestCase def setup @@ -56,12 +55,6 @@ def test_type_string_formatting assert_equal "libc++", @lcxx.type_string end - def test_constructing_from_tab - stdlib = Tab.dummy_ta...
false
Other
Homebrew
brew
e2e5839a9a9d12c7b801593445b3b8c144bd4063.json
Get the Tab class under test
Library/Homebrew/test/fixtures/receipt.json
@@ -0,0 +1,17 @@ +{ + "used_options": [ + "--with-foo", + "--without-bar" + ], + "unused_options": [ + "--with-baz", + "--without-qux" + ], + "built_as_bottle": false, + "poured_from_bottle": true, + "tapped_from": "Homebrew/homebrew", + "time": 1403827774, + "HEAD": "deadbeefdeadbeefdeadbeefdeadbe...
true
Other
Homebrew
brew
e2e5839a9a9d12c7b801593445b3b8c144bd4063.json
Get the Tab class under test
Library/Homebrew/test/test_tab.rb
@@ -0,0 +1,87 @@ +require "testing_env" +require "tab" + +class TabTests < Homebrew::TestCase + def setup + @used, @unused = Options.new, Options.new + @used << Option.new("with-foo") << Option.new("without-bar") + @unused << Option.new("with-baz") << Option.new("without-qux") + + @tab = Tab.new({ + :...
true
Other
Homebrew
brew
fde884e31926d38a4e3dfa977339fc2c68a538b4.json
Use TEST_SHA1 constant in checksum tests
Library/Homebrew/test/test_checksum.rb
@@ -7,16 +7,16 @@ def test_empty? end def test_equality - a = Checksum.new(:sha1, 'deadbeef'*5) - b = Checksum.new(:sha1, 'deadbeef'*5) + a = Checksum.new(:sha1, TEST_SHA1) + b = Checksum.new(:sha1, TEST_SHA1) assert_equal a, b - a = Checksum.new(:sha1, 'deadbeef'*5) - b = Checksum.new(...
false
Other
Homebrew
brew
58e5ac6835fb0901f01180aeb2169e7f30a44443.json
Implement directory? on keg Fixes Homebrew/homebrew#30484.
Library/Homebrew/keg.rb
@@ -131,6 +131,10 @@ def abv path.abv end + def directory? + path.directory? + end + def exist? path.exist? end
false
Other
Homebrew
brew
7cd31377a4969b96ed8da9d87f5a70f5a16aed61.json
Convert update report to use composition
Library/Homebrew/cmd/update.rb
@@ -31,7 +31,7 @@ def update ensure link_tap_formula(tapped_formulae) end - report.merge!(master_updater.report) + report.update(master_updater.report) # rename Taps directories # this procedure will be removed in the future if it seems unnecessasry @@ -46,7 +46,7 @@ def update ...
true
Other
Homebrew
brew
7cd31377a4969b96ed8da9d87f5a70f5a16aed61.json
Convert update report to use composition
Library/Homebrew/test/test_updater.rb
@@ -54,7 +54,7 @@ def perform_update(diff_output="") @updater.in_repo_expect("git rev-parse -q --verify HEAD", "3456cdef") @updater.in_repo_expect("git diff-tree -r --raw -M85% 1234abcd 3456cdef", diff_output) @updater.pull! - @report.merge!(@updater.report) + @report.update(@updater.repo...
true
Other
Homebrew
brew
70f22fc31e8aea5cd3c05f5a9cde54896814099f.json
Use canonical_name in the exception message
Library/Homebrew/extend/ARGV.rb
@@ -35,7 +35,7 @@ def kegs elsif (prefix = Formulary.factory(canonical_name).prefix).directory? Keg.new(prefix) else - raise MultipleVersionsInstalledError.new(name) + raise MultipleVersionsInstalledError.new(canonical_name) end rescue FormulaUnavailableErr...
false
Other
Homebrew
brew
301f1b20e698107e2f3b13bf4a2e8035affbaf03.json
Remove a dead branch from ARGV.kegs rack cannot be nil at the point where FormulaUnavailableError is raised, so we don't need a branch to deal with that.
Library/Homebrew/extend/ARGV.rb
@@ -26,29 +26,27 @@ def kegs linked_keg_ref = HOMEBREW_REPOSITORY/"Library/LinkedKegs"/name opt_prefix = HOMEBREW_PREFIX/"opt"/name - if opt_prefix.symlink? && opt_prefix.directory? - Keg.new(opt_prefix.resolved_path) - elsif linked_keg_ref.symlink? && linked_keg_ref.directory? - ...
false
Other
Homebrew
brew
dce7b04ea572fdd4e19b8d611625a979b48a74ce.json
Simplify NoSuchKegError condition dirs will be empty if the rack directory does not exist.
Library/Homebrew/extend/ARGV.rb
@@ -21,7 +21,7 @@ def kegs rack = HOMEBREW_CELLAR/canonical_name dirs = rack.directory? ? rack.subdirs : [] - raise NoSuchKegError.new(rack.basename.to_s) if not rack.directory? or dirs.empty? + raise NoSuchKegError.new(rack.basename.to_s) if dirs.empty? linked_keg_ref = HOMEBREW_REPO...
false
Other
Homebrew
brew
3e35aacbbb4f0bc9d8408aa401d5be530aa218a4.json
Remove dead code
Library/Homebrew/formula_installer.rb
@@ -174,7 +174,6 @@ def install opoo e.message end - stdlibs = Keg.new(f.prefix).detect_cxx_stdlibs :skip_executables => true tab = Tab.for_keg f.prefix tab.poured_from_bottle = true tab.write
false
Other
Homebrew
brew
85b6953816d5329da233b9445a2b3c80623049fe.json
Pass strings, not keg objects, to exec
Library/Homebrew/cmd/bottle.rb
@@ -35,7 +35,7 @@ module Homebrew def keg_contains string, keg if not ARGV.homebrew_developer? - return quiet_system 'fgrep', '--recursive', '--quiet', '--max-count=1', string, keg + return quiet_system 'fgrep', '--recursive', '--quiet', '--max-count=1', string, keg.to_s end result = fals...
true
Other
Homebrew
brew
85b6953816d5329da233b9445a2b3c80623049fe.json
Pass strings, not keg objects, to exec
Library/Homebrew/cmd/list.rb
@@ -18,7 +18,7 @@ def list ENV['CLICOLOR'] = nil exec 'ls', *ARGV.options_only << HOMEBREW_CELLAR elsif ARGV.verbose? or not $stdout.tty? - exec "find", *ARGV.kegs + %w[-not -type d -print] + exec "find", *ARGV.kegs.map(&:to_s) + %w[-not -type d -print] else ARGV.kegs.each{ |keg...
true
Other
Homebrew
brew
7673c40f2502a64c1f28c9e0f4ec13fa9d27c5dd.json
brew.rb: handle single usage flag case.
Library/brew.rb
@@ -114,12 +114,13 @@ def require? path # Usage instructions should be displayed if and only if one of: # - a help flag is passed AND an internal command is matched + # - a help flag is passed AND there is no command specified # - no arguments are passed # # It should never affect external commands so...
false
Other
Homebrew
brew
7ecffd2771c64356824a71e975a2216bc64fd159.json
brew.rb: handle -—help for internal/external cmds. Only display —-help for internal commands and not for external ones; they can handle the flag themselves. Closes Homebrew/homebrew#26675. References Homebrew/homebrew#26755. Closes Homebrew/homebrew#30300.
Library/brew.rb
@@ -15,12 +15,7 @@ $:.unshift(HOMEBREW_LIBRARY_PATH.to_s) require 'global' -if ARGV.empty? || ARGV[0] =~ /(-h$|--help$|--usage$|-\?$|help$)/ - # TODO - `brew help cmd` should display subcommand help - require 'cmd/help' - puts ARGV.usage - exit ARGV.any? ? 0 : 1 -elsif ARGV.first == '--version' +if ARGV.first =...
false
Other
Homebrew
brew
2daabe9863bd430a696020419d3534d22cac9fbb.json
Fix uninitialized constant error in GitHub.open The error handling depends on side effects of `require "net/https"`, so it should be wrapped in an explicit begin block. cf. Homebrew/homebrew#30407.
Library/Homebrew/utils.rb
@@ -311,15 +311,18 @@ def open url, headers={}, &block } default_headers['Authorization'] = "token #{HOMEBREW_GITHUB_API_TOKEN}" if HOMEBREW_GITHUB_API_TOKEN - Kernel.open(url, default_headers.merge(headers)) do |f| - yield Utils::JSON.load(f.read) + + begin + Kernel.open(url, default_header...
false