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 | 5f1a9098c945c46c30b095b823af2312ac8936a8.json | Add better Unix exit codes.
Closes Homebrew/homebrew#10809. | Library/Homebrew/cmd/install.rb | @@ -87,6 +87,7 @@ def install_formulae formulae
fi.finish
rescue CannotInstallFormulaError => e
onoe e.message
+ exit 1
end
end
end | true |
Other | Homebrew | brew | 5f1a9098c945c46c30b095b823af2312ac8936a8.json | Add better Unix exit codes.
Closes Homebrew/homebrew#10809. | Library/Homebrew/cmd/upgrade.rb | @@ -66,9 +66,11 @@ def upgrade_formula f
installer.finish
rescue CannotInstallFormulaError => e
onoe e
+ exit 1
rescue BuildError => e
e.dump
puts
+ exit 1
ensure
# restore previous installation state if build failed
outdated_keg.link if outdated_keg and not f.installed? res... | true |
Other | Homebrew | brew | a005834d7a6094bc67ab3fd2634336fa1f473ced.json | Run tests from anywhere and provide an exit code. | Library/Homebrew/test/tests | @@ -1,18 +1,23 @@
#!/bin/bash
# This shell script runs Homebrew's test suite.
-/usr/bin/ruby test_bucket.rb $*
-/usr/bin/ruby test_formula.rb $*
-/usr/bin/ruby test_versions.rb $*
-/usr/bin/ruby test_checksums.rb $*
-/usr/bin/ruby test_inreplace.rb $*
-/usr/bin/ruby test_hardware.rb $*
-/usr/bin/ruby test_formula_i... | false |
Other | Homebrew | brew | 0e2258f0fa6f94d43f9e0991f2da250c0f655e4f.json | Fix test_ENV on 10.7/Xcode 4. | Library/Homebrew/test/test_ENV.rb | @@ -9,7 +9,13 @@
class EnvironmentTests < Test::Unit::TestCase
def test_ENV_options
ENV.gcc_4_0
- ENV.gcc_4_2
+ begin
+ ENV.gcc_4_2
+ rescue RuntimeError => e
+ if `sw_vers -productVersion` =~ /10\.(\d+)/ and $1.to_i < 7
+ raise e
+ end
+ end
ENV.O3
ENV.minimal_optim... | false |
Other | Homebrew | brew | 31e2ec485b1776cb00dac5043d2cae1c8d0aa123.json | Fix test_arch_for_command on 10.7. | Library/Homebrew/test/test_utils.rb | @@ -17,14 +17,18 @@ def test_put_columns_empty
def test_arch_for_command
arches=archs_for_command '/usr/bin/svn'
- if `sw_vers -productVersion` =~ /10\.(\d+)/ and $1.to_i >= 6
+ if `sw_vers -productVersion` =~ /10\.(\d+)/ and $1.to_i >= 7
+ assert_equal 2, arches.length
+ assert arches.include... | false |
Other | Homebrew | brew | d6851033f9da72746eea1e382e228c4abb311e76.json | Fix gdk-pixbuf module installation
When other packages install gdk-pixbuf modules, they get installed into
the gdk-pixbuf keg. To avoid this, we explicitly create the top level
lib directories for gdk-pixbuf and hack the pkgconfig file to point at
the top-level directories instead of the keg.
This results in other pa... | Library/Homebrew/keg.rb | @@ -88,6 +88,7 @@ def link
# pkg-config database gets explicitly created
when 'pkgconfig' then :mkpath
# lib/language folders also get explicitly created
+ when /^gdk-pixbuf/ then :mkpath
when 'ghc' then :mkpath
when 'lua' then :mkpath
when 'node' then :mkpath | false |
Other | Homebrew | brew | 94bafe05f45ef72e07d9ad9fae16e20a92884a2c.json | Include vi in list of binaries already in OS X
Signed-off-by: Adam Vandenberg <flangy@gmail.com> | Library/Homebrew/blacklist.rb | @@ -1,6 +1,6 @@
def blacklisted? name
case name.downcase
- when 'vim', 'screen', /^rubygems?$/ then <<-EOS.undent
+ when /^vim?$/, 'screen', /^rubygems?$/ then <<-EOS.undent
Apple distributes #{name} with OS X, you can find it in /usr/bin.
EOS
when 'libarchive', 'libpcap' then <<-EOS.undent | false |
Other | Homebrew | brew | 5b0d97efc741019378ee5b40c09796a3c31d2fcb.json | Suggest full path to Xcode 4.3 /Developer
Some people seem to have an older xcode-select even after installing the CLT from inside Xcode or otherwise. So this is works for both.
Now we aren't future-proofed in case Apple change the location, but hopefully they won't, seems unlikely.
Refs Homebrew/homebrew#10743. Fix... | Library/Homebrew/cmd/doctor.rb | @@ -349,6 +349,11 @@ def check_xcode_select_path
path = `xcode-select -print-path 2>/dev/null`.chomp
unless File.directory? path and File.file? "#{path}/usr/bin/xcodebuild"
# won't guess at the path they should use because it's too hard to get right
+ # We specify /Applications/Xcode.app/Contents/Develope... | false |
Other | Homebrew | brew | c7ec737f86bade367eb45e004f21ec1b16f3e2e9.json | Remove silly path method | Library/Homebrew/formula.rb | @@ -44,7 +44,8 @@ def initialize name='__UNKNOWN__', path=nil
@name=name
validate_variable :name
- @path = path.nil? ? nil : Pathname.new(path)
+ # If we got an explicit path, use that, else determine from the name
+ @path = path.nil? ? self.class.path(name) : Pathname.new(path)
set_instance... | false |
Other | Homebrew | brew | 67c3f1b2b4e4697af93a3e78e31fd00df2d02966.json | Extend FileUtils rather than include it
Fixes Homebrew/homebrew#10729.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/extend/fileutils.rb | @@ -1,8 +1,7 @@
require 'fileutils'
# We enhance FileUtils to make our Formula code more readable.
-module Homebrew::FileUtils
- include FileUtils
+module FileUtils extend self
# Create a temporary directory then yield. When the block returns,
# recursively delete the temporary directory.
@@ -29,7 +28,7 @@... | true |
Other | Homebrew | brew | 67c3f1b2b4e4697af93a3e78e31fd00df2d02966.json | Extend FileUtils rather than include it
Fixes Homebrew/homebrew#10729.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/formula.rb | @@ -6,7 +6,7 @@
# Derive and define at least @url, see Library/Formula for examples
class Formula
- include Homebrew::FileUtils
+ include FileUtils
attr_reader :name, :path, :url, :version, :homepage, :specs, :downloader
attr_reader :standard, :unstable | true |
Other | Homebrew | brew | cc78050dc5607ac827429fe27686f71a7e77716c.json | add which method | Library/Homebrew/utils.rb | @@ -138,6 +138,15 @@ def puts_columns items, star_items=[]
end
end
+def which cmd
+ path = `/usr/bin/which #{cmd}`.chomp
+ if path.empty?
+ nil
+ else
+ Pathname.new(path)
+ end
+end
+
def which_editor
editor = ENV['HOMEBREW_EDITOR'] || ENV['EDITOR']
# If an editor wasn't set, try to pick a sane ... | false |
Other | Homebrew | brew | ed5f7dfbaa88562516eaa447ff69a891f49e3209.json | Require specialties at the end of formula.rb
classes in formula_specialties.rb need Formula, so it has to be last.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/formula.rb | @@ -2,7 +2,6 @@
require 'formula_support'
require 'hardware'
require 'extend/fileutils'
-require 'formula_specialties'
# Derive and define at least @url, see Library/Formula for examples
@@ -727,3 +726,5 @@ def fails_with_llvm msg=nil, data=nil
end
end
end
+
+require 'formula_specialties' | false |
Other | Homebrew | brew | 962f4fa9ef4492fa62fc4c8aa6d827fa6d3f3590.json | Move llvm method to FailsWithLLVM | Library/Homebrew/formula.rb | @@ -189,7 +189,7 @@ def brew
validate_variable :name
validate_variable :version
- handle_llvm_failure(fails_with_llvm?) if fails_with_llvm?
+ fails_with_llvm?.handle_failure if fails_with_llvm?
stage do
begin
@@ -254,40 +254,6 @@ def std_cmake_parameters
"-DCMAKE_INSTALL_PREFIX='#{p... | true |
Other | Homebrew | brew | 962f4fa9ef4492fa62fc4c8aa6d827fa6d3f3590.json | Move llvm method to FailsWithLLVM | Library/Homebrew/formula_support.rb | @@ -92,4 +92,38 @@ def reason
s += "\n"
return s
end
+
+ def handle_failure
+ return unless ENV.compiler == :llvm
+
+ # version 2336 is the latest version as of Xcode 4.2, so it is the
+ # latest version we have tested against so we will switch to GCC and
+ # bump this integer when Xcode 4.3 i... | true |
Other | Homebrew | brew | 1b372d7840a60c8d592aa03e5c95fb41a6c5fb6b.json | Move path utils out of formula.rb
Make a new module for our FileUtils extensions and use that instead. | Library/Homebrew/extend/fileutils.rb | @@ -0,0 +1,40 @@
+require 'fileutils'
+
+# We enhance FileUtils to make our Formula code more readable.
+module Homebrew::FileUtils
+ include FileUtils
+
+ # Create a temporary directory then yield. When the block returns,
+ # recursively delete the temporary directory.
+ def mktemp
+ # I used /tmp rather than `... | true |
Other | Homebrew | brew | 1b372d7840a60c8d592aa03e5c95fb41a6c5fb6b.json | Move path utils out of formula.rb
Make a new module for our FileUtils extensions and use that instead. | Library/Homebrew/formula.rb | @@ -1,12 +1,12 @@
require 'download_strategy'
-require 'fileutils'
require 'formula_support'
require 'hardware'
+require 'extend/fileutils'
# Derive and define at least @url, see Library/Formula for examples
class Formula
- include FileUtils
+ include Homebrew::FileUtils
attr_reader :name, :path, :url, ... | true |
Other | Homebrew | brew | 19a0aa51a1e8e5df95f9b802b165ea9ffce9cf27.json | Adjust updater tests for `git config` calls
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/test/test_updater.rb | @@ -67,9 +67,11 @@ def test_init_homebrew
updater = RefreshBrewMock.new
updater.git_repo = false
updater.in_prefix_expect("git init")
+ updater.in_prefix_expect("git config core.autocrlf false")
updater.in_prefix_expect("git remote add origin #{RefreshBrewMock::REPOSITORY_URL}")
... | false |
Other | Homebrew | brew | 01994c7be194e3742913e15ad6f1a775de45e03c.json | keg: allow selective linking at the file level
Some parts of a keg's tree are not subject to the cleaner, and sometimes
we still want to remove things in directories marked skip_clean; this
allows us that freedom.
If 'lib' is marked skip_clean, we still want to avoid linking the
charset.alias file into the top of the... | Library/Homebrew/cleaner.rb | @@ -78,8 +78,6 @@ def clean_dir d
elsif path.extname == '.la'
# *.la files are stupid
path.unlink unless @f.skip_clean? path
- elsif path == @f.lib+'charset.alias'
- path.unlink unless @f.skip_clean? path
elsif not path.symlink?
clean_file path
end | true |
Other | Homebrew | brew | 01994c7be194e3742913e15ad6f1a775de45e03c.json | keg: allow selective linking at the file level
Some parts of a keg's tree are not subject to the cleaner, and sometimes
we still want to remove things in directories marked skip_clean; this
allows us that freedom.
If 'lib' is marked skip_clean, we still want to avoid linking the
charset.alias file into the top of the... | Library/Homebrew/keg.rb | @@ -9,7 +9,7 @@ def initialize path
# locale-specific directories have the form language[_territory][.codeset][@modifier]
LOCALEDIR_RX = /(locale|man)\/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?/
- INFOFILE_RX = %r[/share/info/[^.].*?\.info$]
+ INFOFILE_RX = %r[info/[^.].*?\.info$]
# if path... | true |
Other | Homebrew | brew | 9772e080332316237c31e95f8f2e902cec944790.json | Specify current Xcode to aid issue-diagnosis
I saw a ticket with just doctor output and no `brew --config`. This helps. | Library/Homebrew/cmd/doctor.rb | @@ -208,7 +208,7 @@ def check_for_latest_xcode
else "4.3"
end
if MacOS.xcode_version < latest_xcode then <<-EOS.undent
- Your Xcode version is outdated
+ You have Xcode-#{MacOS.xcode_version}, which is outdated.
Please install Xcode #{latest_xcode}.
EOS
end | false |
Other | Homebrew | brew | abe0be8a2e7ae2a84f5bae859bce0f0faf7008b1.json | Show doctor error if xcode-select path is invalid
Fixes Homebrew/homebrew#10598.
Ideally we would show a message for builds that use xcodebuild etc. But there is no easy mechanism for this in place. | Library/Homebrew/cmd/doctor.rb | @@ -356,6 +356,24 @@ def check_xcode_prefix
end
end
+def check_xcode_select_path
+ path = `xcode-select -print-path 2>/dev/null`.chomp
+ unless File.directory? path and File.file? "#{path}/usr/bin/xcodebuild"
+ # won't guess at the path they should use because it's too hard to get right
+ ohai "Your Xcode... | false |
Other | Homebrew | brew | e6f8f1618388d705883e943b1c4b6aff8e409b1a.json | Formula.rb: update a comment | Library/Homebrew/formula.rb | @@ -797,14 +797,14 @@ def fails_with_llvm msg=nil, data=nil
end
end
-# see ack.rb for an example usage
+# See youtube-dl.rb for an example
class ScriptFileFormula < Formula
def install
bin.install Dir['*']
end
end
-# see flac.rb for example usage
+# See flac.rb for an example
class GithubGistFormu... | false |
Other | Homebrew | brew | d22eed3f1658dd3f13dec34637143aeb4cfe3991.json | Add support for Luarocks dependencies. | Library/Homebrew/exceptions.rb | @@ -79,6 +79,7 @@ def tool
when :perl then 'cpan'
when :node then 'npm'
when :chicken then 'chicken-install'
+ when :lua then "luarocks"
end
end
@@ -98,6 +99,8 @@ def command_line
"npm install"
when :chicken
"chicken-install"
+ when :lua
+ "luaroc... | true |
Other | Homebrew | brew | d22eed3f1658dd3f13dec34637143aeb4cfe3991.json | Add support for Luarocks dependencies. | Library/Homebrew/formula.rb | @@ -745,15 +745,15 @@ def mirror val, specs=nil
def depends_on name
@deps ||= []
- @external_deps ||= {:python => [], :perl => [], :ruby => [], :jruby => [], :chicken => [], :rbx => [], :node => []}
+ @external_deps ||= {:python => [], :perl => [], :ruby => [], :jruby => [], :chicken => [], :rbx... | true |
Other | Homebrew | brew | d22eed3f1658dd3f13dec34637143aeb4cfe3991.json | Add support for Luarocks dependencies. | Library/Homebrew/formula_installer.rb | @@ -342,6 +342,7 @@ def external_dep_check dep, type
when :perl then %W{/usr/bin/env perl -e use\ #{dep}}
when :chicken then %W{/usr/bin/env csi -e (use #{dep})}
when :node then %W{/usr/bin/env node -e require('#{dep}');}
+ when :lua then %W{/usr/bin/env luarocks show #{dep}}
end
end
@@ -365,7 +... | true |
Other | Homebrew | brew | fb9b263bc3b35f0b8735c7c2495d75c0cab43a34.json | Play nice with case-sensitive filesystems | Library/Homebrew/cmd/--config.rb | @@ -38,9 +38,9 @@ def sha
def describe_x11
return "N/A" unless x11_installed?
- return case x11_path = Pathname.new("/usr/x11").realpath.to_s
- when "/usr/x11" then "/usr/x11"
- else "/usr/x11 => #{x11_path}"
+ return case x11_path = Pathname.new("/usr/X11").realpath.to_s
+ when "/usr/X11" then... | false |
Other | Homebrew | brew | 11953cbcb9fe33afcc8fff46622208523f3930e9.json | Remove empty directories during uninstall
About time we did this right? | Library/Homebrew/keg.rb | @@ -35,6 +35,7 @@ def unlink
next unless dst.symlink?
dst.uninstall_info if dst.to_s =~ INFOFILE_RX and ENV['HOMEBREW_KEEP_INFO']
dst.unlink
+ dst.parent.rmdir_if_possible
n+=1
Find.prune if src.directory?
end | false |
Other | Homebrew | brew | f74e616724c51001d832bb19f7acdc7f5349d8f6.json | Show real path to x11 in --config output
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/--config.rb | @@ -36,6 +36,14 @@ def sha
if sha.empty? then "(none)" else sha end
end
+ def describe_x11
+ return "N/A" unless x11_installed?
+ return case x11_path = Pathname.new("/usr/x11").realpath.to_s
+ when "/usr/x11" then "/usr/x11"
+ else "/usr/x11 => #{x11_path}"
+ end
+ end
+
def describe_perl... | false |
Other | Homebrew | brew | 6f762ea2a8d45b95b222b45cb9f92c8001b8a037.json | Remove some whitespace here | Library/Homebrew/exceptions.rb | @@ -66,8 +66,7 @@ def get_message formula
<<-EOS.undent
Unsatisfied external dependency: #{formula}
Homebrew does not provide #{type.to_s.capitalize} dependencies, #{tool} does:
-
- #{command_line} #{formula}
+ #{command_line} #{formula}
EOS
end
| false |
Other | Homebrew | brew | 87686d861051f25018288d6dab1333daef2e038f.json | audit: check sbin too
Apply the 'bin' audit to 'sbin' too, and also complain if subfolders are
installed to either. | Library/Homebrew/formula_installer.rb | @@ -83,6 +83,7 @@ def caveats
@show_summary_heading = true
else
audit_bin
+ audit_sbin
audit_lib
check_manpages
check_infopages
@@ -287,7 +288,7 @@ def check_non_libraries
def audit_bin
return unless File.exist? f.bin
- non_exes = f.bin.children.select {|g| not ... | false |
Other | Homebrew | brew | 554d5a2670fbc75279dbc0a13b3c9dc94fbef7e6.json | Introduce block form of mkdir | Library/Homebrew/formula.rb | @@ -123,6 +123,16 @@ def var; HOMEBREW_PREFIX+'var' end
def plist_name; 'homebrew.mxcl.'+name end
def plist_path; prefix+(plist_name+'.plist') end
+ # A version of mkdir that also changes to that folder in a block
+ def mkdir name, &block
+ FileUtils.mkdir name
+ if block_given?
+ FileUtils.chdir n... | false |
Other | Homebrew | brew | 4ee255134d791ab79655422f9760a86b0dc55372.json | Replace UI uses of 'folder' with 'directory'
There are still methods and variables with the word "folder" in the
name, but at least user-facing messages and warnings should use the
correct terminology.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/build.rb | @@ -62,7 +62,7 @@ def install f
if ARGV.flag? '--git'
system "git init"
system "git add -A"
- puts "This folder is now a git repo. Make your changes and then use:"
+ puts "This directory is now a git repo. Make your changes and then use:"
puts " git diff | pbcopy"
... | true |
Other | Homebrew | brew | 4ee255134d791ab79655422f9760a86b0dc55372.json | Replace UI uses of 'folder' with 'directory'
There are still methods and variables with the word "folder" in the
name, but at least user-facing messages and warnings should use the
correct terminology.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/doctor.rb | @@ -243,10 +243,10 @@ def __check_subdir_access base
cant_read.sort!
if cant_read.length > 0
puts <<-EOS.undent
- Some folders in #{target} aren't writable.
+ Some directories in #{target} aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If ... | true |
Other | Homebrew | brew | 4ee255134d791ab79655422f9760a86b0dc55372.json | Replace UI uses of 'folder' with 'directory'
There are still methods and variables with the word "folder" in the
name, but at least user-facing messages and warnings should use the
correct terminology.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/formula_installer.rb | @@ -232,7 +232,7 @@ def check_PATH
def check_manpages
# Check for man pages that aren't in share/man
if (f.prefix+'man').exist?
- opoo 'A top-level "man" folder was found.'
+ opoo 'A top-level "man" directory was found.'
puts "Homebrew requires that man pages live under share."
puts... | true |
Other | Homebrew | brew | a9e6f0773219d40a089ce7dde86900d4e7a9a937.json | Formula#system: sanitize args before exec
This prevents passing nested arrays to exec; the same thing is done in
safe_system.
Fixes Homebrew/homebrew#10295.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/formula.rb | @@ -448,6 +448,7 @@ def system cmd, *args
rd.close
$stdout.reopen wr
$stderr.reopen wr
+ args.collect!{|arg| arg.to_s}
exec(cmd, *args) rescue nil
exit! 1 # never gets here unless exec threw or failed
end | false |
Other | Homebrew | brew | 2431c00c928a5ef5bc5dad51a219426b12dad011.json | Move this code into FormulaInstaller
The correct location for it IMO. Also added warning for the user. | Library/Homebrew/cmd/install.rb | @@ -105,7 +105,6 @@ def install_formulae formulae
fi = FormulaInstaller.new(f)
fi.install
fi.caveats
- f.linked_keg.unlink if f.linked_keg.directory? and f.linked_keg.realpath == f.prefix
fi.finish
rescue FormulaAlreadyInstalledError => e
opoo e.m... | true |
Other | Homebrew | brew | 2431c00c928a5ef5bc5dad51a219426b12dad011.json | Move this code into FormulaInstaller
The correct location for it IMO. Also added warning for the user. | Library/Homebrew/formula_installer.rb | @@ -158,6 +158,12 @@ def build
end
def link
+ if f.linked_keg.directory? and f.linked_keg.realpath == f.prefix
+ opoo "This keg was marked linked already, continuing anyway"
+ # otherwise Keg.link will bail
+ f.linked_keg.unlink
+ end
+
Keg.new(f.prefix).link
rescue Exception => e
... | true |
Other | Homebrew | brew | a7ade739dcba21a7fcaf36a9bf016e1bbea04286.json | Remove -Qunused-arguments in ENV.enable_warnings
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/extend/ENV.rb | @@ -254,6 +254,7 @@ def x11
# we've seen some packages fail to build when warnings are disabled!
def enable_warnings
remove_from_cflags '-w'
+ remove_from_cflags '-Qunused-arguments'
end
# Snow Leopard defines an NCURSES value the opposite of most distros
@@ -350,7 +351,7 @@ def set_cpu_cflags def... | false |
Other | Homebrew | brew | 6af4cc9f27c4b4cb024acfe895c3ebfcac46d993.json | brew --env: fix path to xcrun
Fixes Homebrew/homebrew#10327.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/--env.rb | @@ -19,7 +19,7 @@ def dump_build_env env
if value
results = value
if value =~ /^[^\s]*xcrun (.*)/
- path = `#{MacOS.xcrun} -find #{$1}`
+ path = `/usr/bin/xcrun -find #{$1}`
results += " => #{path}"
elsif File.exists? value and File.symlink? value
... | false |
Other | Homebrew | brew | ccec313b03ebf2bd76c7cb362c9825ac1d4f42a6.json | audit: use a heredoc for this long line
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/audit.rb | @@ -281,7 +281,10 @@ def audit_formula_instance f
case d
when "git", "python", "ruby", "emacs", "mysql", "postgresql", "mercurial"
- problems << " * Don't use #{d} as a dependency; we allow non-Homebrew\n #{d} installs."
+ problems << <<-EOS
+ * Don't use #{d} as a dependency. We allow non-Homeb... | false |
Other | Homebrew | brew | 30cbb25147416620ff64e6ba6d047d5304dff25b.json | Fix some default_cc behavior
Fixes Homebrew/homebrew#10245.
Fixes Homebrew/homebrew#10248. | Library/Homebrew/utils.rb | @@ -269,7 +269,7 @@ def dev_tools_path
def default_cc
cc = `/usr/bin/xcrun -find cc 2> /dev/null`.chomp
cc = "#{dev_tools_path}/cc" if cc.empty?
- Pathname.new(cc).realpath.basename.to_s
+ Pathname.new(cc).realpath.basename.to_s rescue nil
end
def default_compiler
@@ -304,10 +304,9 @@ def gcc... | false |
Other | Homebrew | brew | 0ae1772b89ec52faa77108a3008402f2a1328ef7.json | audit: add problem counts | Library/Homebrew/cmd/audit.rb | @@ -312,6 +312,9 @@ module Homebrew extend self
def audit
errors = false
+ brew_count = 0
+ problem_count = 0
+
ff.each do |f|
problems = []
@@ -353,9 +356,14 @@ def audit
puts "#{f.name}:"
puts problems * "\n"
puts
+ brew_count += 1
+ problem_count... | false |
Other | Homebrew | brew | b5268a877e1de7c31e7f0b7e3abdfde61c5131ad.json | Remove OSX-GCC from brew-doctor
Also fix undesired output if git isn't installed.
Refs Homebrew/homebrew#10244. | Library/Homebrew/cmd/doctor.rb | @@ -733,7 +733,7 @@ def check_missing_deps
def check_git_status
HOMEBREW_REPOSITORY.cd do
- cmd = `git status -s Library/Homebrew/`.chomp
+ cmd = `git status -s Library/Homebrew/ 2> /dev/null`.chomp
if system "/usr/bin/which -s git" and File.directory? '.git' and not cmd.empty?
ohai "You have un... | false |
Other | Homebrew | brew | a69ec7a22bd521d5a48b955bab9c319e761a7851.json | Add dev_tools_path to PATH if not in PATH already
This prevents what are likely a whole slew of bugs. | Library/Homebrew/build.rb | @@ -23,6 +23,9 @@
ENV.setup_build_environment
# we must do this or tools like pkg-config won't get found by configure scripts etc.
ENV.prepend 'PATH', "#{HOMEBREW_PREFIX}/bin", ':' unless ORIGINAL_PATHS.include? "#{HOMEBREW_PREFIX}/bin"
+ # this is a safety measure for Xcode 4.3 which started not inst... | false |
Other | Homebrew | brew | 66f942aa66d9de764e59bf3d36c9d8d61f05f247.json | Find the dev tools, even with Xcode 4.3
Fixes Homebrew/homebrew#9179. | Library/Homebrew/extend/ENV.rb | @@ -22,11 +22,14 @@ def setup_build_environment
# Os is the default Apple uses for all its stuff so let's trust them
self['CFLAGS'] = self['CXXFLAGS'] = "-Os #{SAFE_CFLAGS_FLAGS}"
+ # set us up for the user's compiler choice
self.send self.compiler
+
# we must have a working compiler!
unle... | true |
Other | Homebrew | brew | 66f942aa66d9de764e59bf3d36c9d8d61f05f247.json | Find the dev tools, even with Xcode 4.3
Fixes Homebrew/homebrew#9179. | Library/Homebrew/utils.rb | @@ -251,30 +251,57 @@ def version
MACOS_VERSION
end
+ def dev_tools_path
+ @dev_tools_path ||= if File.file? "/usr/bin/cc" and File.file? "/usr/bin/make"
+ # probably a safe enough assumption
+ "/usr/bin"
+ elsif File.file? "#{xcode_prefix}/usr/bin/make"
+ # cc stopped existing with Xcod... | true |
Other | Homebrew | brew | 5ab0488918c4df609dda69b6affa17023274d9b9.json | fetch: compare checksums case-insensitively
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/fetch.rb | @@ -29,21 +29,21 @@ def fetch
the_tarball, _ = f.fetch
next unless the_tarball.kind_of? Pathname
- previous_md5 = f.instance_variable_get(:@md5)
- previous_sha1 = f.instance_variable_get(:@sha1)
- previous_sha2 = f.instance_variable_get(:@sha256)
+ previous_md5 = f.instance_variable_... | false |
Other | Homebrew | brew | 252605b2ae6ce344e88e946c7de6ef19f7e82121.json | Recognize dist suffix | Library/Homebrew/extend/pathname.rb | @@ -163,7 +163,7 @@ def version
return $1 if $1
# eg foobar-4.5.0-bin
- /-((\d+\.)+\d+[abc]?)[-._](bin|stable|src|sources?)$/.match stem
+ /-((\d+\.)+\d+[abc]?)[-._](bin|dist|stable|src|sources?)$/.match stem
return $1 if $1
# Debian style eg dash_0.5.5.1.orig.tar.gz | false |
Other | Homebrew | brew | a671a13b24d1895ae80c90e040b6647192a9dfe8.json | Add a link to braumeister.org to the README
Closes Homebrew/homebrew#10049.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | README.md | @@ -7,6 +7,7 @@ What Packages Are Available?
1. You can [browse the Formula folder on GitHub][formula].
2. Or type `brew search` for a list.
3. Or run `brew server` to browse packages off of a local web server.
+4. Or visit [braumeister.org][braumeister] to browse packages online.
More Documentation
------------... | false |
Other | Homebrew | brew | e251e5e4ecd0e2c6ce10cc6ef9b6d9c28ff6390e.json | Adjust ARGV tests
ARGV.kegs and ARGV.formulae no longer raise exceptions.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/test/test_ARGV.rb | @@ -19,8 +19,6 @@ def reset
class ARGVTests < Test::Unit::TestCase
def test_ARGV
- assert_raises(FormulaUnspecifiedError) { ARGV.formulae }
- assert_raises(KegUnspecifiedError) { ARGV.kegs }
assert ARGV.named.empty?
(HOMEBREW_CELLAR+'mxcl/10.0').mkpath | false |
Other | Homebrew | brew | 1a3a1249bf811c783b8d65b9491b66054a19aa5e.json | Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/cat.rb | @@ -4,6 +4,7 @@ def cat
# unparsable, if the user wants to cat multiple formula they can call
# brew cat multiple times.
+ raise FormulaUnspecifiedError if ARGV.named.empty?
cd HOMEBREW_REPOSITORY
exec "cat", ARGV.formulae.first.path, *ARGV.options_only
end | true |
Other | Homebrew | brew | 1a3a1249bf811c783b8d65b9491b66054a19aa5e.json | Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/deps.rb | @@ -14,12 +14,14 @@ def deps
puts "#{f.name}: #{f.deps*' '}"
end
elsif ARGV.include? '--tree'
+ raise FormulaUnspecifiedError if ARGV.named.empty?
ARGV.formulae.each do |f|
puts f
recursive_deps_tree(f, 1)
puts
end
else
+ raise FormulaUnspecif... | true |
Other | Homebrew | brew | 1a3a1249bf811c783b8d65b9491b66054a19aa5e.json | Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/fetch.rb | @@ -4,6 +4,8 @@
module Homebrew extend self
def fetch
+ raise FormulaUnspecifiedError if ARGV.named.empty?
+
if ARGV.include? '--deps'
bucket = []
ARGV.formulae.each do |f| | true |
Other | Homebrew | brew | 1a3a1249bf811c783b8d65b9491b66054a19aa5e.json | Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/install.rb | @@ -4,6 +4,8 @@
module Homebrew extend self
def install
+ raise FormulaUnspecifiedError if ARGV.named.empty?
+
ARGV.named.each do |name|
msg = blacklisted? name
raise "No available formula for #{name}\n#{msg}" if msg | true |
Other | Homebrew | brew | 1a3a1249bf811c783b8d65b9491b66054a19aa5e.json | Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/link.rb | @@ -1,5 +1,7 @@
module Homebrew extend self
def link
+ raise KegUnspecifiedError if ARGV.named.empty?
+
ARGV.kegs.each do |keg|
print "Linking #{keg}... "
puts if ARGV.verbose? | true |
Other | Homebrew | brew | 1a3a1249bf811c783b8d65b9491b66054a19aa5e.json | Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/options.rb | @@ -11,6 +11,7 @@ def ff
f.installed? or outdated.include? f.name
end
else
+ raise FormulaUnspecifiedError if ARGV.named.empty?
ARGV.formulae
end
end | true |
Other | Homebrew | brew | 1a3a1249bf811c783b8d65b9491b66054a19aa5e.json | Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/test.rb | @@ -1,5 +1,7 @@
module Homebrew extend self
def test
+ raise KegUnspecifiedError if ARGV.named.empty?
+
ARGV.formulae.each do |f|
# Cannot test uninstalled formulae
unless f.installed? | true |
Other | Homebrew | brew | 1a3a1249bf811c783b8d65b9491b66054a19aa5e.json | Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/uninstall.rb | @@ -2,6 +2,8 @@
module Homebrew extend self
def uninstall
+ raise KegUnspecifiedError if ARGV.named.empty?
+
unless ARGV.force?
ARGV.kegs.each do |keg|
puts "Uninstalling #{keg}..." | true |
Other | Homebrew | brew | 1a3a1249bf811c783b8d65b9491b66054a19aa5e.json | Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/unlink.rb | @@ -1,5 +1,7 @@
module Homebrew extend self
def unlink
+ raise FormulaUnspecifiedError if ARGV.named.empty?
+
ARGV.kegs.each do |keg|
print "Unlinking #{keg}... "
puts "#{keg.unlink} links removed" | true |
Other | Homebrew | brew | 1a3a1249bf811c783b8d65b9491b66054a19aa5e.json | Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/uses.rb | @@ -7,7 +7,7 @@
module Homebrew extend self
def uses
- return if ARGV.formulae.empty?
+ raise FormulaUnspecifiedError if ARGV.named.empty?
uses = Formula.all.select do |f|
ARGV.formulae.all? do |ff| | true |
Other | Homebrew | brew | 1a3a1249bf811c783b8d65b9491b66054a19aa5e.json | Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/versions.rb | @@ -4,6 +4,8 @@ module Homebrew extend self
def versions
raise "Please `brew install git` first" unless system "/usr/bin/which -s git"
+ raise FormulaUnspecifiedError if ARGV.named.empty?
+
ARGV.formulae.all? do |f|
if ARGV.include? '--compact'
puts f.versions * " " | true |
Other | Homebrew | brew | 7ed76725c4c1b4871cb085709f737af52ffd5188.json | uses: do nothing if no args | Library/Homebrew/cmd/uses.rb | @@ -7,19 +7,23 @@
module Homebrew extend self
def uses
+ return if ARGV.formulae.empty?
+
uses = Formula.all.select do |f|
ARGV.formulae.all? do |ff|
# For each formula given, show which other formulas depend on it.
# We only go one level up, ie. direct dependencies.
f.de... | false |
Other | Homebrew | brew | 709674cb95f80ca8fb71c39a53e6fb74bcc2782f.json | Move old ENV.use_foo? compiler methods to compat
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/compat/compatibility.rb | @@ -80,3 +80,17 @@ def fails_with_llvm msg=nil, data=nil
class UnidentifiedFormula < Formula
end
+
+module HomebrewEnvExtension extend self
+ def use_clang?
+ compiler == :clang
+ end
+
+ def use_gcc?
+ compiler == :gcc
+ end
+
+ def use_llvm?
+ compiler == :llvm
+ end
+end | true |
Other | Homebrew | brew | 709674cb95f80ca8fb71c39a53e6fb74bcc2782f.json | Move old ENV.use_foo? compiler methods to compat
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/extend/ENV.rb | @@ -320,18 +320,6 @@ def compiler
end
end
- # don't use in new code
- # don't remove though, but do add to compatibility.rb
- def use_clang?
- compiler == :clang
- end
- def use_gcc?
- compiler == :gcc
- end
- def use_llvm?
- compiler == :llvm
- end
-
def make_jobs
# '-j' requires a p... | true |
Other | Homebrew | brew | b6fa08f2d2238acec1735a5928dcb5b119ec17a7.json | devel: reset mirrors when building devel
Otherwise stable mirrors will be considered when the devel download
fails.
Fixes Homebrew/homebrew#9910. | Library/Homebrew/formula.rb | @@ -769,7 +769,13 @@ def stable &block
def devel &block
raise "url and md5 must be specified in a block" unless block_given?
- instance_eval &block if ARGV.build_devel?
+
+ if ARGV.build_devel?
+ # clear out mirrors from the stable release
+ @mirrors = nil
+
+ instance_eval ... | false |
Other | Homebrew | brew | 59458eac515c87455f83c823b292fe3bfd52e015.json | link: add missing newline in verbose mode
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/link.rb | @@ -2,6 +2,7 @@ module Homebrew extend self
def link
ARGV.kegs.each do |keg|
print "Linking #{keg}... "
+ puts if ARGV.verbose?
begin
puts "#{keg.link} symlinks created"
rescue Exception | false |
Other | Homebrew | brew | d0be4d692b557056220514b743841b55ef180b80.json | keg: handle the info directory file properly
If HOMEBREW_KEEP_INFO environment variable is set:
- Do not symlink the info directory file (aka 'share/info/dir')
otherwise it gets overwritten by next installed brew.
- Install an entry in the directory for each linked info file when the
brew is linked.
- Uninsta... | Library/Contributions/manpages/brew.1.md | @@ -366,7 +366,10 @@ creating your own can be found on the wiki:
* HOMEBREW\_KEEP\_INFO:
If set, Homebrew will not remove files from `share/info`, allowing them
- to be linked from the Cellar.
+ to be linked from the Cellar. To access these info files, prepend
+ `share/info` to your `INFOPATH` enviro... | true |
Other | Homebrew | brew | d0be4d692b557056220514b743841b55ef180b80.json | keg: handle the info directory file properly
If HOMEBREW_KEEP_INFO environment variable is set:
- Do not symlink the info directory file (aka 'share/info/dir')
otherwise it gets overwritten by next installed brew.
- Install an entry in the directory for each linked info file when the
brew is linked.
- Uninsta... | Library/Homebrew/cleaner.rb | @@ -3,7 +3,14 @@ def initialize f
@f = Formula.factory f
[f.bin, f.sbin, f.lib].select{ |d| d.exist? }.each{ |d| clean_dir d }
- unless ENV['HOMEBREW_KEEP_INFO']
+ if ENV['HOMEBREW_KEEP_INFO']
+ # Get rid of the directory file, so it no longer bother us at link stage.
+ info_dir_file = f.inf... | true |
Other | Homebrew | brew | d0be4d692b557056220514b743841b55ef180b80.json | keg: handle the info directory file properly
If HOMEBREW_KEEP_INFO environment variable is set:
- Do not symlink the info directory file (aka 'share/info/dir')
otherwise it gets overwritten by next installed brew.
- Install an entry in the directory for each linked info file when the
brew is linked.
- Uninsta... | Library/Homebrew/extend/pathname.rb | @@ -262,6 +262,20 @@ def ensure_writable
ensure
chmod saved_perms if saved_perms
end
+
+ def install_info
+ unless self.symlink?
+ raise "Cannot install info entry for unbrewed info file '#{self}'"
+ end
+ system '/usr/bin/install-info', self.to_s, (self.dirname+'dir').to_s
+ end
+
+ def uni... | true |
Other | Homebrew | brew | d0be4d692b557056220514b743841b55ef180b80.json | keg: handle the info directory file properly
If HOMEBREW_KEEP_INFO environment variable is set:
- Do not symlink the info directory file (aka 'share/info/dir')
otherwise it gets overwritten by next installed brew.
- Install an entry in the directory for each linked info file when the
brew is linked.
- Uninsta... | Library/Homebrew/keg.rb | @@ -7,6 +7,8 @@ def initialize path
raise "#{to_s} is not a directory" unless directory?
end
+ INFOFILE_RX = %r[/share/info/[^.].*?\.info$]
+
# if path is a file in a keg then this will return the containing Keg object
def self.for path
path = path.realpath
@@ -29,6 +31,7 @@ def unlink
next... | true |
Other | Homebrew | brew | d0be4d692b557056220514b743841b55ef180b80.json | keg: handle the info directory file properly
If HOMEBREW_KEEP_INFO environment variable is set:
- Do not symlink the info directory file (aka 'share/info/dir')
otherwise it gets overwritten by next installed brew.
- Install an entry in the directory for each linked info file when the
brew is linked.
- Uninsta... | share/man/man1/brew.1 | @@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BREW" "1" "January 2012" "Homebrew" "brew"
+.TH "BREW" "1" "February 2012" "Homebrew" "brew"
.
.SH "NAME"
\fBbrew\fR \- The missing package manager for OS X
@@ -403,7 +403,10 @@ If set, Homebrew will use this edi... | true |
Other | Homebrew | brew | 212927ee54cfcee0384ae3cac91e97516a5a02f8.json | Pathname: remove trailing spaces
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/extend/pathname.rb | @@ -84,7 +84,7 @@ def rmdir_if_possible
raise unless e.errno == Errno::ENOTEMPTY::Errno or e.errno == Errno::EACCES::Errno
false
end
-
+
def chmod_R perms
require 'fileutils'
FileUtils.chmod_R perms, to_s
@@ -139,7 +139,7 @@ def version
# eg. ruby-1.9.1-p243
/-((\d+\.)*\d\.\d+-(p|r... | false |
Other | Homebrew | brew | 8809c85cc3515736f5c7b85436d1020aa17cb6c4.json | versions: ignore NameError and ArgumentError
Fixes Homebrew/homebrew#9856.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/versions.rb | @@ -69,7 +69,7 @@ def version_for_sha sha
version = nostdout { Formula.factory(path).version }
Object.send(:remove_const, Formula.class_s(name))
version
- rescue SyntaxError, TypeError
+ rescue SyntaxError, TypeError, NameError, ArgumentError
# We rescue these s... | false |
Other | Homebrew | brew | 62cfa490828bc65cc13666c686b4eb209633af3a.json | audit: make boost-jam a build-time dependency | Library/Homebrew/cmd/audit.rb | @@ -24,7 +24,7 @@ def audit_formula_text name, text
end
# cmake, pkg-config, and scons are build-time deps
- if text =~ /depends_on ['"](cmake|pkg-config|scons|smake)['"]$/
+ if text =~ /depends_on ['"](boost-jam|cmake|pkg-config|scons|smake)['"]$/
problems << " * #{$1} dependency should be \"depends_on ... | false |
Other | Homebrew | brew | 6b669981decfc2e8463bb00143b6684f477295eb.json | Add beer recipe. This is homebrew after all.
Signed-off-by: Adam Vandenberg <flangy@gmail.com> | Library/Contributions/examples/brew-beer.rb | @@ -0,0 +1,179 @@
+HOMEBREW_BEER = <<-EOS
+Recipe stolen from: http://allrecipes.com/howto/beer-brewing-for-beginners/
+
+**The Key Ingredients**
+Before beginning the brewing process, you must first understand the four key
+ingredients necessary to brew a batch of beer: water, fermentable sugar, hops,
+and yeast. Each... | false |
Other | Homebrew | brew | ab19242d0484a91ca2b9dac28c8a131be08758d6.json | audit: reorganize some checks
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/audit.rb | @@ -199,6 +199,11 @@ def audit_formula_urls f
problems << " * The homepage should start with http or https."
end
+ # Google Code homepages should end in a slash
+ if f.homepage =~ %r[^https?://code\.google\.com/p/[^/]+[^/]$]
+ problems << " * Google Code homepage should end with a slash."
+ end
+
url... | false |
Other | Homebrew | brew | c71f883fa8a6a5bd2f9a42207e1fd1476c2a44b8.json | Use more generic cflags when building bottles.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/extend/ENV.rb | @@ -77,7 +77,7 @@ def gcc_4_0_1
self['CC'] = '/usr/bin/gcc-4.0'
self['CXX'] = '/usr/bin/g++-4.0'
replace_in_cflags '-O4', '-O3'
- set_cpu_cflags 'nocona -mssse3', :core => 'prescott'
+ set_cpu_cflags 'nocona -mssse3', :core => 'prescott', :bottle => 'generic'
@compiler = :gcc
end
alias_m... | false |
Other | Homebrew | brew | a3db9a42e878b04747100f5b70bbd999eac7cdbf.json | Add option for building bottles.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/extend/ARGV.rb | @@ -81,12 +81,13 @@ def build_32_bit?
include? '--32-bit'
end
+ def build_bottle?
+ MacOS.bottles_supported? and include? '--build-bottle'
+ end
+
def build_from_source?
- return true if flag? '--build-from-source' or ENV['HOMEBREW_BUILD_FROM_SOURCE'] \
- or not MacOS.lion? or HOMEBREW_PREFIX.... | true |
Other | Homebrew | brew | a3db9a42e878b04747100f5b70bbd999eac7cdbf.json | Add option for building bottles.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/utils.rb | @@ -398,6 +398,10 @@ def lion?
def prefer_64_bit?
Hardware.is_64_bit? and 10.6 <= MACOS_VERSION
end
+
+ def bottles_supported?
+ lion? and HOMEBREW_PREFIX.to_s == '/usr/local'
+ end
end
module GitHub extend self | true |
Other | Homebrew | brew | 8d100a0508f201417784553b4738262ccad448cb.json | search: return results while parsing
Instead of returning a full list of results after parsing, yield and
print each result as it's found for a snappier user experience.
Closes Homebrew/homebrew#9576.
Signed-off-by: Misty De Meo <mistydemeo@gmail.com> | Library/Homebrew/cmd/search.rb | @@ -29,10 +29,8 @@ def search
end
if search_results.empty? and not blacklisted? query
- pulls = GitHub.find_pull_requests rx
- unless pulls.empty?
- puts "Open pull requests matching \"#{query}\":", *pulls.map { |p| " #{p}" }
- end
+ puts "No formula found for \"#... | true |
Other | Homebrew | brew | 8d100a0508f201417784553b4738262ccad448cb.json | search: return results while parsing
Instead of returning a full list of results after parsing, yield and
print each result as it's found for a snappier user experience.
Closes Homebrew/homebrew#9576.
Signed-off-by: Misty De Meo <mistydemeo@gmail.com> | Library/Homebrew/utils.rb | @@ -432,17 +432,15 @@ def find_pull_requests rx
require 'open-uri'
require 'vendor/multi_json'
- pulls = []
query = rx.source.delete '.*'
uri = URI.parse("http://github.com/api/v2/json/issues/search/mxcl/homebrew/open/#{query}")
open uri do |f|
MultiJson.decode(f.read)["issues"].e... | true |
Other | Homebrew | brew | 7962b15a982cef28cf2356fff1f534000fdb333a.json | search: use v2 API
The v3 API currently lacks a search feature. Use the v2 API instead for
much faster pull request filtering.
Closes Homebrew/homebrew#9592.
Signed-off-by: Misty De Meo <mistydemeo@gmail.com> | Library/Homebrew/utils.rb | @@ -433,20 +433,14 @@ def find_pull_requests rx
require 'vendor/multi_json'
pulls = []
- uri = URI.parse("https://api.github.com/repos/mxcl/homebrew/pulls")
- uri.query = "per_page=100"
+ query = rx.source.delete '.*'
+ uri = URI.parse("http://github.com/api/v2/json/issues/search/mxcl/homebrew/o... | false |
Other | Homebrew | brew | 6626966ddd7740064532adf9370017306c4aaf7c.json | Use the basename of which_editor
I had EDITOR set to /usr/local/bin/mate set and got the whole of /usr/local opened in TextMate which takes fricking forever! | Library/Homebrew/cmd/edit.rb | @@ -4,7 +4,7 @@ module Homebrew extend self
def edit
# If no brews are listed, open the project root in an editor.
if ARGV.named.empty?
- editor = which_editor
+ editor = File.basename which_editor
if editor == "mate"
# If the user is using TextMate, give a nice project view inste... | false |
Other | Homebrew | brew | e9a0f24ccbd74e9494e0641037d27b23631e22cf.json | versions: use the actual class name when unloading
And document a bit more why this hack is present.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/versions.rb | @@ -62,8 +62,15 @@ def version_for_sha sha
mktemp do
path = Pathname.new(Pathname.pwd+"#{name}.rb")
path.write text_from_sha(sha)
- # FIXME: shouldn't have to do this?
- Object.send(:remove_const, "#{name.capitalize}")
+
+ # Unload the class so Formula#version returns the c... | false |
Other | Homebrew | brew | 79439626b5e7564566bdf8736916342e2bb5e1a7.json | search: return matches from open pull requests
When search can't find any local results, hit the GitHub API and search
the titles of pending pull requests. This will help people find the many
proposed formulae and prevent them from wasting time duplicating them.
Closes Homebrew/homebrew#9018.
Signed-off-by: Jack Nag... | Library/Homebrew/cmd/search.rb | @@ -9,7 +9,13 @@ def search
exec "open", "http://pdb.finkproject.org/pdb/browse.php?summary=#{ARGV.next}"
else
query = ARGV.first
- search_results = search_brews query
+ rx = if query =~ %r{^/(.*)/$}
+ Regexp.new($1)
+ else
+ /.*#{Regexp.escape query}.*/i
+ end
+
+ ... | true |
Other | Homebrew | brew | 79439626b5e7564566bdf8736916342e2bb5e1a7.json | search: return matches from open pull requests
When search can't find any local results, hit the GitHub API and search
the titles of pending pull requests. This will help people find the many
proposed formulae and prevent them from wasting time duplicating them.
Closes Homebrew/homebrew#9018.
Signed-off-by: Jack Nag... | Library/Homebrew/utils.rb | @@ -427,4 +427,28 @@ def issues_for_formula name
rescue
[]
end
+
+ def find_pull_requests rx
+ require 'open-uri'
+ require 'vendor/multi_json'
+
+ pulls = []
+ uri = URI.parse("https://api.github.com/repos/mxcl/homebrew/pulls")
+ uri.query = "per_page=100"
+
+ open uri do |f|
+ Multi... | true |
Other | Homebrew | brew | 5bfd8faf901378194ea1aa34a10524b0786fc7a6.json | versions: unload old class before obtaining version
This is silly, but I am no Rubyist and I don't have time to
figure out why Formula.factory(foo).url works as expected but
Formula.factory(foo).version does not.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/versions.rb | @@ -62,6 +62,8 @@ def version_for_sha sha
mktemp do
path = Pathname.new(Pathname.pwd+"#{name}.rb")
path.write text_from_sha(sha)
+ # FIXME: shouldn't have to do this?
+ Object.send(:remove_const, "#{name.capitalize}")
Formula.factory(path).version
end rescue nil
... | false |
Other | Homebrew | brew | 016a508c7a8a1456a52a32ad4330d811d1a043aa.json | versions: determine version from a Formula instance
Rather than regex the output of `git show <rev>:<path>`, we write the
output of `git cat-file blog <rev>:<path>` to a temporary file, and then
operate on it just as we would a normal formula.
I haven't observed any speed difference. `git cat-file blob` is faster
tha... | Library/Homebrew/cmd/versions.rb | @@ -1,76 +1,68 @@
require 'formula'
module Homebrew extend self
-
- module Versions
- # yields version, sha for all versions in the git history
- def self.old_versions f
- yielded = []
- f.rev_list.each do |sha|
- version = f.version_for_sha sha
- unless yielded.include? version or ve... | false |
Other | Homebrew | brew | d274d37263e99193567606ac2b7929bc64dba091.json | Tab: handle non-core kegs without receipts
Passing Formula.factory the name of a keg that belongs to a non-core
formula will cause an error to be raised; we don't really care, so just
fake a totally empty install receipt in this case.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/tab.rb | @@ -33,7 +33,11 @@ def self.for_keg keg
if path.exist?
self.from_file path
else
- self.dummy_tab Formula.factory(keg.parent.basename)
+ begin
+ self.dummy_tab Formula.factory(keg.parent.basename)
+ rescue FormulaUnavailableError
+ Tab.new :used_options => [], :unused_option... | false |
Other | Homebrew | brew | dc1be896d8edb63cf1afd168a331a86b6fe2f289.json | tab: allow retrieving tabs from arbitrary kegs
This will be useful in places where we need information about things
other than the currently linked keg, such as `brew info`.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/tab.rb | @@ -27,6 +27,16 @@ def self.from_file path
return tab
end
+ def self.for_keg keg
+ path = keg+'INSTALL_RECEIPT.json'
+
+ if path.exist?
+ self.from_file path
+ else
+ self.dummy_tab Formula.factory(keg.parent.basename)
+ end
+ end
+
def self.for_formula f
f = Formula.factory f ... | false |
Other | Homebrew | brew | 07b7dd7a7aa1bc2f1628a1081006845374426bc4.json | Add a helper to determine if a keg is linked
'keg.linked?' will return true if there is an entry for 'keg' in
LinkedKegs.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/keg.rb | @@ -45,6 +45,10 @@ def linked_keg_record
@linked_keg_record ||= HOMEBREW_REPOSITORY/"Library/LinkedKegs"/fname
end
+ def linked?
+ linked_keg_record.directory? and self == linked_keg_record.realpath
+ end
+
def link
raise "Cannot link #{fname}\nAnother version is already linked: #{linked_keg_reco... | false |
Other | Homebrew | brew | 826064880e8c1b0b2153b2157294bba9b8eaaf5e.json | tests: add missing require to test_ENV
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/test/test_ENV.rb | @@ -1,5 +1,6 @@
require 'testing_env'
require 'utils'
+require 'hardware'
require 'extend/ENV'
ENV.extend(HomebrewEnvExtension)
| false |
Other | Homebrew | brew | 647e7f11267ca101500081c1203bf31af7ed7f97.json | config: prettify sha method
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/cmd/--config.rb | @@ -30,7 +30,9 @@ def xcode_version
end
def sha
- sha = `cd #{HOMEBREW_REPOSITORY} && git rev-parse --verify HEAD 2> /dev/null`.chomp
+ sha = HOMEBREW_REPOSITORY.cd do
+ `git rev-parse --verify -q HEAD 2>/dev/null`.chomp
+ end
if sha.empty? then "(none)" else sha end
end
| false |
Other | Homebrew | brew | d83076c07ed8dac3d629d4532e5f4e8d98a9a793.json | Generalize formula_installer dependency resolution
Use `Formula.factory dep.path` instead of `Formula.factory dep.name` so that
non-standard dependencies specified as URLs or paths can be handled properly. | Library/Homebrew/formula_installer.rb | @@ -35,7 +35,7 @@ def install
# Re-create the formula object so that args like `--HEAD` won't
# affect properties like the installation prefix. Also need to
# re-check installed status as the Formula may have changed.
- dep = Formula.factory dep.name
+ ... | false |
Other | Homebrew | brew | f437c9040b08d1950aeaedb8417e22752b285c25.json | Resolve multi-level gcc symlinks
In later XCodes, gcc is a symlink to gcc-4.2 which is itself a symlink
to llvm-gcc, so it is necessary to resolve multiple symlinks.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/extend/ENV.rb | @@ -90,8 +90,7 @@ def gcc args = {}
@compiler = :gcc
raise "GCC could not be found" if args[:force] and not File.exist? ENV['CC'] \
- or (File.symlink? ENV['CC'] \
- and File.readlink(ENV['CC']) =~ /llvm/)
+ ... | false |
Other | Homebrew | brew | fca07369ab5c81d3abaa77841b9403a73efa2f78.json | Omit empty caveats | Library/Homebrew/cmd/info.rb | @@ -70,7 +70,8 @@ def info_formula f
end
end
- if f.caveats
+ the_caveats = (f.caveats || "").strip
+ unless the_caveats.empty?
puts
puts f.caveats
puts | true |
Other | Homebrew | brew | fca07369ab5c81d3abaa77841b9403a73efa2f78.json | Omit empty caveats | Library/Homebrew/formula_installer.rb | @@ -72,10 +72,12 @@ def install_dependency dep
end
def caveats
- if f.caveats
+ the_caveats = (f.caveats || "").strip
+ unless the_caveats.empty?
ohai "Caveats", f.caveats
@show_summary_heading = true
end
+
if f.keg_only?
ohai 'Caveats', f.keg_only_text
@show_summa... | true |
Other | Homebrew | brew | fd082f63b6a039f39da6017eb0f5f2b262433fc7.json | Extract checksum type function | Library/Homebrew/formula.rb | @@ -588,14 +588,19 @@ def fetch
return fetched, downloader
end
+ # Detect which type of checksum is being used, or nil if none
+ def checksum_type
+ CHECKSUM_TYPES.detect { |type| instance_variable_defined?("@#{type}") }
+ end
+
# For FormulaInstaller.
def verify_download_integrity fn, *args
... | false |
Other | Homebrew | brew | f052bcbd62fcb8cd3ccfc2adaf82944f27532eed.json | Simplify a couple of comments | Library/Homebrew/formula.rb | @@ -149,10 +149,7 @@ def installed?
end
def explicitly_requested?
-
- # `ARGV.formulae` will throw an exception if it comes up with an empty
- # list.
- #
+ # `ARGV.formulae` will throw an exception if it comes up with an empty list.
# FIXME: `ARGV.formulae` shouldn't be throwing exceptions, se... | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.