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 | bdee729a41fbaec0607f26749cc09730792ec77e.json | Yield absolute paths from find_formula | Library/Homebrew/cmd/search.rb | @@ -32,8 +32,8 @@ def search
if tap_dir.directory?
result = ""
if query
- tap_dir.find_formula do |child|
- basename = child.basename(".rb").to_s
+ tap_dir.find_formula do |file|
+ basename = file.basename(".rb").to_s
result = basename if bas... | true |
Other | Homebrew | brew | bdee729a41fbaec0607f26749cc09730792ec77e.json | Yield absolute paths from find_formula | Library/Homebrew/cmd/tap.rb | @@ -25,7 +25,7 @@ def install_tap user, repo
abort unless system "git clone https://github.com/#{repouser}/homebrew-#{repo} #{tapd}"
files = []
- tapd.find_formula { |file| files << tapd.join(file) }
+ tapd.find_formula { |file| files << file }
link_tap_formula(files)
puts "Tapped #{files.le... | true |
Other | Homebrew | brew | bdee729a41fbaec0607f26749cc09730792ec77e.json | Yield absolute paths from find_formula | Library/Homebrew/cmd/untap.rb | @@ -18,7 +18,7 @@ def untap
raise "No such tap!" unless tapd.directory?
files = []
- tapd.find_formula { |file| files << tapd.join(file) }
+ tapd.find_formula { |file| files << file }
unlink_tap_formula(files)
tapd.rmtree
tapd.dirname.rmdir_if_possible | true |
Other | Homebrew | brew | bdee729a41fbaec0607f26749cc09730792ec77e.json | Yield absolute paths from find_formula | Library/Homebrew/extend/pathname.rb | @@ -321,8 +321,8 @@ def uninstall_info
def find_formula
[self/:Formula, self/:HomebrewFormula, self].each do |d|
if d.exist?
- d.children.map{ |child| child.relative_path_from(self) }.each do |pn|
- yield pn if pn.to_s =~ /.rb$/
+ d.children.each do |pn|
+ yield pn if pn.e... | true |
Other | Homebrew | brew | bdee729a41fbaec0607f26749cc09730792ec77e.json | Yield absolute paths from find_formula | Library/Homebrew/formulary.rb | @@ -163,9 +163,9 @@ def initialize tapped_name
path = tap.join("#{name}.rb")
if tap.directory?
- tap.find_formula do |child|
- if child.basename(".rb").to_s == name
- path = tap.join(child)
+ tap.find_formula do |file|
+ if file.basename(".rb").to_s == name
+ ... | true |
Other | Homebrew | brew | b0cd6b03765b46c648f55c709a637c308c6942d6.json | Extract some boilerplate into an each_tap method | Library/Homebrew/cmd/tap.rb | @@ -2,13 +2,9 @@ module Homebrew extend self
def tap
if ARGV.empty?
- tapd = HOMEBREW_LIBRARY/"Taps"
- tapd.children.each do |user|
- next unless user.directory?
- user.children.each do |repo|
- puts "#{user.basename}/#{repo.basename.sub("homebrew-", "")}" if (repo/".git").dir... | true |
Other | Homebrew | brew | b0cd6b03765b46c648f55c709a637c308c6942d6.json | Extract some boilerplate into an each_tap method | Library/Homebrew/cmd/update.rb | @@ -38,19 +38,16 @@ def update
# this procedure will be removed in the future if it seems unnecessasry
rename_taps_dir_if_necessary
- Dir["Library/Taps/*/"].each do |user|
- Dir["#{user}*/"].each do |repo|
- cd repo do
- begin
- updater = Updater.new
- updater.p... | true |
Other | Homebrew | brew | 99c275d03b3e536ed315c67ef24ef62df15f0f40.json | Remove slow tab completion for `brew tap`
This requires hitting the network, which makes the first invocation
slow. The results are inaccurate as it only pulls down the first page of
results. It is also prone to false-positives.
A better implementation is welcome, but in the years since I wrote this
code I can't thin... | Library/Contributions/brew_bash_completion.sh | @@ -133,16 +133,6 @@ _brew_complete_tap ()
return
;;
esac
- __brew_complete_taps
-}
-
-__brew_complete_taps ()
-{
- if [[ -z "$__brew_cached_taps" ]]; then
- __brew_cached_taps="$(brew ls-taps)"
- fi
-
- __brewcomp "$__brew_cached_taps"
}
_brew_bottle () | true |
Other | Homebrew | brew | 99c275d03b3e536ed315c67ef24ef62df15f0f40.json | Remove slow tab completion for `brew tap`
This requires hitting the network, which makes the first invocation
slow. The results are inaccurate as it only pulls down the first page of
results. It is also prone to false-positives.
A better implementation is welcome, but in the years since I wrote this
code I can't thin... | Library/Contributions/brew_fish_completion.fish | @@ -37,11 +37,6 @@ function __fish_complete_brew_argument
return 0
end
- if contains -- $cmd tap
- brew ls-taps
- return 0
- end
-
if contains -- $cmd untap
ls (brew --repository)/Library/Taps 2>/dev/null | sed 's/-/\//g'
return 0 | true |
Other | Homebrew | brew | 99c275d03b3e536ed315c67ef24ef62df15f0f40.json | Remove slow tab completion for `brew tap`
This requires hitting the network, which makes the first invocation
slow. The results are inaccurate as it only pulls down the first page of
results. It is also prone to false-positives.
A better implementation is welcome, but in the years since I wrote this
code I can't thin... | Library/Contributions/cmd/brew-ls-taps.rb | @@ -1,11 +0,0 @@
-require "utils/json"
-
-GitHub.open("https://api.github.com/search/repositories?q=homebrew+in:name&sort=stars&per_page=100") do |json|
- json["items"].each do |repo|
- if repo["name"] =~ /^homebrew-(\S+)$/
- user = repo["owner"]["login"]
- user = user.downcase if user == "Homebrew"
- ... | true |
Other | Homebrew | brew | c466b20591df86f9972b42d5f3e2ce9ab2cfdd34.json | Fix tap completion when there aren't any taps | Library/Contributions/brew_bash_completion.sh | @@ -67,6 +67,7 @@ __brew_complete_formulae ()
local tf file
for file in ${taps}/*/*/*.rb ${taps}/*/*/Formula/*.rb ${taps}/*/*/HomebrewFormula/*.rb; do
+ [ -f "$file" ] || continue
file=${file/"Formula/"/}
file=${file/"HomebrewFormula/"/}
file=${file#${lib}/Taps/}
@@ -115,6 ... | false |
Other | Homebrew | brew | ccd31a2dd26ce5db8f247f8261e808702d061454.json | Pass arguments instead of reopening Pathname | Library/Homebrew/cmd/tap.rb | @@ -61,7 +61,7 @@ def link_tap_formula formulae
to.make_relative_symlink(from)
rescue SystemCallError
to = to.realpath if to.exist?
- opoo "Could not tap #{Tty.white}#{from.tap_ref}#{Tty.reset} over #{Tty.white}#{to.tap_ref}#{Tty.reset}"
+ opoo "Could not tap #{Tty.white}#{tap_ref... | false |
Other | Homebrew | brew | 3f10327c0e9327501e3fd0cdff21b79e9658f4e5.json | Update bash completion for new tap format | Library/Contributions/brew_bash_completion.sh | @@ -66,12 +66,12 @@ __brew_complete_formulae ()
local af=$(\ls ${lib}/Aliases 2>/dev/null)
local tf file
- for file in ${taps}/*/*.rb ${taps}/*/Formula/*.rb ${taps}/*/HomebrewFormula/*.rb; do
+ for file in ${taps}/*/*/*.rb ${taps}/*/*/Formula/*.rb ${taps}/*/*/HomebrewFormula/*.rb; do
file=${f... | false |
Other | Homebrew | brew | 4303817ec78bbd7a36b919062f6fada64a337028.json | separate the brew info for multiple formulae
Closes Homebrew/homebrew#27311.
Signed-off-by: Adam Vandenberg <flangy@gmail.com> | Library/Homebrew/cmd/info.rb | @@ -24,7 +24,8 @@ def print_info
puts "#{HOMEBREW_CELLAR.children.length} kegs, #{HOMEBREW_CELLAR.abv}"
end
else
- ARGV.named.each do |f|
+ ARGV.named.each_with_index do |f,i|
+ puts unless i == 0
begin
info_formula Formula.factory(f)
rescue FormulaUnav... | false |
Other | Homebrew | brew | 165fdf4617b6ebefebfff47237626ac816a86cf8.json | Use gcc instead of apple-gcc42 when needed. | Library/Contributions/cmd/brew-test-bot.rb | @@ -278,7 +278,7 @@ def formula formula
CompilerSelector.new(formula_object).compiler
rescue CompilerSelectionError => e
unless installed_gcc
- test "brew install apple-gcc42"
+ test "brew install gcc"
installed_gcc = true
retry
end | true |
Other | Homebrew | brew | 165fdf4617b6ebefebfff47237626ac816a86cf8.json | Use gcc instead of apple-gcc42 when needed. | Library/Homebrew/exceptions.rb | @@ -224,7 +224,7 @@ def initialize f
super f, <<-EOS.undent
#{f.name} cannot be built with any available compilers.
To install this formula, you may need to:
- brew install apple-gcc42
+ brew install gcc
EOS
end
end | true |
Other | Homebrew | brew | 249aae177f3e6fb100c391c1f4562cc331c69d2e.json | formula: move cxxstdlib methods to the class.
This allows disabling this checks when e.g. pouring bottles. | Library/Homebrew/compat/formula.rb | @@ -16,6 +16,14 @@ def std_cmake_parameters
"-DCMAKE_INSTALL_PREFIX='#{prefix}' -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev"
end
+ def cxxstdlib
+ self.class.cxxstdlib
+ end
+
+ def cxxstdlib_check check_type
+ self.class.cxxstdlib_check check_type
+ end
+
def self.bottle_sha1(*)... | true |
Other | Homebrew | brew | 249aae177f3e6fb100c391c1f4562cc331c69d2e.json | formula: move cxxstdlib methods to the class.
This allows disabling this checks when e.g. pouring bottles. | Library/Homebrew/cxxstdlib.rb | @@ -33,7 +33,7 @@ def compatible_with?(other)
end
def check_dependencies(formula, deps)
- unless formula.cxxstdlib.include? :skip
+ unless formula.class.cxxstdlib.include? :skip
deps.each do |dep|
# Software is unlikely to link against anything from its
# buildtime deps, so it doe... | true |
Other | Homebrew | brew | 249aae177f3e6fb100c391c1f4562cc331c69d2e.json | formula: move cxxstdlib methods to the class.
This allows disabling this checks when e.g. pouring bottles. | Library/Homebrew/formula.rb | @@ -439,12 +439,6 @@ def recursive_requirements(&block)
Requirement.expand(self, &block)
end
- # Flag for marking whether this formula needs C++ standard library
- # compatibility check
- def cxxstdlib
- @cxxstdlib ||= Set.new
- end
-
def to_hash
hsh = {
"name" => name,
@@ -607,12 +601,6... | true |
Other | Homebrew | brew | 722a5af4ebf68adb9fc3d2e828d054e228dcf5f0.json | Simplify conditions for superenv activation
`MacOS::Xcode.without_clt? && MacOS.sdk_path.nil?` should never be true.
In its earliest form, this would raise a bare RuntimeError in an effort
to have the bug reported. Later, it was changed to silently disable
superenv. But we don't want to do that. If there's a bug, or ... | Library/Homebrew/extend/ENV.rb | @@ -4,10 +4,7 @@
require 'extend/ENV/super'
def superenv?
- return false if MacOS::Xcode.without_clt? && MacOS.sdk_path.nil?
- return false unless Superenv.bin && Superenv.bin.directory?
- return false if ARGV.env == "std"
- true
+ Superenv.bin && Superenv.bin.directory? && ARGV.env != "std"
end
module Env... | false |
Other | Homebrew | brew | ebd77ae8c429b3d9ac200df11c7cccec2137d629.json | README: use the word "maintainers". | README.md | @@ -22,7 +22,7 @@ Second, read the [Troubleshooting Checklist](https://github.com/Homebrew/homebre
Who Are You?
------------
-Homebrew is currently maintained by [Misty De Meo][mistydemeo], [Adam Vandenberg][adamv], [Jack Nagel][jacknagel], [Mike McQuaid][mikemcquaid] and [Brett Koonce][asparagui].
+Homebrew's curr... | false |
Other | Homebrew | brew | be66d746add559161b609106d06317fd25522b58.json | rewrite TeX requirement message
Closes Homebrew/homebrew#28588.
Signed-off-by: Adam Vandenberg <flangy@gmail.com> | Library/Homebrew/requirements.rb | @@ -48,16 +48,21 @@ class TeXDependency < Requirement
satisfy { which('tex') || which('latex') }
- def message; <<-EOS.undent
+ def message;
+ if File.exist?("/usr/texbin")
+ texbin_path = "/usr/texbin"
+ else
+ texbin_path = "its bin directory"
+ end
+
+ <<-EOS.undent
A LaTeX distri... | false |
Other | Homebrew | brew | 4b4fc003df6771a5b9279f5935633d70a9d2a7b9.json | Adjust installer for updated link error handling | Library/Homebrew/formula_installer.rb | @@ -561,18 +561,24 @@ def link
begin
keg.link
- rescue Exception => e
+ rescue Keg::LinkError => e
onoe "The `brew link` step did not complete successfully"
puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}"
- puts "You can try again using `brew link #{f.name}'... | false |
Other | Homebrew | brew | 72d83adaf379d69f3b353a55acff7dc9e30a5656.json | Adjust link command for updated error handling | Library/Homebrew/cmd/link.rb | @@ -32,9 +32,16 @@ def link
end
keg.lock do
- print "Linking #{keg}... " do
- puts if ARGV.verbose?
- puts "#{keg.link(mode)} symlinks created"
+ print "Linking #{keg}... "
+ puts if ARGV.verbose?
+
+ begin
+ n = keg.link(mode)
+ rescue Keg::... | false |
Other | Homebrew | brew | 727f2047602a593b57bf4aebc26242fcc63dd4c8.json | Raise useful errors from make_relative_symlink | Library/Homebrew/keg.rb | @@ -4,6 +4,51 @@
require "ostruct"
class Keg < Pathname
+ class LinkError < RuntimeError
+ attr_reader :keg, :src, :dst
+
+ def initialize(keg, src, dst)
+ @src = src
+ @dst = dst
+ @keg = keg
+ end
+ end
+
+ class ConflictError < LinkError
+ def suggestion
+ conflict = Keg.for(ds... | true |
Other | Homebrew | brew | 727f2047602a593b57bf4aebc26242fcc63dd4c8.json | Raise useful errors from make_relative_symlink | Library/Homebrew/test/test_keg.rb | @@ -56,7 +56,7 @@ def test_linking_fails_when_already_linked
def test_linking_fails_when_files_exist
touch HOMEBREW_PREFIX/"bin/helloworld"
- assert_raise RuntimeError do
+ assert_raise Keg::ConflictError do
shutup { @keg.link }
end
end | true |
Other | Homebrew | brew | 0682c1ad02c51be281ebdfd2714d1fdb7123a65d.json | Add some comments to the cc wrapper | Library/ENV/4.3/cc | @@ -230,6 +230,7 @@ class Cmd
syspath.reject { |d| d == brewfix }.map! { |d| File.join(d, "lib") }
end
+ # Paths added as "-isystem<path>" and "-I<path>" flags
def cpath
cpath = path_split("CMAKE_PREFIX_PATH").map! { |d| File.join(d, "include") }
cpath += path_split("CMAKE_INCLUDE_PATH")
@@ -23... | false |
Other | Homebrew | brew | 23400ec21727f720b5f00a8ed9c3c4202c4f6259.json | Remove code that doesn't do anything | Library/ENV/4.3/cc | @@ -270,10 +270,8 @@ class Cmd
dels = @args - args
adds = args - @args
- dups = dels & args
LOGGER.puts "superenv removed: #{dels*' '}" unless dels.empty?
- LOGGER.puts "superenv deduped: #{dups}" unless dups.empty?
LOGGER.puts "superenv added: #{adds*' '}" unless adds.empty?
end
| false |
Other | Homebrew | brew | 85109c95d8fda861cac62ced36ea3a822d8e666e.json | Add newlines between methods | Library/ENV/4.3/cc | @@ -35,6 +35,7 @@ class Cmd
@brewtmp = ENV['HOMEBREW_TEMP']
@sdkroot = ENV['HOMEBREW_SDKROOT']
end
+
def mode
if @arg0 == 'cpp' or @arg0 == 'ld'
@arg0.to_sym
@@ -54,6 +55,7 @@ class Cmd
end
end
end
+
def tool
@tool ||= case @arg0
when 'ld' then 'ld'
@@ -73,6 +75,7... | false |
Other | Homebrew | brew | 815e7f29fc781163524f0a21937d590a48759a54.json | Write the positive case first | Library/ENV/4.3/cc | @@ -87,10 +87,10 @@ class Cmd
end
if sdkroot
- if tool != 'ld'
- args << "--sysroot=#{sdkroot}"
- else
+ if tool == "ld"
args << "-syslibroot" << sdkroot
+ else
+ args << "--sysroot=#{sdkroot}"
end
end
| false |
Other | Homebrew | brew | a379fc7f7996dafaf40c926ae5b16ef3b7665589.json | Remove nil split monkeypatch | Library/ENV/4.3/cc | @@ -217,15 +217,17 @@ class Cmd
syspath.map{|d| "#{d}/lib" }.reject{|d| d == "#{brewfix}/lib" }
end
def cpath
- cpath = ENV['CMAKE_PREFIX_PATH'].split(':').map{|d| "#{d}/include" } + ENV['CMAKE_INCLUDE_PATH'].split(':')
+ cpath = path_split("CMAKE_PREFIX_PATH").map! { |d| File.join(d, "include") }
+ ... | true |
Other | Homebrew | brew | a379fc7f7996dafaf40c926ae5b16ef3b7665589.json | Remove nil split monkeypatch | Library/ENV/libsuperenv.rb | @@ -11,5 +11,4 @@ def chuzzle; s = chomp; s unless s.empty? end
class NilClass
def chuzzle; end
- def split(x); [] end
end | true |
Other | Homebrew | brew | bef9ec29ef22c41d175df5a7296d736b21dfff45.json | Remove unused method | Library/ENV/4.3/cc | @@ -216,10 +216,6 @@ class Cmd
# NOTE this only counts if Homebrew is installed at /usr/local
syspath.map{|d| "#{d}/lib" }.reject{|d| d == "#{brewfix}/lib" }
end
- def syscpath
- isystem, _ = cpath
- isystem + syspath.map{|d| "#{d}/include" }
- end
def cpath
cpath = ENV['CMAKE_PREFIX_PATH']... | false |
Other | Homebrew | brew | c351a641de93f245f2570b88718b3309311f8b59.json | Use original value when building the flag | Library/ENV/4.3/cc | @@ -147,13 +147,13 @@ class Cmd
args << "-Wl,#{arg}"
when /^-I(.+)?/
# Support both "-Ifoo" (one argument) and "-I foo" (two arguments)
- path = $1.chuzzle || whittler.next
- path = canonical_path(path)
- args << "-I#{path}" if keep?(path) and iset.add?(path)
+ val ... | false |
Other | Homebrew | brew | d1041319f401d1a3a559d551d7b6a89bc3f4ee0b.json | Remove "cleanpath" monkeypatch | Library/ENV/4.3/cc | @@ -1,6 +1,7 @@
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
require File.expand_path("../libsuperenv", File.dirname(__FILE__))
+require 'pathname'
require 'set'
require 'stringio'
@@ -147,10 +148,12 @@ class Cmd
when /^-I(.+)?/
# Support both "-Ifoo" (one argument) ... | true |
Other | Homebrew | brew | d1041319f401d1a3a559d551d7b6a89bc3f4ee0b.json | Remove "cleanpath" monkeypatch | Library/ENV/libsuperenv.rb | @@ -6,7 +6,6 @@
$:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8"
class String
- def cleanpath; require 'pathname'; Pathname.new(self).realpath.to_s rescue self end
def chuzzle; s = chomp; s unless s.empty? end
end
| true |
Other | Homebrew | brew | 201a1ad9eb060fa2a12ffcb291501688d7a5f516.json | Delay loading Pathname until we absolutely need it | Library/ENV/4.3/xcrun | @@ -4,15 +4,6 @@
# But many build-systems expect it to work. This fixes that.
# NOTE only works if the build-tool calls xcrun without a path prefixed!
-$:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8"
-require "pathname"
-
-def canonical_dirname path
- Pathname.new(path).dirname... | false |
Other | Homebrew | brew | 749c877f032f4990581eec636ffcf1a826e5b4e9.json | Add another comment | Library/Homebrew/os/mac/xcode.rb | @@ -9,7 +9,8 @@ module Xcode
# Locate the "current Xcode folder" via xcode-select. See:
# man xcode-select
- # NOTE!! use Xcode.prefix rather than this generally!
+ # TODO Should this be moved to OS::Mac? As of 10.9 this is referred to
+ # as the "developer directory", and be either a CLT... | false |
Other | Homebrew | brew | 174a9a76b48605904e37bce6b588230f8eadbe45.json | Move mydumper to the boneyard
This software compiles against now-private APIs:
https://github.com/Homebrew/homebrew/issues/24748
http://bugs.mysql.com/bug.php?id=70672
https://answers.launchpad.net/mydumper/+question/239895
Closes Homebrew/homebrew#24748. | Library/Homebrew/tap_migrations.rb | @@ -19,6 +19,7 @@
"lmutil" => "homebrew/binary",
"mlkit" => "homebrew/boneyard",
"mlton" => "homebrew/boneyard",
+ "mydumper" => "homebrew/boneyard",
"nlopt" => "homebrew/science",
"octave" => "homebrew/science",
"opencv" => "homebrew/science", | false |
Other | Homebrew | brew | 46a11a2b26b375ff1676b6e336cbd153c1041371.json | Remove questionable test
This is already covered in test_mach.rb. | Library/Homebrew/test/test_utils.rb | @@ -1,37 +1,10 @@
require 'testing_env'
class UtilTests < Test::Unit::TestCase
-
def test_put_columns_empty
assert_nothing_raised do
# Issue #217 put columns with new results fails.
puts_columns []
end
end
-
- def test_arch_for_command
- # /usr/bin/svn only exists if the command-li... | false |
Other | Homebrew | brew | 9d02c39e23ed995005e9b7e6c2d4b40b2ebaf2d3.json | Fix syntax error | Library/Homebrew/cmd/doctor.rb | @@ -1075,10 +1075,11 @@ def check_xcode_license_approved
# If the user installs Xcode-only, they have to approve the
# license or no "xc*" tool will work.
if `/usr/bin/xcrun clang 2>&1` =~ /license/ and not $?.success? then <<-EOS.undent
- You have not agreed to the Xcode license.
- Builds will fai... | false |
Other | Homebrew | brew | 2f052a2f65ea245c63c777656a50aee5d82a2c2f.json | Remove another unnecessary check | Library/Homebrew/os/mac.rb | @@ -36,7 +36,7 @@ def locate tool
# If it's not there, or xcode-select is misconfigured, we have to
# look in dev_tools_path, and finally in xctoolchain_path, because the
# tools were split over two locations beginning with Xcode 4.3+.
- xcrun_path = unless Xcode.bad_xcode_sele... | false |
Other | Homebrew | brew | 2d8d7184f6317bd8ad56382eec292a1360815a5e.json | Remove dead constant | Library/Homebrew/os/mac/xcode.rb | @@ -6,7 +6,6 @@ module Xcode
V4_BUNDLE_ID = "com.apple.dt.Xcode"
V3_BUNDLE_ID = "com.apple.Xcode"
V4_BUNDLE_PATH = Pathname.new("/Applications/Xcode.app")
- V3_BUNDLE_PATH = Pathname.new("/Developer/Applications/Xcode.app")
# Locate the "current Xcode folder" via xcode-select. See:
... | false |
Other | Homebrew | brew | 5883f1675d71c09a722343ef3f71280c246bc1bb.json | brew-test-bot: check CompilerSelectionError twice.
It may be that even installing a new compiler doesn't fix things so
detect that case and skip the formula installation rather than erroring
out. | Library/Contributions/cmd/brew-test-bot.rb | @@ -245,6 +245,10 @@ def single_commit? start_revision, end_revision
end
end
+ def skip formula
+ puts "#{Tty.blue}==>#{Tty.white} SKIPPING: #{formula}#{Tty.reset}"
+ end
+
def setup
@category = __method__
return if ARGV.include? "--skip-setup"
@@ -264,15 +268,23 @@ def formula formula
... | false |
Other | Homebrew | brew | 47d24c461c3ec6db5c75f2ccdefb2f8ad9998119.json | Do path and string manipulation in pure bash | Library/Contributions/brew_bash_completion.sh | @@ -61,14 +61,18 @@ __brew_complete_formulae ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
local lib=$(brew --repository)/Library
+ local taps=${lib}/Taps
local ff=$(\ls ${lib}/Formula 2>/dev/null | sed 's/\.rb//g')
local af=$(\ls ${lib}/Aliases 2>/dev/null)
- local tf tap
-
- for dir in $(\l... | false |
Other | Homebrew | brew | 581e1b2c7eef68a25f73f95a6bcc50d6fa22af68.json | Use quiet_system to silence some useless warnings | Library/Homebrew/extend/pathname.rb | @@ -355,11 +355,11 @@ def ensure_writable
end
def install_info
- system '/usr/bin/install-info', '--quiet', self.to_s, (self.dirname+'dir').to_s
+ quiet_system "/usr/bin/install-info", "--quiet", to_s, "#{dirname}/dir"
end
def uninstall_info
- system '/usr/bin/install-info', '--delete', '--quie... | false |
Other | Homebrew | brew | 4738974a78a010bda35f7647e9160732cb82af92.json | Remove overzealous exceptions | Library/Homebrew/extend/pathname.rb | @@ -355,16 +355,10 @@ def ensure_writable
end
def install_info
- unless self.symlink?
- raise "Cannot install info entry for unbrewed info file '#{self}'"
- end
system '/usr/bin/install-info', '--quiet', self.to_s, (self.dirname+'dir').to_s
end
def uninstall_info
- unless self.symlink... | false |
Other | Homebrew | brew | 169aa1ac391ce67894e22d24fa4dae83b5059515.json | Use correct basename when updating dylib IDs | Library/Homebrew/keg_fix_install_names.rb | @@ -130,14 +130,16 @@ def each_install_name_for file, &block
end
def dylib_id_for file, options={}
- # the shortpath ensures that library upgrades don’t break installed tools
- relative_path = file.relative_path_from(self)
- shortpath = HOMEBREW_PREFIX.join(relative_path)
+ # The new dylib ID should... | false |
Other | Homebrew | brew | 2d155f2d41483869e5906177d04a8986c3c476a2.json | readall: read formulae that aren't tapped.
This will allow the reading and checking of formulae that mirror
Homebrew core formulae (e.g. `git` in a tap) and, with the previous exit
code changes, is a reasonable check for "are all the formulae in taps
updated to the latest core DSL".
Closes Homebrew/homebrew#28328.
S... | Library/Contributions/cmd/brew-readall.rb | @@ -4,7 +4,23 @@
# or to determine if any current formulae have Ruby issues
require 'formula'
-Formula.names.each do |n|
+require 'cmd/tap'
+
+formulae = []
+if ARGV.empty?
+ formulae = Formula.names
+else
+ tap_name = ARGV.first
+ # Allow use of e.g. homebrew/versions or homebrew-versions
+ tap_dir = tap_name.... | false |
Other | Homebrew | brew | 7fe9413cf16d70e89fdb79228a297d98a2608625.json | audit: use .diff instead of .patch for github diffs | Library/Homebrew/cmd/audit.rb | @@ -311,6 +311,8 @@ def audit_patch(patch)
end
when %r[macports/trunk]
problem "MacPorts patches should specify a revision instead of trunk:\n#{patch.url}"
+ when %r[^https?://github\.com/.*commit.*\.patch$]
+ problem "GitHub appends a git version to patches; use .diff instead."
end
e... | false |
Other | Homebrew | brew | f6c6d0f60ec66a49761af9ebbea7c1da14ebcd52.json | Add tests for new bottling hooks.
Closes Homebrew/homebrew#27890.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/test/test_bottle_hooks.rb | @@ -0,0 +1,40 @@
+require 'testing_env'
+require 'formula_installer'
+require 'hooks/bottles'
+
+class BottleHookTests < Test::Unit::TestCase
+ class FormulaDouble
+ def bottle; end
+ def local_bottle_path; end
+ def some_random_method; true; end
+ end
+
+ def setup
+ @fi = FormulaInstaller.new FormulaDo... | false |
Other | Homebrew | brew | e2fbfc83901fbd885c7a1cc1f471b0f3fe071c15.json | Add hooks for pouring bottles.
This should give us a bit of control over what e.g. Boxen are doing
whilst at the same time stopping us from accidentally breaking each
other's stuff every so often.
I'm aware this may be somewhat controversial so I'm open to other
approaches. | Library/Homebrew/formula_installer.rb | @@ -11,6 +11,7 @@
require 'formula_cellar_checks'
require 'install_renamed'
require 'cmd/tap'
+require 'hooks/bottles'
class FormulaInstaller
include FormulaCellarChecks
@@ -47,6 +48,8 @@ def initialize ff
end
def pour_bottle? install_bottle_options={:warn=>false}
+ return true if Homebrew::Hooks::B... | true |
Other | Homebrew | brew | e2fbfc83901fbd885c7a1cc1f471b0f3fe071c15.json | Add hooks for pouring bottles.
This should give us a bit of control over what e.g. Boxen are doing
whilst at the same time stopping us from accidentally breaking each
other's stuff every so often.
I'm aware this may be somewhat controversial so I'm open to other
approaches. | Library/Homebrew/hooks/bottles.rb | @@ -0,0 +1,31 @@
+# Boxen (and perhaps others) want to override our bottling infrastructure so
+# they can avoid declaring checksums in formulae files.
+# Instead of periodically breaking their monkeypatches let's add some hooks that
+# we can query to allow their own behaviour.
+
+# PLEASE DO NOT EVER RENAME THIS CLAS... | true |
Other | Homebrew | brew | af272e04c7167d348d2363a5e02bba4029b903c7.json | Restore recursive tap search
Fixes Homebrew/homebrew#28234. | Library/Homebrew/formulary.rb | @@ -157,7 +157,17 @@ class TapLoader < FormulaLoader
def initialize tapped_name
@tapped_name = tapped_name
user, repo, name = tapped_name.split("/", 3).map(&:downcase)
- path = Pathname.new("#{HOMEBREW_LIBRARY}/Taps/#{user}-#{repo}/#{name}.rb")
+ tap = Pathname.new("#{HOMEBREW_LIBRARY}/Taps... | false |
Other | Homebrew | brew | c1366b111f866a2a4e03ce606b52f93b1de10fdb.json | Initialize cxxstdlib set lazily
This is used rarely and only at build-time, so we don't need to create
it when instantiating the formula. | Library/Homebrew/formula.rb | @@ -26,10 +26,6 @@ class Formula
attr_accessor :local_bottle_path
- # Flag for marking whether this formula needs C++ standard library
- # compatibility check
- attr_reader :cxxstdlib
-
# Homebrew determines the name
def initialize name='__UNKNOWN__', path=self.class.path(name)
@name = name
@@ -47,... | false |
Other | Homebrew | brew | da2a2ab74899a659ba8fe5e9c178fb3c409d8d37.json | drop unnecessary nil checks | Library/Homebrew/formula.rb | @@ -61,11 +61,11 @@ def set_spec(name)
def determine_active_spec
case
- when head && ARGV.build_head? then head # --HEAD
- when devel && ARGV.build_devel? then devel # --devel
- when stable then stable
- when devel && stable.nil? then devel # ... | false |
Other | Homebrew | brew | 7544d4856df0747017e942f428388c13e3d04d4d.json | add linkapps completion | Library/Contributions/brew_bash_completion.sh | @@ -265,6 +265,17 @@ _brew_link ()
__brew_complete_installed
}
+_brew_linkapps ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --*)
+ __brewcomp "--local"
+ return
+ ;;
+ esac
+}
+
_brew_list ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -493,6 +504,7 @@ ... | false |
Other | Homebrew | brew | 90574a6a4b42b23c1f1b25d4db0289d4be02cfd7.json | Drop conditional that is always false | Library/Homebrew/keg.rb | @@ -53,7 +53,6 @@ def unlink
TOP_LEVEL_DIRECTORIES.map{ |d| self/d }.each do |dir|
next unless dir.exist?
dir.find do |src|
- next if src == self
dst = HOMEBREW_PREFIX + src.relative_path_from(self)
dst.extend(ObserverPathnameExtension)
| false |
Other | Homebrew | brew | b24ef38bc1990707133fb24788fcabe0be81c9a1.json | show formula version in failed build output | Library/Homebrew/exceptions.rb | @@ -203,7 +203,7 @@ def dump
ohai "ENV"
Homebrew.dump_build_env(env)
puts
- onoe "#{formula.name} did not build"
+ onoe "#{formula.name} #{formula.version} did not build"
unless (logs = Dir["#{HOMEBREW_LOGS}/#{formula}/*"]).empty?
puts "Logs:"
puts logs.map{|fn| "... | false |
Other | Homebrew | brew | af4aff8c13ffd952ce6217616fae02d9f27c0c89.json | brew audit: show line number for whitespace
Closes Homebrew/homebrew#24481.
Closes Homebrew/homebrew#24490. | Library/Homebrew/cmd/audit.rb | @@ -332,7 +332,7 @@ def audit_text
end
end
- def audit_line(line)
+ def audit_line(line, lineno)
if line =~ /<(Formula|AmazonWebServicesFormula|ScriptFileFormula|GithubGistFormula)/
problem "Use a space in class inheritance: class Foo < #{$1}"
end
@@ -410,7 +410,7 @@ def audit_line(line)
... | false |
Other | Homebrew | brew | edef6508bd9f8fcac7e461a8081892549c151e36.json | pathname: use ln_sf in install_symlink.
Closes Homebrew/homebrew#28136. | Library/Homebrew/extend/pathname.rb | @@ -83,7 +83,7 @@ def install_symlink_p src, new_basename=src
src = Pathname(src).expand_path(self)
dst = join File.basename(new_basename)
mkpath
- FileUtils.ln_s src.relative_path_from(dst.parent), dst
+ FileUtils.ln_sf src.relative_path_from(dst.parent), dst
end
protected :install_symlink_p... | false |
Other | Homebrew | brew | 7541f1316422d89b96af763a4c9cce68aff1f4cd.json | Extract common decompression code to a method | Library/Homebrew/download_strategy.rb | @@ -138,36 +138,29 @@ def fetch
tarball_path
end
+ # gunzip and bunzip2 write the output file in the same directory as the input
+ # file regardless of the current working directory, so we need to write it to
+ # the correct location ourselves.
+ def buffered_write(tool)
+ target = File.basename(basena... | false |
Other | Homebrew | brew | cb5da28b5cdf7a76e9e1220e6701b4b905ce04a3.json | Handle untarred bzip2 files
Fixes Homebrew/homebrew#28187. | Library/Homebrew/download_strategy.rb | @@ -157,6 +157,17 @@ def stage
end
end
end
+ when :bzip2_only
+ with_system_path do
+ target = File.basename(basename_without_params, ".bz2")
+
+ IO.popen("bunzip2 -f '#{tarball_path}' -c") do |pipe|
+ File.open(target, "wb") do |f|
+ buf = ""
+ ... | true |
Other | Homebrew | brew | cb5da28b5cdf7a76e9e1220e6701b4b905ce04a3.json | Handle untarred bzip2 files
Fixes Homebrew/homebrew#28187. | Library/Homebrew/extend/pathname.rb | @@ -213,6 +213,8 @@ def compression_type
# If the filename ends with .gz not preceded by .tar
# then we want to gunzip but not tar
return :gzip_only
+ when ".bz2"
+ return :bzip2_only
end
# Get enough of the file to detect common file types | true |
Other | Homebrew | brew | 607605dd8fef262b5c382a78eedef43edbdba27e.json | Use a case statement in Pathname#compression_type | Library/Homebrew/extend/pathname.rb | @@ -202,16 +202,18 @@ def version
end
def compression_type
- # Don't treat jars or wars as compressed
- return nil if self.extname == '.jar'
- return nil if self.extname == '.war'
-
- # OS X installer package
- return :pkg if self.extname == '.pkg'
-
- # If the filename ends with .gz not prece... | false |
Other | Homebrew | brew | 20f4b3176342f328ba83b02482d13fe5a7d62215.json | Implement canonical_name in Formulary | Library/Homebrew/formula.rb | @@ -390,44 +390,8 @@ def self.aliases
Dir["#{HOMEBREW_LIBRARY}/Aliases/*"].map{ |f| File.basename f }.sort
end
- # TODO - document what this returns and why
def self.canonical_name name
- # if name includes a '/', it may be a tap reference, path, or URL
- if name.include? "/"
- if name =~ %r{(.... | true |
Other | Homebrew | brew | 20f4b3176342f328ba83b02482d13fe5a7d62215.json | Implement canonical_name in Formulary | Library/Homebrew/formulary.rb | @@ -178,6 +178,10 @@ def self.factory ref
loader_for(ref).get_formula
end
+ def self.canonical_name(ref)
+ loader_for(ref).name
+ end
+
def self.loader_for(ref)
case ref
when %r[(https?|ftp)://] | true |
Other | Homebrew | brew | e891bb42726679b7fb7e347b8bf4cabcff1bec22.json | Drop support for passing incomplete paths
`brew install ./foo` treats `./foo` like `./foo.rb`. This requires
a confusing special case in the name resolution logic and doesn't make
a whole lot of sense from a UX perspective.
Drop support for this. The argument should be an absolute path,
a relative path, or a formula ... | Library/Homebrew/formulary.rb | @@ -121,11 +121,8 @@ def initialize alias_path
# Loads formulae from disk using a path
class FromPathLoader < FormulaLoader
def initialize path
- # require allows filenames to drop the .rb extension, but everything else
- # in our codebase will require an exact and fullpath.
- path = "#{path}.... | false |
Other | Homebrew | brew | caaa32325cf7bcf03d07f7525da082f53217cceb.json | Use StandardLoader when we know the path already | Library/Homebrew/formulary.rb | @@ -202,7 +202,7 @@ def self.loader_for(ref)
possible_cached_formula = Pathname.new("#{HOMEBREW_CACHE_FORMULA}/#{ref}.rb")
if possible_cached_formula.file?
- return FromPathLoader.new(possible_cached_formula.to_s)
+ return StandardLoader.new(ref, possible_cached_formula)
end
return Sta... | false |
Other | Homebrew | brew | 757c8ade0ba98d0a1c235df77572780b03998228.json | Simplify tap formula loading | Library/Homebrew/formulary.rb | @@ -147,14 +147,19 @@ def get_formula
# Loads tapped formulae.
class TapLoader < FormulaLoader
+ attr_reader :tapped_name
+
def initialize tapped_name
- super tapped_name, Pathname.new(tapped_name)
+ @tapped_name = tapped_name
+ user, repo, name = tapped_name.split("/", 3).map(&:downcase)... | false |
Other | Homebrew | brew | e008ceb332ddf88a8079d504adebaaead215a4ec.json | Pass path directly to StandardLoader when possible
Now we can avoid computing the path twice in the common case. | Library/Homebrew/formulary.rb | @@ -105,8 +105,8 @@ def get_formula
# Loads formulae from Homebrew's provided Library
class StandardLoader < FormulaLoader
- def initialize name
- super name, Formula.path(name)
+ def initialize name, path=Formula.path(name)
+ super
end
end
@@ -198,14 +198,15 @@ def self.loader_for(ref... | false |
Other | Homebrew | brew | ca3688e33e1b98e67242e87a6b067b696f05effb.json | Eliminate repeated work in Formulary.factory
Much of the name resolution done in Formula.canonical_name is repeated
Formulary.factory. Here we eliminate the repeated work by duplicating
the code from canonical_name. Later we will refactor it so that both
methods can share the bulk of the logic. | Library/Homebrew/formulary.rb | @@ -165,25 +165,54 @@ def get_formula
# * a formula URL
# * a local bottle reference
def self.factory ref
- # If a URL is passed, download to the cache and install
- if ref =~ %r[(https?|ftp)://]
- f = FromUrlLoader.new(ref)
- elsif ref =~ Pathname::BOTTLE_EXTNAME_RX
- f = BottleLoader.new(r... | false |
Other | Homebrew | brew | 2616127a281b9cf7f15c3fb2cd8536741d0f1b6c.json | Remove unnecessary usage of Formula.canonical_name | Library/Contributions/cmd/brew-services.rb | @@ -123,7 +123,7 @@ def homebrew!
end
# Access current service
- def service; @service ||= Service.new(Formula.factory(Formula.canonical_name(@formula))) if @formula end
+ def service; @service ||= Service.new(Formula.factory(@formula)) if @formula end
# Print usage and `exit(...)` with supplie... | false |
Other | Homebrew | brew | ce367e711be8e4f2a08357705dafa5bc375da99b.json | Prefer File.extname to regexp | Library/Homebrew/formulary.rb | @@ -115,7 +115,7 @@ class FromPathLoader < FormulaLoader
def initialize path
# require allows filenames to drop the .rb extension, but everything else
# in our codebase will require an exact and fullpath.
- path = "#{path}.rb" unless path =~ /\.rb$/
+ path = "#{path}.rb" unless File.extname... | false |
Other | Homebrew | brew | ce1f598e98ab5ad9f2ce68f2c55441de66a1214b.json | Avoid realpath where it is not necessary
Symlinks in opt and LinkedKegs point directly at a keg in the cellar, so
only resolving one symlink should suffice, and make it clear what path
we are actually interested in. | Library/Homebrew/build.rb | @@ -213,7 +213,7 @@ def install
def fixopt f
path = if f.linked_keg.directory? and f.linked_keg.symlink?
- f.linked_keg.realpath
+ f.linked_keg.resolved_path
elsif f.prefix.directory?
f.prefix
elsif (kids = f.rack.children).size == 1 and kids.first.directory? | true |
Other | Homebrew | brew | ce1f598e98ab5ad9f2ce68f2c55441de66a1214b.json | Avoid realpath where it is not necessary
Symlinks in opt and LinkedKegs point directly at a keg in the cellar, so
only resolving one symlink should suffice, and make it clear what path
we are actually interested in. | Library/Homebrew/caveats.rb | @@ -25,7 +25,7 @@ def empty?
def keg
@keg ||= [f.prefix, f.opt_prefix, f.linked_keg].map do |d|
- Keg.new(d.realpath) rescue nil
+ Keg.new(d.resolved_path) rescue nil
end.compact.first
end
| true |
Other | Homebrew | brew | ce1f598e98ab5ad9f2ce68f2c55441de66a1214b.json | Avoid realpath where it is not necessary
Symlinks in opt and LinkedKegs point directly at a keg in the cellar, so
only resolving one symlink should suffice, and make it clear what path
we are actually interested in. | Library/Homebrew/cmd/reinstall.rb | @@ -13,8 +13,8 @@ def reinstall_formula f
notice += " with #{options * ", "}" unless options.empty?
oh1 notice
- if (opt_link = f.opt_prefix).exist?
- keg = Keg.new(opt_link.realpath)
+ if f.opt_prefix.directory?
+ keg = Keg.new(f.opt_prefix.resolved_path)
backup keg
end
| true |
Other | Homebrew | brew | ce1f598e98ab5ad9f2ce68f2c55441de66a1214b.json | Avoid realpath where it is not necessary
Symlinks in opt and LinkedKegs point directly at a keg in the cellar, so
only resolving one symlink should suffice, and make it clear what path
we are actually interested in. | Library/Homebrew/cmd/upgrade.rb | @@ -54,7 +54,7 @@ def upgrade_pinned?
end
def upgrade_formula f
- outdated_keg = Keg.new(f.linked_keg.realpath) if f.linked_keg.directory?
+ outdated_keg = Keg.new(f.linked_keg.resolved_path) if f.linked_keg.directory?
fi = FormulaInstaller.new(f)
fi.options = Tab.for_formula(f).us... | true |
Other | Homebrew | brew | ce1f598e98ab5ad9f2ce68f2c55441de66a1214b.json | Avoid realpath where it is not necessary
Symlinks in opt and LinkedKegs point directly at a keg in the cellar, so
only resolving one symlink should suffice, and make it clear what path
we are actually interested in. | Library/Homebrew/extend/ARGV.rb | @@ -35,9 +35,9 @@ def kegs
opt_prefix = HOMEBREW_PREFIX/"opt"/name
if opt_prefix.symlink? && opt_prefix.directory?
- Keg.new(opt_prefix.realpath)
+ Keg.new(opt_prefix.resolved_path)
elsif linked_keg_ref.symlink? && linked_keg_ref.directory?
- Keg.new(linked_keg_ref.realpath)
... | true |
Other | Homebrew | brew | ce1f598e98ab5ad9f2ce68f2c55441de66a1214b.json | Avoid realpath where it is not necessary
Symlinks in opt and LinkedKegs point directly at a keg in the cellar, so
only resolving one symlink should suffice, and make it clear what path
we are actually interested in. | Library/Homebrew/formula.rb | @@ -493,7 +493,7 @@ def to_hash
},
"revision" => revision,
"installed" => [],
- "linked_keg" => (linked_keg.realpath.basename.to_s if linked_keg.exist?),
+ "linked_keg" => (linked_keg.resolved_path.basename.to_s if linked_keg.exist?),
"keg_only" => keg_only?,
"dependencies" ... | true |
Other | Homebrew | brew | ce1f598e98ab5ad9f2ce68f2c55441de66a1214b.json | Avoid realpath where it is not necessary
Symlinks in opt and LinkedKegs point directly at a keg in the cellar, so
only resolving one symlink should suffice, and make it clear what path
we are actually interested in. | Library/Homebrew/formula_installer.rb | @@ -147,7 +147,7 @@ def install
if f.linked_keg.directory?
# some other version is already installed *and* linked
raise CannotInstallFormulaError, <<-EOS.undent
- #{f}-#{f.linked_keg.realpath.basename} already installed
+ #{f}-#{f.linked_keg.resolved_path.basename} already installed
... | true |
Other | Homebrew | brew | ce1f598e98ab5ad9f2ce68f2c55441de66a1214b.json | Avoid realpath where it is not necessary
Symlinks in opt and LinkedKegs point directly at a keg in the cellar, so
only resolving one symlink should suffice, and make it clear what path
we are actually interested in. | Library/Homebrew/keg.rb | @@ -87,7 +87,7 @@ def linked_keg_record
end
def linked?
- linked_keg_record.directory? and self == linked_keg_record.realpath
+ linked_keg_record.directory? && self == linked_keg_record.resolved_path
end
def completion_installed? shell
@@ -125,7 +125,7 @@ def find(*args, &block)
end
def li... | true |
Other | Homebrew | brew | a44f725c8b0ed36fa6d82641ace3034a17cedce2.json | Ignore interrupts while cleaning up | Library/Homebrew/formula_installer.rb | @@ -383,11 +383,13 @@ def install_dependency(dep, inherited_options)
fi.caveats
fi.finish
rescue Exception
- tmp_keg.rename(installed_keg) if tmp_keg && !installed_keg.directory?
- linked_keg.link if linked_keg
+ ignore_interrupts do
+ tmp_keg.rename(installed_keg) if tmp_keg && !installed_ke... | false |
Other | Homebrew | brew | 710db1fb720adcbb93bcf51f5f14f3dcb970a96a.json | Rename outdated_keg to linked_keg | Library/Homebrew/formula_installer.rb | @@ -361,7 +361,7 @@ def install_dependency(dep, inherited_options)
df = dep.to_formula
tab = Tab.for_formula(df)
- outdated_keg = Keg.new(df.linked_keg.realpath) if df.linked_keg.directory?
+ linked_keg = Keg.new(df.linked_keg.realpath) if df.linked_keg.directory?
fi = DependencyInstaller.new(d... | false |
Other | Homebrew | brew | 611f1a1b4238374ec068de496b3cb674d072f52b.json | Fix universal option inheritance during upgrades | Library/Homebrew/formula_installer.rb | @@ -323,11 +323,11 @@ def effective_build_options_for(dependent)
end
def inherited_options_for(dep)
- options = Options.new
- if f.build.universal? && !dep.build? && dep.to_formula.build.has_option?("universal")
- options << Option.new("universal")
+ inherited_options = Options.new
+ if options... | false |
Other | Homebrew | brew | 363f2c116cf6256148624c841e62b59c508565f4.json | formula_installer: check pour from requirements. | Library/Homebrew/formula_installer.rb | @@ -55,6 +55,14 @@ def pour_bottle? install_bottle_options={:warn=>false}
return true if f.local_bottle_path
return false unless f.bottle && f.pour_bottle?
+ f.requirements.each do |req|
+ next if req.optional? || req.pour_bottle?
+ if install_bottle_options[:warn]
+ ohai "Building sourc... | false |
Other | Homebrew | brew | 767da444f9d0112607370177d00c0d73042f2959.json | requirement: add pour_bottle? method.
Allows disabling bottles from requirements. | Library/Homebrew/requirement.rb | @@ -33,6 +33,10 @@ def satisfied?
!!result
end
+ # Can overridden to optionally prevent a formula with this requirement from
+ # pouring a bottle.
+ def pour_bottle?; true end
+
# Overriding #fatal? is deprecated.
# Pass a boolean to the fatal DSL method instead.
def fatal? | false |
Other | Homebrew | brew | d22ad92a8479501b080312dbc1570476cda8172f.json | Remove special behavior of autotools symbol deps
Closes Homebrew/homebrew#28094. | Library/Homebrew/dependency_collector.rb | @@ -136,8 +136,6 @@ def parse_class_spec(spec, tags)
end
def autotools_dep(spec, tags)
- return if MacOS::Xcode.provides_autotools?
-
if spec == :libltdl
spec = :libtool
tags << :run | true |
Other | Homebrew | brew | d22ad92a8479501b080312dbc1570476cda8172f.json | Remove special behavior of autotools symbol deps
Closes Homebrew/homebrew#28094. | Library/Homebrew/test/test_dependency_collector.rb | @@ -86,25 +86,6 @@ def test_x11_min_version_and_tag
assert dep.optional?
end
- def test_libltdl_not_build_dep
- MacOS::Xcode.stubs(:provides_autotools?).returns(false)
- dep = @d.build(:libltdl)
- assert_equal Dependency.new("libtool"), dep
- assert !dep.build?
- end
-
- def test_autotools_dep_... | true |
Other | Homebrew | brew | bb5e0812fb387f2b2a920c9a89e9750fe28943f8.json | Add fast path for CVS dep
The search mechanism in MacOS::Xcode is very slow. It requires shelling
out at least twice, and possibly a third time (in the CLT-only case).
Calling provides_cvs? activates this in order to determine the Xcode
version. But if we know that there isn't an Xcode available for the
current OS th... | Library/Homebrew/dependency_collector.rb | @@ -170,7 +170,7 @@ def resource_dep(spec, tags)
when strategy <= BazaarDownloadStrategy
Dependency.new("bazaar", tags)
when strategy <= CVSDownloadStrategy
- Dependency.new("cvs", tags) unless MacOS::Xcode.provides_cvs?
+ Dependency.new("cvs", tags) if MacOS.version >= :mavericks || !MacOS::... | false |
Other | Homebrew | brew | 55b0ee787ae88c4bd1087040984303ba53d33c78.json | Remove dead code | Library/Homebrew/os/mac/xcode.rb | @@ -180,15 +180,6 @@ def installed?
!!detect_version
end
- def mavericks_dev_tools?
- MacOS.dev_tools_path == Pathname("#{MAVERICKS_PKG_PATH}/usr/bin") &&
- File.directory?("#{MAVERICKS_PKG_PATH}/usr/include")
- end
-
- def usr_dev_tools?
- MacOS.dev_tools_path ==... | false |
Other | Homebrew | brew | 2932bc5347e27941799375e06aa8b2dc4c53bdc4.json | Remove unused parameter | Library/Homebrew/bottles.rb | @@ -75,7 +75,7 @@ def initialize
@bottles = {}
end
- def add(checksum, tag, url=nil)
+ def add(checksum, tag)
@bottles[tag] = checksum
end
| false |
Other | Homebrew | brew | 75af625c17867d6336096e43dadf5a668e3f436b.json | Pass the link mode to resolve_any_conflicts | Library/Homebrew/keg.rb | @@ -213,15 +213,15 @@ def delete_pyc_files!
protected
- def resolve_any_conflicts dst
+ def resolve_any_conflicts dst, mode
# if it isn't a directory then a severe conflict is about to happen. Let
# it, and the exception that is generated will message to the user about
# the situation
if ds... | false |
Other | Homebrew | brew | 5123f0c80274ef483ba2359fe3b3264ea9a85d02.json | Move dnsiff to the boneyard
Closes Homebrew/homebrew#27642. | Library/Homebrew/tap_migrations.rb | @@ -8,6 +8,7 @@
"denyhosts" => "homebrew/boneyard",
"dotwrp" => "homebrew/science",
"drizzle" => "homebrew/boneyard",
+ "dsniff" => "homebrew/boneyard",
"grads" => "homebrew/binary",
"hwloc" => "homebrew/science",
"ipopt" => "homebrew/science", | false |
Other | Homebrew | brew | bf8ff2dcb72649ae87d4561ceef4e0a590bdea60.json | audit: check the use of Dir[]
Sometimes `Dir[]` is used with single files/directories unnecessarily. | Library/Homebrew/cmd/audit.rb | @@ -525,6 +525,10 @@ def audit_line(line)
if line =~ /depends_on ['"](.+)['"] (if.+|unless.+)$/
audit_conditional_dep($1, $2, $&)
end
+
+ if line =~ /(Dir\[("[^\*{},]+")\])/
+ problem "#{$1} is unnecessary; just use #{$2}"
+ end
end
def audit_conditional_dep(dep, condition, line) | false |
Other | Homebrew | brew | ca786e7054b88af15fce2de033e22925b7144678.json | Add bash completion for `brew bottle` | Library/Contributions/brew_bash_completion.sh | @@ -131,6 +131,18 @@ __brew_complete_taps ()
__brewcomp "$__brew_cached_taps"
}
+_brew_bottle ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --*)
+ __brewcomp "--merge --rb --write"
+ return
+ ;;
+ esac
+ __brew_complete_installed
+}
+
_brew_cleanup ()
{
... | false |
Other | Homebrew | brew | be46fc3a48dd277977a988a63461aee2015d9cab.json | Relocate files in share/pkgconfig too | Library/Homebrew/keg_fix_install_names.rb | @@ -171,13 +171,13 @@ def script_files
def pkgconfig_files
pkgconfig_files = []
- # find .pc files, which are stored in lib/pkgconfig
- pc_dir = self/'lib/pkgconfig'
- if pc_dir.directory?
- pc_dir.find do |pn|
+ %w[lib share].each do |dir|
+ pcdir = join(dir, "pkgconfig")
+
+ pcdir... | false |
Other | Homebrew | brew | c27eed10bd32f0005f3c52db68713892b0cfa974.json | Simplify collecting options | Library/Homebrew/formula.rb | @@ -497,16 +497,12 @@ def to_hash
"keg_only" => keg_only?,
"dependencies" => deps.map(&:name),
"conflicts_with" => conflicts.map(&:name),
- "options" => [],
"caveats" => caveats
}
- build.each do |opt|
- hsh["options"] << {
- "option" => "--"+opt.name,
- "de... | false |
Other | Homebrew | brew | 3871165c589bb2cf3611ecea538d9e500d49e916.json | Add revision to `brew info --json`
Closes Homebrew/homebrew#27820. | Library/Homebrew/formula.rb | @@ -491,6 +491,7 @@ def to_hash
"devel" => (devel.version.to_s if devel),
"head" => (head.version.to_s if head)
},
+ "revision" => revision,
"installed" => [],
"linked_keg" => (linked_keg.realpath.basename.to_s if linked_keg.exist?),
"keg_only" => keg_only?,
@@ -512,7 ... | false |
Other | Homebrew | brew | 0ec7e3928734cab72e29e5e5dc6ebf558f18312b.json | Add ENV.refurbish_args helper
Rationale: our arg refurbishment is normally only turned on when
called via the `make` wrapper, for compatibility reasons. However,
there are numberous places we'd like this to be turned on elsewhere,
like software that builds via `python setup.py` where bad flags from
the system python c... | Library/Homebrew/extend/ENV/std.rb | @@ -359,4 +359,7 @@ def make_jobs
Hardware::CPU.cores
end
end
+
+ # This method does nothing in stdenv since there's no arg refurbishment
+ def refurbish_args; end
end | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.