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 | 42c9ecd6654e65ed39f1cf20ccc8e24007254c3a.json | Bottle: handle legacy bottle OS tags.
Otherwise :mountainlion, :snowleopard in the history for CMake breaks
bottle_filenames from versions for new CMake bottles. | Library/Homebrew/software_spec.rb | @@ -120,7 +120,7 @@ def checksums
checksum_os_versions = send checksum_type
next unless checksum_os_versions
os_versions = checksum_os_versions.keys
- os_versions.map! {|osx| MacOS::Version.from_symbol osx }
+ os_versions.map! {|osx| MacOS::Version.from_symbol osx rescue nil }
os_v... | false |
Other | Homebrew | brew | f01a38772aa7e865a38c71e73661fb14825da9b9.json | Fix md5 compat layer
Fixes Homebrew/homebrew#23653. | Library/Homebrew/compat/md5.rb | @@ -1,7 +1,6 @@
class Formula
def self.md5(val)
- @stable ||= create_spec(SoftwareSpec)
- @stable.md5(val)
+ stable.md5(val)
end
end
| false |
Other | Homebrew | brew | 0a1df377fb7e807bf2f45f96808a5633a9069455.json | fix build log output
Closes Homebrew/homebrew#23669.
Signed-off-by: Adam Vandenberg <flangy@gmail.com> | Library/Homebrew/exceptions.rb | @@ -198,8 +198,8 @@ def dump
puts
onoe "#{formula.name} did not build"
unless (logs = Dir["#{ENV['HOME']}/Library/Logs/Homebrew/#{formula}/*"]).empty?
- print "Logs: "
- puts logs.map{|fn| " #{fn}"}.join("\n")
+ puts "Logs:"
+ puts logs.map{|fn| " #{fn}"}.join("... | false |
Other | Homebrew | brew | 2775a4b12cce406c85b97b70ed424852bf3bc783.json | Move bottle stdlib tracking post-pour
This allows us to track the actual stdlib in use, and prevents warnings
for bottles with no C++ code. | Library/Homebrew/formula_installer.rb | @@ -179,16 +179,6 @@ def install
raise "Unrecognized architecture for --bottle-arch: #{arch}"
end
- if pour_bottle?
- # This assumes that bottles are built with
- # a) the OS's default compiler, and
- # b) the OS's default C++ stdlib
- # This is probably accurate, but could possibly... | false |
Other | Homebrew | brew | 3657393017cc4a17f72107a7b144060fa7dc7b8b.json | Move stdlib tracking postinstall
This moves stdlib tracking after the install completes, which allows
the tracking to have access to the actual stdlib in use.
This unfortunately means that builds can error out *after* a build,
resulting in wasted time; however, it reduces false positives, and the
overall user experie... | Library/Homebrew/build.rb | @@ -141,17 +141,6 @@ def install
end
end
- # TODO Track user-selected stdlibs, such as boost in C++11 mode
- stdlib = ENV.compiler == :clang ? MacOS.default_cxx_stdlib : :libstdcxx
- stdlib_in_use = CxxStdlib.new(stdlib, ENV.compiler)
-
- # This is a bad place for this check, but we don't have... | true |
Other | Homebrew | brew | 3657393017cc4a17f72107a7b144060fa7dc7b8b.json | Move stdlib tracking postinstall
This moves stdlib tracking after the install completes, which allows
the tracking to have access to the actual stdlib in use.
This unfortunately means that builds can error out *after* a build,
resulting in wasted time; however, it reduces false positives, and the
overall user experie... | Library/Homebrew/formula_installer.rb | @@ -386,8 +386,6 @@ def finish
fix_install_names if OS.mac?
- record_cxx_stdlib
-
ohai "Summary" if ARGV.verbose? or show_summary_heading
unless ENV['HOMEBREW_NO_EMOJI']
print "\xf0\x9f\x8d\xba " if MacOS.version >= :lion
@@ -529,18 +527,6 @@ def fix_install_names
@show_summary_headin... | true |
Other | Homebrew | brew | 3657393017cc4a17f72107a7b144060fa7dc7b8b.json | Move stdlib tracking postinstall
This moves stdlib tracking after the install completes, which allows
the tracking to have access to the actual stdlib in use.
This unfortunately means that builds can error out *after* a build,
resulting in wasted time; however, it reduces false positives, and the
overall user experie... | Library/Homebrew/tab.rb | @@ -10,7 +10,7 @@
class Tab < OpenStruct
FILENAME = 'INSTALL_RECEIPT.json'
- def self.create f, compiler, args
+ def self.create f, compiler, stdlib, args
f.build.args = args
sha = HOMEBREW_REPOSITORY.cd do
@@ -25,7 +25,8 @@ def self.create f, compiler, args
:tapped_from => f.tap,
... | true |
Other | Homebrew | brew | 71fcefc6137fd8c67952e114a8485bfae599ea1b.json | brew-unpack: use #length == 1, not #one?
Array#one? wasn't yet defined in Ruby 1.8.6. In this case the block form
isn't being used, so Array.length == 1 is a simple replacement.
Fixes mistydemeo/tigerbrew#123. | Library/Contributions/cmd/brew-unpack.rb | @@ -89,7 +89,7 @@ def unpack
ENV['VERBOSE'] = '1' # show messages about tar
f.brew do
entries = Dir['*']
- cd entries.first if entries.one? && File.directory?(entries.first)
+ cd entries.first if entries.length == 1 && File.directory?(entries.first)
cp_r getwd, stage_dir
... | false |
Other | Homebrew | brew | 91dfb608054aeb373c47643eebfa60ba0058946f.json | create: escape example interpolation
Fixes Homebrew/homebrew#23643. | Library/Homebrew/cmd/create.rb | @@ -166,7 +166,7 @@ def install
# were more thorough. Run the test with `brew test #{name}`.
#
# The installed folder is not in the path, so use the entire path to any
- # executables being tested: `system "#{bin}/program", "--version"`.
+ # executables being tested: `system "\#... | false |
Other | Homebrew | brew | 6857e2ed34b35e2a8168f4cd47d3cc3e057a92bd.json | add note about test path to create template | Library/Homebrew/cmd/create.rb | @@ -164,6 +164,9 @@ def install
# This test will fail and we won't accept that! It's enough to just replace
# "false" with the main program this formula installs, but it'd be nice if you
# were more thorough. Run the test with `brew test #{name}`.
+ #
+ # The installed folder is... | false |
Other | Homebrew | brew | ed3343565a6b02f85d6e0a21b8f64be81c1cd0a3.json | doctor: require CLT on 10.9.
Xcode-only setup is badly broken and will remain that way until fixed by
Apple. For many 10.9 issues this fixes things so let's tell the users. | Library/Homebrew/cmd/doctor.rb | @@ -191,7 +191,9 @@ def check_for_broken_symlinks
end
def check_xcode_clt
- if MacOS::Xcode.installed?
+ if MacOS.version >= :mavericks
+ __check_clt_up_to_date
+ elsif MacOS::Xcode.installed?
__check_xcode_up_to_date
elsif MacOS.version >= :lion
__check_clt_up_to_date | false |
Other | Homebrew | brew | 90a630dcadb50829a17c6423b1af0bb2b4491f69.json | create: detect name from GitHub archives. | Library/Homebrew/cmd/create.rb | @@ -78,9 +78,11 @@ def url= url
@url = url
path = Pathname.new(url)
if @name.nil?
+ %r{github.com/\S+/(\S+)/archive/}.match url
+ @name ||= $1
/(.*?)[-_.]?#{path.version}/.match path.basename
- @name = $1
- @path = Formula.path $1 unless $1.nil?
+ @name ||= $1
+ @path... | false |
Other | Homebrew | brew | a999ddc002af970b12e8472daa3677c1c2e093c5.json | Add HOMEBREW_NO_GITHUB_API env var.
This patch allows users to "opt out" of using the GitHub API altogether
by setting the HOMEBREW_NO_GITHUB_API environment variable. The
value of the environment variable does not matter (it can even be
empty!).
For Bash/ZSH: export HOMEBREW_NO_GITHUB_API=1
Signed-off-by: Mike McQu... | Library/Contributions/manpages/brew.1.md | @@ -524,6 +524,10 @@ can take several different forms:
*Note:* Homebrew will only try to print emoji on Lion or newer.
+ * HOMEBREW\_NO\_GITHUB\_API:
+ If set, Homebrew will not use the GitHub API for e.g searches or
+ fetching relevant issues on a failed install.
+
* HOMEBREW\_SOURCEFORGE\_MIRROR:
... | true |
Other | Homebrew | brew | a999ddc002af970b12e8472daa3677c1c2e093c5.json | Add HOMEBREW_NO_GITHUB_API env var.
This patch allows users to "opt out" of using the GitHub API altogether
by setting the HOMEBREW_NO_GITHUB_API environment variable. The
value of the environment variable does not matter (it can even be
empty!).
For Bash/ZSH: export HOMEBREW_NO_GITHUB_API=1
Signed-off-by: Mike McQu... | Library/Homebrew/cmd/search.rb | @@ -61,7 +61,7 @@ def search
count = local_results.length + tap_results.length
if count == 0 and not blacklisted? query
- puts "No formula found for #{query.inspect}. Searching open pull requests..."
+ puts "No formula found for #{query.inspect}."
begin
GitHub.find_pull... | true |
Other | Homebrew | brew | a999ddc002af970b12e8472daa3677c1c2e093c5.json | Add HOMEBREW_NO_GITHUB_API env var.
This patch allows users to "opt out" of using the GitHub API altogether
by setting the HOMEBREW_NO_GITHUB_API environment variable. The
value of the environment variable does not matter (it can even be
empty!).
For Bash/ZSH: export HOMEBREW_NO_GITHUB_API=1
Signed-off-by: Mike McQu... | Library/Homebrew/utils.rb | @@ -254,6 +254,9 @@ module GitHub extend self
Error = Class.new(StandardError)
def open url, headers={}, &block
+ # This is a no-op if the user is opting out of using the GitHub API.
+ return if ENV['HOMEBREW_NO_GITHUB_API']
+
require 'net/https' # for exception classes below
default_headers =... | true |
Other | Homebrew | brew | a999ddc002af970b12e8472daa3677c1c2e093c5.json | Add HOMEBREW_NO_GITHUB_API env var.
This patch allows users to "opt out" of using the GitHub API altogether
by setting the HOMEBREW_NO_GITHUB_API environment variable. The
value of the environment variable does not matter (it can even be
empty!).
For Bash/ZSH: export HOMEBREW_NO_GITHUB_API=1
Signed-off-by: Mike McQu... | 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" "September 2013" "Homebrew" "brew"
+.TH "BREW" "1" "October 2013" "Homebrew" "brew"
.
.SH "NAME"
\fBbrew\fR \- The missing package manager for OS X
@@ -557,6 +557,10 @@ If set, Homebrew will not print t... | true |
Other | Homebrew | brew | 5b433bb05a8b9010493a58ea6fe475596dfa06e9.json | config: omit llvm-gcc if it's not installed | Library/Homebrew/cmd/--config.rb | @@ -112,7 +112,7 @@ def dump_build_config
unless MacOS.compilers_standard?
puts "GCC-4.0: build #{gcc_40}" if gcc_40
puts "GCC-4.2: build #{gcc_42}" if gcc_42
- puts "LLVM-GCC: #{llvm ? "build #{llvm}" : "N/A"}"
+ puts "LLVM-GCC: build #{llvm}" if llvm
puts "Clang: #{clang ? "#{clan... | false |
Other | Homebrew | brew | 0296ffa0efb7692470bbb8312e0b0fcdb61263dd.json | test_formula: add Mavericks bottles. | Library/Homebrew/test/test_formula.rb | @@ -169,6 +169,7 @@ def test_formula_spec_integration
sha1 'faceb00cfaceb00cfaceb00cfaceb00cfaceb00c' => :snow_leopard
sha1 'baadf00dbaadf00dbaadf00dbaadf00dbaadf00d' => :lion
sha1 '8badf00d8badf00d8badf00d8badf00d8badf00d' => :mountain_lion
+ sha1 'deadf00ddeadf00ddeadf00ddeadf00ddead... | true |
Other | Homebrew | brew | 0296ffa0efb7692470bbb8312e0b0fcdb61263dd.json | test_formula: add Mavericks bottles. | Library/Homebrew/test/test_formula_spec_selection.rb | @@ -45,6 +45,7 @@ def install_bottle?(*); true; end
:snow_leopard => 'faceb00c'*5,
:lion => 'baadf00d'*5,
:mountain_lion => '8badf00d'*5,
+ :mavericks => 'deadf00d'*5
}.each_pair do |cat, val|
sha1(val => cat)
end | true |
Other | Homebrew | brew | 9ebc527e49e531a240aa628659b00df56158ebf7.json | Improve Xcode and CLT installation instructions. | Library/Homebrew/blacklist.rb | @@ -40,10 +40,16 @@ def blacklisted? name
EOS
when /(lib)?lzma/
"lzma is now part of the xz formula."
- when 'xcode' then <<-EOS.undent
- Xcode can be installed via the App Store (on Lion or newer), or from:
- https://developer.apple.com/downloads/
- EOS
+ when 'xcode'
+ if MacOS.version >=... | true |
Other | Homebrew | brew | 9ebc527e49e531a240aa628659b00df56158ebf7.json | Improve Xcode and CLT installation instructions. | Library/Homebrew/cmd/doctor.rb | @@ -193,34 +193,68 @@ def check_for_broken_symlinks
def check_xcode_clt
if MacOS::Xcode.installed?
__check_xcode_up_to_date
- elsif MacOS.version >= "10.7"
+ elsif MacOS.version >= :lion
__check_clt_up_to_date
else <<-EOS.undent
- Xcode not installed
- Most stuff needs Xcode to build: http://de... | true |
Other | Homebrew | brew | 9ebc527e49e531a240aa628659b00df56158ebf7.json | Improve Xcode and CLT installation instructions. | Library/Homebrew/requirements.rb | @@ -12,10 +12,20 @@ class XcodeDependency < Requirement
satisfy(:build_env => false) { MacOS::Xcode.installed? }
- def message; <<-EOS.undent
- A full installation of Xcode.app is required to compile this software.
- Installing just the Command Line Tools is not sufficient.
+ def message
+ message = <... | true |
Other | Homebrew | brew | 6a3dc198f5501d4c98d661fd17fd2231715e8d16.json | brew-pull: fix whitespace handling. | Library/Contributions/cmd/brew-pull.rb | @@ -52,7 +52,11 @@ def tap arg
patch_args << '--signoff' unless ARGV.include? '--clean'
# Normally we don't want whitespace errors, but squashing them can break
# patches so an option is provided to skip this step.
- patch_args << '--whitespace=fix' unless ARGV.include? '--ignore-whitespace' or ARGV.include? ... | false |
Other | Homebrew | brew | ada07d07bf997341444949030478a967e7bf42db.json | doctor: remove 10.9 warning | Library/Homebrew/cmd/doctor.rb | @@ -235,14 +235,6 @@ def check_for_osx_gcc_installer
end
end
-def check_for_unsupported_osx
- if MacOS.version > 10.8 then <<-EOS.undent
- You are using Mac OS X #{MacOS.version}.
- We do not yet provide support for this (unreleased) version.
- EOS
- end
-end
-
def check_for_stray_developer_directory
... | false |
Other | Homebrew | brew | 83d4ac5092f57c39d189f1e28cad7083324f01dc.json | Remove "double negative" condition | Library/Homebrew/formula.rb | @@ -56,7 +56,7 @@ def initialize name='__UNKNOWN__', path=nil
def set_spec(name)
spec = self.class.send(name)
- if block_given? && yield(spec) || !spec.url.nil?
+ if block_given? && yield(spec) || spec.url
spec.owner = self
instance_variable_set("@#{name}", spec)
end | false |
Other | Homebrew | brew | de871a4daf4947593c87ea2958e842741d9757ad.json | Fix bottle_tag tests | Library/Homebrew/test/test_bottle_tag.rb | @@ -6,20 +6,61 @@ def test_tag_tiger_ppc
MacOS.stubs(:version).returns(MacOS::Version.new("10.4"))
Hardware::CPU.stubs(:type).returns(:ppc)
Hardware::CPU.stubs(:family).returns(:foo)
- assert_equal :foo, bottle_tag
+ MacOS.stubs(:prefer_64_bit?).returns(false)
+ assert_equal :tiger_foo, bottle_t... | false |
Other | Homebrew | brew | 1cb7eca3a58a6297c833f4d6f3f8931ebc3a2e52.json | tap: use dedicated exception for already tapped. | Library/Homebrew/cmd/tap.rb | @@ -23,7 +23,7 @@ def install_tap user, repo
# we downcase to avoid case-insensitive filesystem issues
tapd = HOMEBREW_LIBRARY/"Taps/#{user.downcase}-#{repo.downcase}"
- raise "Already tapped!" if tapd.directory?
+ raise AlreadyTappedError if tapd.directory?
abort unless system "git clone https:/... | true |
Other | Homebrew | brew | 1cb7eca3a58a6297c833f4d6f3f8931ebc3a2e52.json | tap: use dedicated exception for already tapped. | Library/Homebrew/exceptions.rb | @@ -221,6 +221,11 @@ def message; <<-EOS.undent
end
end
+# raised in install_tap
+class AlreadyTappedError < RuntimeError
+ def initialize; super "Already tapped!" end
+end
+
# raised in CurlDownloadStrategy.fetch
class CurlDownloadStrategyError < RuntimeError; end
| true |
Other | Homebrew | brew | 077f09e4ea7cabef9f3dd7212e5ccdfff1e5001d.json | global: unify tap regex.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/search.rb | @@ -4,12 +4,6 @@
require 'utils/json'
module Homebrew extend self
-
- # A regular expession to capture the username (one or more char but no `/`,
- # which has to be escaped like `\/`), repository, followed by an optional `/`
- # and an optional query.
- TAP_QUERY_REGEX = /^([^\/]+)\/([^\/]+)\/?(.+)?$/
-
def... | true |
Other | Homebrew | brew | 077f09e4ea7cabef9f3dd7212e5ccdfff1e5001d.json | global: unify tap regex.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/exceptions.rb | @@ -44,7 +44,7 @@ def dependent_s
end
def to_s
- if name =~ %r{(\w+)/(\w+)/([^/]+)} then <<-EOS.undent
+ if name =~ HOMEBREW_TAP_REGEX then <<-EOS.undent
No available formula for #$3 #{dependent_s}
Please tap it and then try again: brew tap #$1/#$2
EOS | true |
Other | Homebrew | brew | 077f09e4ea7cabef9f3dd7212e5ccdfff1e5001d.json | global: unify tap regex.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/global.rb | @@ -83,6 +83,11 @@ def mkpath
HOMEBREW_CURL_ARGS = '-f#LA'
+# A regular expession to capture the username (one or more char but no `/`,
+# which has to be escaped like `\/`), repository, followed by an optional `/`
+# and an optional query.
+HOMEBREW_TAP_REGEX = /^([^\/]+)\/([^\/]+)\/?(.+)?$/
+
module Homebrew ex... | true |
Other | Homebrew | brew | b31f6c0099e344253bf5dfb8bc1202d7b4c70f83.json | OS::Mac: Add Xcode 2.5 compiler | Library/Homebrew/os/mac.rb | @@ -222,6 +222,7 @@ def preferred_arch
end
STANDARD_COMPILERS = {
+ "2.5" => { :gcc_40_build => 5370 },
"3.1.4" => { :gcc_40_build => 5493, :gcc_42_build => 5577 },
"3.2.6" => { :gcc_40_build => 5494, :gcc_42_build => 5666, :llvm_build => 2335, :clang => "1.7", :clang_build => 77 },
... | false |
Other | Homebrew | brew | a79bc02620d736b5370adfa4543f2928f165112e.json | MacOS.gcc_build_version: find GCC when unlinked
MacOS.gcc_42_build_version was returning nil if apple-gcc42 was
installed but unlinked, which was disjoint with how other parts of
Homebrew tried to see if it was present. | Library/Homebrew/os/mac.rb | @@ -130,8 +130,15 @@ def gcc_40_build_version
def gcc_42_build_version
@gcc_42_build_version ||=
- if (path = locate("gcc-4.2")) && path.realpath.basename.to_s !~ /^llvm/
- %x{#{path} --version}[/build (\d{4,})/, 1].to_i
+ begin
+ gcc = MacOS.locate('gcc-4.2') || Formula.fa... | false |
Other | Homebrew | brew | 72e9cbdac70f504de1a258cb3c9219709c98a0e9.json | Fix truncation of printed paths in cellar audits | Library/Homebrew/formula_cellar_checks.rb | @@ -51,7 +51,7 @@ def check_jars
install to "libexec" and then symlink or wrap binaries into "bin".
See "activemq", "jruby", etc. for examples.
The offending files are:
- #{jars * "\n"}
+ #{jars * "\n "}
EOS
]
end
@@ -71,7 +71,7 @@ def check_non_librari... | false |
Other | Homebrew | brew | e33c01aab55cf7522596988b09532e941bd3044c.json | libextractor: add runtime dependency on libtool
Fixes Homebrew/homebrew#23306. | Library/Homebrew/cmd/audit.rb | @@ -153,7 +153,7 @@ def audit_deps
when *BUILD_TIME_DEPS
next if dep.build?
next if dep.name == 'autoconf' && f.name =~ /automake/
- next if dep.name == 'libtool' && %w{imagemagick libgphoto2 libp11}.any? { |n| f.name == n }
+ next if dep.name == 'libtool' && %w{imagemagick libgph... | false |
Other | Homebrew | brew | 3b66a7d4fd41947f8c2a472a0dfe7afa840c93cf.json | Improve superenv add/remove message.
* Now it includes all flags that are added or removed by superenv when
passing "--verbose" or envvar VERBOSE or HOMEBREW_VERBOSE is set. | Library/ENV/4.3/cc | @@ -86,7 +86,7 @@ class Cmd
else
args << "-syslibroot" << $sdkroot
end if nclt?
- case mode
+ allflags = case mode
when :ccld
cflags + args + cppflags + ldflags
when :cc
@@ -98,6 +98,8 @@ class Cmd
when :ld
ldflags + args
end.compact
+ make_fuss(allflags) if v... | true |
Other | Homebrew | brew | 3b66a7d4fd41947f8c2a472a0dfe7afa840c93cf.json | Improve superenv add/remove message.
* Now it includes all flags that are added or removed by superenv when
passing "--verbose" or envvar VERBOSE or HOMEBREW_VERBOSE is set. | Library/brew.rb | @@ -58,6 +58,8 @@ def require? path
begin
trap("INT", std_trap) # restore default CTRL-C handler
+ ENV['HOMEBREW_VERBOSE'] = "1" if ARGV.verbose?
+
aliases = {'ls' => 'list',
'homepage' => 'home',
'-S' => 'search', | true |
Other | Homebrew | brew | c511d7d2f43369773940dbb8fb8fbe8ed2153127.json | Add OS.mac? and OS.linux? | Library/Homebrew/extend/ENV/std.rb | @@ -224,7 +224,7 @@ def remove_macosxsdk version=MacOS.version
end
def macosxsdk version=MacOS.version
- return unless MACOS
+ return unless OS.mac?
# Sets all needed lib and include dirs to CFLAGS, CPPFLAGS, LDFLAGS.
remove_macosxsdk
version = version.to_s | true |
Other | Homebrew | brew | c511d7d2f43369773940dbb8fb8fbe8ed2153127.json | Add OS.mac? and OS.linux? | Library/Homebrew/formula_installer.rb | @@ -384,7 +384,7 @@ def finish
link
end
- fix_install_names
+ fix_install_names if OS.mac?
record_cxx_stdlib
| true |
Other | Homebrew | brew | c511d7d2f43369773940dbb8fb8fbe8ed2153127.json | Add OS.mac? and OS.linux? | Library/Homebrew/global.rb | @@ -5,6 +5,7 @@
require 'extend/string'
require 'extend/symbol'
require 'extend/enumerable'
+require 'os'
require 'utils'
require 'exceptions'
require 'set'
@@ -72,11 +73,9 @@ def mkpath
MACOS_FULL_VERSION = `/usr/bin/sw_vers -productVersion`.chomp
MACOS_VERSION = MACOS_FULL_VERSION[/10\.\d+/].to_f
OS_VE... | true |
Other | Homebrew | brew | c511d7d2f43369773940dbb8fb8fbe8ed2153127.json | Add OS.mac? and OS.linux? | Library/Homebrew/hardware.rb | @@ -1,3 +1,5 @@
+require 'os'
+
class Hardware
module CPU extend self
INTEL_32BIT_ARCHS = [:i386].freeze
@@ -30,11 +32,10 @@ def is_64_bit?
end
end
- case RUBY_PLATFORM.downcase
- when /darwin/
+ if OS.mac?
require 'os/mac/hardware'
CPU.extend MacCPUs
- when /linux/
+ elsif OS.linux?
... | true |
Other | Homebrew | brew | c511d7d2f43369773940dbb8fb8fbe8ed2153127.json | Add OS.mac? and OS.linux? | Library/Homebrew/keg_fix_install_names.rb | @@ -1,6 +1,5 @@
class Keg
def fix_install_names options={}
- return unless MACOS
mach_o_files.each do |file|
install_names_for(file, options) do |id, bad_names|
file.ensure_writable do | true |
Other | Homebrew | brew | c511d7d2f43369773940dbb8fb8fbe8ed2153127.json | Add OS.mac? and OS.linux? | Library/Homebrew/macos.rb | @@ -253,7 +253,7 @@ def app_with_bundle_id id
end
def mdfind id
- return [] unless MACOS
+ return [] unless OS.mac?
(@mdfind ||= {}).fetch(id.to_s) do |key|
@mdfind[key] = `/usr/bin/mdfind "kMDItemCFBundleIdentifier == '#{key}'"`.split("\n")
end | true |
Other | Homebrew | brew | c511d7d2f43369773940dbb8fb8fbe8ed2153127.json | Add OS.mac? and OS.linux? | Library/Homebrew/os.rb | @@ -0,0 +1,9 @@
+module OS
+ def self.mac?
+ /darwin/i === RUBY_PLATFORM
+ end
+
+ def self.linux?
+ /linux/i === RUBY_PLATFORM
+ end
+end | true |
Other | Homebrew | brew | c511d7d2f43369773940dbb8fb8fbe8ed2153127.json | Add OS.mac? and OS.linux? | Library/Homebrew/os/mac/xcode.rb | @@ -84,7 +84,7 @@ def uncached_version
# This is a separate function as you can't cache the value out of a block
# if return is used in the middle, which we do many times in here.
- return "0" unless MACOS
+ return "0" unless OS.mac?
# this shortcut makes version work for people who don't reali... | true |
Other | Homebrew | brew | c511d7d2f43369773940dbb8fb8fbe8ed2153127.json | Add OS.mac? and OS.linux? | Library/Homebrew/test/testing_env.rb | @@ -29,7 +29,6 @@
RUBY_BIN = Pathname.new(RbConfig::CONFIG['bindir'])
RUBY_PATH = RUBY_BIN + RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT']
-MACOS = true
MACOS_FULL_VERSION = `/usr/bin/sw_vers -productVersion`.chomp
MACOS_VERSION = ENV.fetch('MACOS_VERSION') { MACOS_FULL_VERSION[/10\.\d+/] }.t... | true |
Other | Homebrew | brew | c511d7d2f43369773940dbb8fb8fbe8ed2153127.json | Add OS.mac? and OS.linux? | Library/brew.rb | @@ -35,7 +35,7 @@
# it may work, but I only see pain this route and don't want to support it
abort "Cowardly refusing to continue at this prefix: #{HOMEBREW_PREFIX}"
end
-if MACOS and MACOS_VERSION < 10.5
+if OS.mac? and MacOS.version < 10.5
abort <<-EOABORT.undent
Homebrew requires Leopard or higher. Fo... | true |
Other | Homebrew | brew | 4d086e839477ea6eee0d8951b908e70975ae4c88.json | add pin/unpin to help
Closes Homebrew/homebrew#23267.
Signed-off-by: Adam Vandenberg <flangy@gmail.com> | Library/Homebrew/cmd/help.rb | @@ -7,6 +7,7 @@
brew list [FORMULA...]
brew update
brew upgrade [FORMULA...]
+ brew pin/unpin [FORMULA...]
Troubleshooting:
brew doctor | false |
Other | Homebrew | brew | e9d608587d83221420653b3559974c87c9247824.json | Remove audit check for XZ
Any formula with a URL that ends in ".xz" now gets this dependency
automatically, so this check no longer does anything. | Library/Homebrew/cmd/audit.rb | @@ -263,10 +263,6 @@ def audit_urls
urls.select { |u| u =~ %r[https://.*/(?:tar|zip)ball/] && u !~ %r[\.git$] }.each do |u|
problem "Use /archive/ URLs for GitHub tarballs (url is #{u})."
end
-
- if urls.any? { |u| u =~ /\.xz/ } && !f.deps.any? { |d| d.name == "xz" }
- problem "Missing a build-... | false |
Other | Homebrew | brew | 3df31557c8a378e8a13d2ce36391a7e1c0152acb.json | Avoid the need to defensively flatten tags array | Library/Homebrew/dependency_collector.rb | @@ -76,7 +76,7 @@ def parse_string_spec(spec, tags)
elsif (tag = tags.first) && LANGUAGE_MODULES.include?(tag)
# Next line only for legacy support of `depends_on 'module' => :python`
# It should be replaced by `depends_on :python => 'module'`
- return PythonDependency.new("2", spec) if tag == :p... | true |
Other | Homebrew | brew | 3df31557c8a378e8a13d2ce36391a7e1c0152acb.json | Avoid the need to defensively flatten tags array | Library/Homebrew/requirements/python_dependency.rb | @@ -34,7 +34,6 @@ def minor
end
def initialize(default_version="2.6", tags=[])
- tags = [tags].flatten
# Extract the min_version if given. Default to default_version else
if /(\d+\.)*\d+/ === tags.first.to_s
@min_version = PythonVersion.new(tags.shift) | true |
Other | Homebrew | brew | 5ae32d5a793c00fb3f52c3c19f4469feab4aaf2f.json | Remove pointless assertion | Library/Homebrew/test/test_cleaner.rb | @@ -22,7 +22,8 @@ def test_clean_file
f = CleanerTestBall.new
shutup { f.brew { f.install } }
- assert_nothing_raised { Cleaner.new f }
+ Cleaner.new f
+
assert_equal 0100555, (f.bin/'a.out').stat.mode
assert_equal 0100444, (f.lib/'fat.dylib').stat.mode
assert_equal 0100444, (f.lib/'x86... | false |
Other | Homebrew | brew | 4f3decd528ed0e1d1cffb79893e320d1d7563b07.json | brew-test-bot: fix fetch options spacing. | Library/Contributions/cmd/brew-test-bot.rb | @@ -264,10 +264,10 @@ def formula formula
end
test "brew fetch #{dependencies}" unless dependencies.empty?
- formula_fetch_options = ""
+ formula_fetch_options = " "
formula_fetch_options << " --build-bottle" unless ARGV.include? '--no-bottle'
formula_fetch_options << " --force" if ARGV.incl... | false |
Other | Homebrew | brew | cf2a8913c57621b8b3e109d55016e26e4f92066c.json | git_etc: create etc if it doesn't exist. | Library/Homebrew/formula_installer.rb | @@ -94,11 +94,11 @@ def git_etc_preinstall
def git_etc_postinstall
return unless quiet_system 'git', '--version'
- etc = HOMEBREW_PREFIX+'etc'
preinstall_branch = "#{f.name}-preinstall"
default_branch = "#{f.name}-default"
merged = false
- etc.cd do
+ f.etc.mkpath
+ f.etc.cd do
... | false |
Other | Homebrew | brew | 28a20b70fc6874e6b3329e729bd199816281ed4a.json | icu4c: add bottle regex. | Library/Homebrew/bottle_version.rb | @@ -8,7 +8,8 @@ def self._parse spec
return m.captures.first unless m.nil?
# e.g. ssh-copy-id-6.2p2.bottle.tar.gz
- m = /(\d\.(\d)+(p(\d)+)?)/.match(stem)
+ # e.g. icu4c-52.1.bottle.tar.gz
+ m = /(\d+\.(\d)+(p(\d)+)?)/.match(stem)
return m.captures.first unless m.nil?
super | true |
Other | Homebrew | brew | 28a20b70fc6874e6b3329e729bd199816281ed4a.json | icu4c: add bottle regex. | Library/Homebrew/test/test_bottle_versions.rb | @@ -15,4 +15,9 @@ def test_ssh_copy_id_style
assert_version_detected '6.2p2',
'/usr/local/ssh-copy-id-6.2p2.mountain_lion.bottle.tar.gz'
end
+
+ def test_icu4c_style
+ assert_version_detected '52.1',
+ '/usr/local/icu4c-52.1.bottle.tar.gz'
+ end
end | true |
Other | Homebrew | brew | 3f0a409ec5dff27e516faf0a282f76be99187b99.json | GitDownloadStrategy: remove redundant use of nostdout | Library/Homebrew/download_strategy.rb | @@ -530,7 +530,7 @@ def checkout_args
end
def checkout
- nostdout { quiet_safe_system 'git', *checkout_args }
+ quiet_safe_system 'git', *checkout_args
end
def reset_args | false |
Other | Homebrew | brew | 932091f9e0881ebbc26df08d98544298af1a6116.json | VCSDownloadStrategy: pull construction of @clone into superclass | Library/Homebrew/download_strategy.rb | @@ -42,20 +42,25 @@ class VCSDownloadStrategy < AbstractDownloadStrategy
def initialize name, resource
super
@ref_type, @ref = destructure_spec_hash(resource.specs)
+ @clone = HOMEBREW_CACHE/cache_filename
end
def destructure_spec_hash(spec)
spec.each { |o| return o }
end
- def cache_... | false |
Other | Homebrew | brew | dd719e7ca62cb52d749614f1fde663bf1ac1bf14.json | Move cached_location up to VCSDownloadStrategy | Library/Homebrew/download_strategy.rb | @@ -55,6 +55,10 @@ def checkout_name(tag)
"#{name}--#{tag}"
end
end
+
+ def cached_location
+ @clone
+ end
end
class CurlDownloadStrategy < AbstractDownloadStrategy
@@ -323,10 +327,6 @@ def initialize name, resource
end
end
- def cached_location
- @clone
- end
-
def repo_valid?... | false |
Other | Homebrew | brew | 4a9cf0dd14bdcf08edbe0c1b2e180b08cb570c5b.json | CxxStdlib: use f.recursive_dependencies in stdlib check | Library/Homebrew/formula_installer.rb | @@ -186,7 +186,7 @@ def install
# This is probably accurate, but could possibly stand to be
# more robust.
stdlib_in_use = CxxStdlib.new(MacOS.default_cxx_stdlib, MacOS.default_compiler)
- stdlib_in_use.check_dependencies(f, effective_deps)
+ stdlib_in_use.check_dependencies(f, f.recursiv... | false |
Other | Homebrew | brew | 9c84b3799a4af58873eb41d92cb97fe288c7d333.json | formula_installer: pass effective_deps to CxxStdlib | Library/Homebrew/formula_installer.rb | @@ -186,7 +186,7 @@ def install
# This is probably accurate, but could possibly stand to be
# more robust.
stdlib_in_use = CxxStdlib.new(MacOS.default_cxx_stdlib, MacOS.default_compiler)
- stdlib_in_use.check_dependencies(f, f.deps)
+ stdlib_in_use.check_dependencies(f, effective_deps)
... | false |
Other | Homebrew | brew | a9764503b29a754762bfbfb4d4759a321cd29af1.json | formula_installer: handle etc/var in bottles.
Copy these files/folders to a .bottle directory under the Cellar for installation
elsewhere at pouring time.
Temporarily disable HOMEBREW_GIT_ETC methods until fixed. | Library/Homebrew/formula_installer.rb | @@ -9,6 +9,7 @@
require 'caveats'
require 'cleaner'
require 'formula_cellar_checks'
+require 'install_renamed'
class FormulaInstaller
include FormulaCellarChecks
@@ -124,6 +125,18 @@ def git_etc_postinstall
end
end
+ def build_bottle_preinstall
+ @etc_var_glob ||= "#{HOMEBREW_PREFIX}/{etc,var}/**... | false |
Other | Homebrew | brew | af4247429b7b1352592bca28238d8bb61194454a.json | formula: add bottle_prefix method. | Library/Homebrew/formula.rb | @@ -178,6 +178,9 @@ def var; HOMEBREW_PREFIX+'var' end
def bash_completion; prefix+'etc/bash_completion.d' end
def zsh_completion; share+'zsh/site-functions' end
+ # for storing etc, var files for later copying from bottles
+ def bottle_prefix; prefix+'.bottle' end
+
# override this to provide a plist... | false |
Other | Homebrew | brew | 4a2fc89c4699f3c5e4ad93f9d7c26698c4a0c989.json | S3DownloadStrategy: use temporary_path accessor | Library/Homebrew/download_strategy.rb | @@ -307,7 +307,7 @@ def _fetch
s3url = obj.public_url
end
- curl s3url, '-C', downloaded_size, '-o', @temporary_path
+ curl s3url, '-C', downloaded_size, '-o', temporary_path
end
end
| false |
Other | Homebrew | brew | 3cda2158817c8d0f62dcc659388de12d834c067c.json | VCSDownloadStrategy: destructure spec hash more efficiently | Library/Homebrew/download_strategy.rb | @@ -49,8 +49,11 @@ def cached_location; end
class VCSDownloadStrategy < AbstractDownloadStrategy
def initialize name, resource
super
- specs = resource.specs
- @ref_type, @ref = specs.dup.shift unless specs.empty?
+ @ref_type, @ref = destructure_spec_hash(resource.specs)
+ end
+
+ def destructure_sp... | false |
Other | Homebrew | brew | e27574b27bf6ce11ce0dc5a139c09b228c672480.json | SubversionDownloadStrategy: stop mutating revisions hash | Library/Homebrew/download_strategy.rb | @@ -336,7 +336,7 @@ def fetch
fetch_repo @co, @url, @ref
when :revisions
# nil is OK for main_revision, as fetch_repo will then get latest
- main_revision = @ref.delete :trunk
+ main_revision = @ref[:trunk]
fetch_repo @co, @url, main_revision, true
get_externals do |external... | false |
Other | Homebrew | brew | 88e5c4c333c72238e4e93116fdecf45194310539.json | brew-test-bot: remove escape characters. | Library/Contributions/cmd/brew-test-bot.rb | @@ -411,8 +411,8 @@ def run
testcase.attributes['time'] = step.time
failure = testcase.add_element 'failure' if step.failed?
if step.has_output?
- # Remove null characters from step output.
- output = REXML::CData.new step.output.delete("\000")
+ # Remove invalid XML CData char... | false |
Other | Homebrew | brew | 9bd507b7be9effd0f373d2ae39401530d922c20b.json | Remove unused variable | Library/Homebrew/cmd/doctor.rb | @@ -419,14 +419,12 @@ def check_xcode_select_path
def check_user_path_1
$seen_prefix_bin = false
$seen_prefix_sbin = false
- seen_usr_bin = false
out = nil
paths.each do |p|
case p
when '/usr/bin'
- seen_usr_bin = true
unless $seen_prefix_bin
# only show the doctor messa... | false |
Other | Homebrew | brew | 051061827cbcbcf26f77b01efa41347bde3933fa.json | Remove outdated comment | Library/Homebrew/cmd/doctor.rb | @@ -1021,10 +1021,6 @@ def check_for_unlinked_but_not_keg_only
end
end.map{ |pn| pn.basename }
- # NOTE very old kegs will be linked without the LinkedKegs symlink
- # this will trigger this warning but it's wrong, we could detect that though
- # but I don't feel like writing the code.
-
if not unlinked... | false |
Other | Homebrew | brew | 424187fc15e3d0dd0cab8795a98f2b16a87c7a31.json | Prefer interpolation to concatenation | Library/Homebrew/cmd/doctor.rb | @@ -954,7 +954,7 @@ def check_for_bad_python_symlink
end
def check_for_non_prefixed_coreutils
- gnubin = Formula.factory('coreutils').prefix.to_s + "/libexec/gnubin"
+ gnubin = "#{Formula.factory('coreutils').prefix}/libexec/gnubin"
if paths.include? gnubin then <<-EOS.undent
Putting non-prefixed coreutil... | false |
Other | Homebrew | brew | 01901314e9303ddb40b391d7fab781c5de032371.json | brew-test-bot: use REXML to write JUnit file. | Library/Contributions/cmd/brew-test-bot.rb | @@ -15,7 +15,9 @@
require 'formula'
require 'utils'
require 'date'
-require 'erb'
+require 'rexml/document'
+require 'rexml/xmldecl'
+require 'rexml/cdata'
EMAIL_SUBJECT_FILE = "brew-test-bot.#{MacOS.cat}.email.txt"
HOMEBREW_CONTRIBUTED_CMDS = HOMEBREW_REPOSITORY + "Library/Contributions/cmd/"
@@ -395,11 +397,36... | true |
Other | Homebrew | brew | 01901314e9303ddb40b391d7fab781c5de032371.json | brew-test-bot: use REXML to write JUnit file. | Library/Contributions/cmd/brew-test-bot.xml.erb | @@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<testsuites>
- <% tests.each do |test| %>
- <testsuite name="brew-test-bot.<%= MacOS.cat %>" tests="<%= test.steps.count %>">
- <% test.steps.each do |step| %>
- <testcase name="<%= step.command_short %>" status="<%= step.status %>" time="<%= step.time %... | true |
Other | Homebrew | brew | fe31e8ddb4803c3e549af936b7f7b30b754660db.json | Use MacOS.locate to find otool
Fixes Homebrew/homebrew#23111. | Library/Homebrew/extend/pathname.rb | @@ -396,7 +396,7 @@ def install_metafiles from=nil
# Returns an empty array both for software that links against no libraries,
# and for non-mach objects.
def dynamically_linked_libraries
- `otool -L "#{expand_path}"`.chomp.split("\n")[1..-1].map do |line|
+ `#{MacOS.locate("otool")} -L "#{expand_path}"`... | false |
Other | Homebrew | brew | d5ac2deefbc0b8f39f30c6fa47f8aa31ca50e247.json | Tab#cxxstdlib: remove default stdlib
Fixes Homebrew/homebrew#23089. | Library/Homebrew/tab.rb | @@ -97,7 +97,7 @@ def options
def cxxstdlib
# Older tabs won't have these values, so provide sensible defaults
- lib = stdlib || :libstdcxx
+ lib = stdlib
cc = compiler || MacOS.default_compiler
CxxStdlib.new(lib.to_sym, cc.to_sym)
end | false |
Other | Homebrew | brew | fb929f429f06131635b73c58a28175ec01d1306b.json | Fix typo in Keg#fixed_name invocation
Closes Homebrew/homebrew#23079.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/keg_fix_install_names.rb | @@ -7,7 +7,7 @@ def fix_install_names options={}
install_name_tool("-id", id, file) if file.dylib?
bad_names.each do |bad_name|
- new_name = fixed_name(file, bad_name, options)
+ new_name = fixed_name(file, bad_name)
unless new_name == bad_name
i... | false |
Other | Homebrew | brew | 50c7c6bbd6eac0dfb1d3c48e7d0ee49e667b315c.json | Check types in Formula#==
Comparing two objects should not raise an exception, even if they have
different types.
The semantics of #== are now the same as #eql?, so make one an alias. | Library/Homebrew/formula.rb | @@ -292,12 +292,11 @@ def unpin
@pin.unpin
end
- def == b
- name == b.name
- end
- def eql? b
- self == b and self.class.equal? b.class
+ def == other
+ instance_of?(other.class) && name == other.name
end
+ alias_method :eql?, :==
+
def hash
name.hash
end | true |
Other | Homebrew | brew | 50c7c6bbd6eac0dfb1d3c48e7d0ee49e667b315c.json | Check types in Formula#==
Comparing two objects should not raise an exception, even if they have
different types.
The semantics of #== are now the same as #eql?, so make one an alias. | Library/Homebrew/test/test_formula.rb | @@ -124,6 +124,10 @@ def test_inequality
assert !y.eql?(x)
end
+ def test_comparison_with_non_formula_objects_does_not_raise
+ assert_not_equal TestBall.new, Object.new
+ end
+
def test_class_naming
assert_equal 'ShellFm', Formula.class_s('shell.fm')
assert_equal 'Fooxx', Formula.class_s('fo... | true |
Other | Homebrew | brew | 5b0e0c257064c44dc4e59ef6b2b7b5d9cbe12d5e.json | config: squelch stderr when invoking git | Library/Homebrew/cmd/--config.rb | @@ -56,7 +56,7 @@ def head
def origin
origin = HOMEBREW_REPOSITORY.cd do
- `git config --get remote.origin.url`.chomp
+ `git config --get remote.origin.url 2>/dev/null`.chomp
end
if origin.empty? then "(none)" else origin end
end | false |
Other | Homebrew | brew | e887232b7ec991e451e7dfc7ee23d6d91c023958.json | MacOS: remove unnecessary begin block | Library/Homebrew/macos.rb | @@ -77,16 +77,14 @@ def xctoolchain_path
def sdk_path(v = version)
(@sdk_path ||= {}).fetch(v.to_s) do
- @sdk_path[v.to_s] = begin
- opts = []
- # First query Xcode itself
- opts << `#{locate('xcodebuild')} -version -sdk macosx#{v} Path 2>/dev/null`.chomp unless Xcode.bad_xcode_selec... | false |
Other | Homebrew | brew | 535c02674ca9a3841b7a90c65350b23ac3c07da3.json | Add Xcode 5.0.1.
Closes Homebrew/homebrew#23040. | Library/Homebrew/macos.rb | @@ -227,6 +227,7 @@ def preferred_arch
"4.6.2" => { :llvm_build => 2336, :clang => "4.2", :clang_build => 425 },
"4.6.3" => { :llvm_build => 2336, :clang => "4.2", :clang_build => 425 },
"5.0" => { :clang => "5.0", :clang_build => 500 },
+ "5.0.1" => { :clang => "5.0", :clang_build => 500 },
}
... | true |
Other | Homebrew | brew | 535c02674ca9a3841b7a90c65350b23ac3c07da3.json | Add Xcode 5.0.1.
Closes Homebrew/homebrew#23040. | Library/Homebrew/os/mac/xcode.rb | @@ -28,7 +28,7 @@ def latest_version
else
# Default to newest known version of Xcode for unreleased OSX versions.
if MacOS.version > 10.9
- "5.0"
+ "5.0.1"
else
raise "Mac OS X '#{MacOS.version}' is invalid"
end | true |
Other | Homebrew | brew | b35d9906e5d9bdf580701b18304561ffbf36dcb8.json | Pass the mktemp prefix as an argument | Library/Homebrew/extend/fileutils.rb | @@ -5,15 +5,7 @@ module FileUtils extend self
# Create a temporary directory then yield. When the block returns,
# recursively delete the temporary directory.
- def mktemp
- # Prefer download_name if it is defined, for two reasons:
- # - The name attribute may be nil for resources that represent primary... | true |
Other | Homebrew | brew | b35d9906e5d9bdf580701b18304561ffbf36dcb8.json | Pass the mktemp prefix as an argument | Library/Homebrew/resource.rb | @@ -50,7 +50,7 @@ def cached_download
def stage(target=nil)
fetched = fetch
verify_download_integrity(fetched) if fetched.respond_to?(:file?) and fetched.file?
- mktemp do
+ mktemp(download_name) do
downloader.stage
if block_given?
yield self | true |
Other | Homebrew | brew | 02a0e4e2e08e66ccb28fdb84b45edd9612fdc2dd.json | Fix mktemp directory naming | Library/Homebrew/extend/fileutils.rb | @@ -6,6 +6,14 @@ module FileUtils extend self
# Create a temporary directory then yield. When the block returns,
# recursively delete the temporary directory.
def mktemp
+ # Prefer download_name if it is defined, for two reasons:
+ # - The name attribute may be nil for resources that represent primary
+... | false |
Other | Homebrew | brew | 57560c03e64cb11a33287b3194b0c35cbea6e159.json | Handle invalid names in download strategies
When subformulae are initialized without a name parameter, Homebrew
assigns the name "__UNKNOWN__". This may cause collisions in the cache.
Currently CurlDownloadStrategy and its descendants handles this by
extracting the basename form the URL and using that as the cached
f... | Library/Homebrew/download_strategy.rb | @@ -1,5 +1,6 @@
require 'open-uri'
require 'utils/json'
+require 'erb'
class AbstractDownloadStrategy
attr_reader :name, :resource
@@ -33,6 +34,14 @@ def quiet_safe_system *args
safe_system(*expand_safe_system_args(args))
end
+ def checkout_name(tag)
+ if name.empty? || name == '__UNKNOWN__'
+ ... | true |
Other | Homebrew | brew | 57560c03e64cb11a33287b3194b0c35cbea6e159.json | Handle invalid names in download strategies
When subformulae are initialized without a name parameter, Homebrew
assigns the name "__UNKNOWN__". This may cause collisions in the cache.
Currently CurlDownloadStrategy and its descendants handles this by
extracting the basename form the URL and using that as the cached
f... | Library/Homebrew/test/test_download_strategies.rb | @@ -2,7 +2,7 @@
require 'download_strategy'
require 'bottles' # XXX: hoist these regexps into constants in Pathname?
-class SoftwareSpecDouble
+class ResourceDouble
attr_reader :url, :specs
def initialize(url="http://foo.com/bar.tar.gz", specs={})
@@ -14,8 +14,8 @@ def initialize(url="http://foo.com/bar.tar... | true |
Other | Homebrew | brew | 48dde74503d61b6b9702aea0705202635124d93b.json | Move ld64 into SharedEnvExtension
Superenv is being tested on Xcode 3.1.4, so this needs to be supported
in both ENVs, not just stdenv. | Library/Homebrew/extend/ENV/shared.rb | @@ -170,6 +170,13 @@ def fortran
set_cpu_flags(flags)
end
+ # ld64 is a newer linker provided for Xcode 2.5
+ def ld64
+ ld64 = Formula.factory('ld64')
+ self['LD'] = ld64.bin/'ld'
+ append "LDFLAGS", "-B#{ld64.bin.to_s+"/"}"
+ end
+
def warn_about_non_apple_gcc(gcc)
opoo "Experimental sup... | true |
Other | Homebrew | brew | 48dde74503d61b6b9702aea0705202635124d93b.json | Move ld64 into SharedEnvExtension
Superenv is being tested on Xcode 3.1.4, so this needs to be supported
in both ENVs, not just stdenv. | Library/Homebrew/extend/ENV/std.rb | @@ -366,11 +366,4 @@ def make_jobs
Hardware::CPU.cores
end
end
-
- # ld64 is a newer linker provided for Xcode 2.5
- def ld64
- ld64 = Formula.factory('ld64')
- self['LD'] = ld64.bin/'ld'
- append "LDFLAGS", "-B#{ld64.bin.to_s+"/"}"
- end
end | true |
Other | Homebrew | brew | a380265e90e36a6a9e60123f300bdc4094318b98.json | BazaarDownloadStrategy: handle corrupt checkouts | Library/Homebrew/download_strategy.rb | @@ -695,18 +695,31 @@ def bzrpath
].find { |p| File.executable? p }
end
+ def repo_valid?
+ @clone.join(".bzr").directory?
+ end
+
def fetch
ohai "Cloning #{@url}"
- unless @clone.exist?
- url=@url.sub(%r[^bzr://], '')
- # 'lightweight' means history-less
- safe_system bzrpath... | false |
Other | Homebrew | brew | da2efa46aaf4600e5c4e1fbfa83f0973dbac55e3.json | SubversionDownloadStrategy: handle corrupt checkouts | Library/Homebrew/download_strategy.rb | @@ -311,9 +311,19 @@ def cached_location
@co
end
+ def repo_valid?
+ @co.join(".svn").directory?
+ end
+
def fetch
@url.sub!(/^svn\+/, '') if @url =~ %r[^svn\+http://]
ohai "Checking out #{@url}"
+
+ if @co.exist? and not repo_valid?
+ puts "Removing invalid SVN repo from cache"
+ ... | false |
Other | Homebrew | brew | 7deb2f85e82c43f6927f8e89f8f81fb10ddbecef.json | MercurialDownloadStrategy: handle corrupt checkouts | Library/Homebrew/download_strategy.rb | @@ -631,18 +631,30 @@ def hgpath
def fetch
ohai "Cloning #{@url}"
- unless @clone.exist?
- url=@url.sub(%r[^hg://], '')
- safe_system hgpath, 'clone', url, @clone
- else
+ if @clone.exist? && repo_valid?
puts "Updating #{@clone}"
- Dir.chdir(@clone) do
+ @clone.cd do
... | false |
Other | Homebrew | brew | 29d204c697ff2a554a4767657884d72a85ff9ff5.json | Adjust CompilerSelectionError message | Library/Homebrew/exceptions.rb | @@ -213,20 +213,11 @@ def dump
# raised by CompilerSelector if the formula fails with all of
# the compilers available on the user's system
class CompilerSelectionError < StandardError
- def message
- if MacOS.version > :tiger then <<-EOS.undent
- This formula cannot be built with any available compilers.
-... | false |
Other | Homebrew | brew | cb32f76f271f20a14685580a7be0cb0c72c0aec6.json | SoftwareSpec: remove dead code | Library/Homebrew/software_spec.rb | @@ -67,7 +67,6 @@ def requirements
class HeadSoftwareSpec < SoftwareSpec
def initialize
super
- @resource.url = url
@resource.version = Version.new('HEAD')
end
| false |
Other | Homebrew | brew | 5c973bad7422cf7f335e952a91ddfa2273aa2e4f.json | pod2man: add ENV wrapper.
Closes Homebrew/homebrew#22528. | Library/ENV/4.3/pod2man | @@ -0,0 +1,3 @@
+#!/bin/bash
+POD2MAN=$(/usr/bin/which pod2man5.12 || echo /usr/bin/pod2man)
+exec $POD2MAN "$@" | false |
Other | Homebrew | brew | 72d13106361c1dda00ea520638080b80cdefad43.json | brew-pull/test-bot: use stricter formula match. | Library/Contributions/cmd/brew-pull.rb | @@ -78,7 +78,7 @@ def tap arg
`git diff #{revision}.. --name-status`.each_line do |line|
status, filename = line.split
# Don't try and do anything to removed files.
- if (status == 'A' or status == 'M') and filename.include? '/Formula/' or tap url
+ if (status == 'A' or status == 'M') and f... | true |
Other | Homebrew | brew | 72d13106361c1dda00ea520638080b80cdefad43.json | brew-pull/test-bot: use stricter formula match. | Library/Contributions/cmd/brew-test-bot.rb | @@ -230,7 +230,7 @@ def single_commit? start_revision, end_revision
status, filename = line.split
# Don't try and do anything to removed files.
if (status == 'A' or status == 'M')
- if filename.include? '/Formula/'
+ if filename.match /Formula\/\w+\.rb$/
@formulae << File.b... | true |
Other | Homebrew | brew | e4b6fc5ae0b8eab8022084f8b4e02cfb825048a8.json | Bottle: set version from stable spec. | Library/Homebrew/formula.rb | @@ -698,6 +698,7 @@ def bottle *, &block
return @bottle unless block_given?
@bottle ||= create_spec(Bottle)
@bottle.instance_eval(&block)
+ @bottle.version = @stable.version
end
def devel &block | true |
Other | Homebrew | brew | e4b6fc5ae0b8eab8022084f8b4e02cfb825048a8.json | Bottle: set version from stable spec. | Library/Homebrew/software_spec.rb | @@ -79,7 +79,7 @@ def verify_download_integrity fn
class Bottle < SoftwareSpec
attr_rw :root_url, :prefix, :cellar, :revision
- def_delegators :@resource, :url=
+ def_delegators :@resource, :version=, :url=
def initialize
super | true |
Other | Homebrew | brew | 8d0c8fd978506edb5cdca8c68e8e948087428fab.json | update: handle realpath exception. | Library/Homebrew/cmd/update.rb | @@ -20,7 +20,7 @@ def update
tapped_formulae = Dir['Library/Formula/*'].map do |formula|
path = Pathname.new formula
next unless path.symlink?
- Pathname.new(path.realpath.to_s.gsub(/.*Taps\//, ''))
+ Pathname.new(path.realpath.to_s.gsub(/.*Taps\//, '')) rescue nil
end
tapped_form... | false |
Other | Homebrew | brew | b20335b314f45d25e9c9f96a20575d7336cef1cb.json | bottle: add option to force no bottle revision. | Library/Homebrew/cmd/bottle.rb | @@ -64,7 +64,8 @@ def bottle_formula f
begin
bottle_revision += 1
filename = bottle_filename(f, bottle_revision)
- end while master_bottle_filenames.include? filename
+ end while not ARGV.include? '--no-revision' \
+ and master_bottle_filenames.include? filename
if bottle_filename... | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.