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 | 3de941f7c80192998424ebd19617db574ce09518.json | bottle: fix default Cellar output. | Library/Homebrew/cmd/bottle.rb | @@ -21,7 +21,7 @@ def self.reset_bottle; @bottle = Bottle.new; end
<% end %>
<% if cellar.is_a? Symbol %>
cellar :<%= cellar %>
- <% elsif cellar.to_s != '/usr/local' %>
+ <% elsif cellar.to_s != '/usr/local/Cellar' %>
cellar '<%= cellar %>'
<% end %>
<% if revision > 0 %> | false |
Other | Homebrew | brew | 134210d9ed0d5eec6f70ae999b50ef4d3dae6a1c.json | bottle: allow writing/committing new bottles. | Library/Homebrew/cmd/bottle.rb | @@ -3,6 +3,7 @@
require 'tab'
require 'keg'
require 'cmd/versions'
+require 'utils/inreplace'
require 'erb'
class BottleMerger < Formula
@@ -34,6 +35,10 @@ def self.reset_bottle; @bottle = Bottle.new; end
EOS
module Homebrew extend self
+ class << self
+ include Utils::Inreplace
+ end
+
def keg_conta... | false |
Other | Homebrew | brew | 5d0f868f060c086cc53c81ef6a63ac93e24ae1b4.json | Move bottle.rb logic from test-bot to brew bottle. | Library/Contributions/cmd/brew-test-bot.rb | @@ -53,7 +53,7 @@ def status_upcase
end
def command_short
- @command.gsub(/(brew|--force|--verbose|--build-bottle) /, '').strip.squeeze ' '
+ @command.gsub(/(brew|--force|--verbose|--build-bottle|--rb) /, '').strip.squeeze ' '
end
def passed?
@@ -276,16 +276,11 @@ def formula formula
test "br... | true |
Other | Homebrew | brew | 5d0f868f060c086cc53c81ef6a63ac93e24ae1b4.json | Move bottle.rb logic from test-bot to brew bottle. | Library/Homebrew/bottles.rb | @@ -50,11 +50,6 @@ def bottle_file_outdated? f, file
bottle_ext && bottle_url_ext && bottle_ext != bottle_url_ext
end
-def bottle_new_revision f
- return 0 unless bottle_current? f
- f.bottle.revision + 1
-end
-
def bottle_native_suffix revision=nil
".#{bottle_tag}#{bottle_suffix(revision)}"
end | true |
Other | Homebrew | brew | 5d0f868f060c086cc53c81ef6a63ac93e24ae1b4.json | Move bottle.rb logic from test-bot to brew bottle. | Library/Homebrew/cmd/bottle.rb | @@ -114,6 +114,13 @@ def bottle_formula f
output = bottle_output bottle
puts output
end
+
+ if ARGV.include? '--rb'
+ bottle_base = filename.gsub(bottle_suffix(bottle_revision), '')
+ File.open "#{bottle_base}.bottle.rb", 'w' do |file|
+ file.write output
+ end
+ end
en... | true |
Other | Homebrew | brew | fd34bd6b9029d905edc0bf044ab891ccb804e8e8.json | bottle: move bottle output to ERB. | Library/Homebrew/cmd/bottle.rb | @@ -3,6 +3,7 @@
require 'tab'
require 'keg'
require 'cmd/versions'
+require 'erb'
class BottleMerger < Formula
# This provides a URL and Version which are the only needed properties of
@@ -12,34 +13,34 @@ class BottleMerger < Formula
def self.reset_bottle; @bottle = Bottle.new; end
end
+BOTTLE_ERB = <<-E... | false |
Other | Homebrew | brew | 5de0b4964a730591a9f948906d0499bcee214c27.json | SoftwareSpec: add method for bottle checksums. | Library/Homebrew/software_spec.rb | @@ -103,4 +103,20 @@ def #{cksum}(val=nil)
end
EOS
end
+
+ def checksums
+ checksums = {}
+ Checksum::TYPES.each do |checksum_type|
+ checksum_os_versions = send checksum_type
+ next unless checksum_os_versions
+ os_versions = checksum_os_versions.keys
+ os_versions.map! {|osx|... | false |
Other | Homebrew | brew | 19618bddd441afa0cfb55366902107bd144c1756.json | bottle: use versions to access previous bottles. | Library/Homebrew/cmd/bottle.rb | @@ -2,6 +2,7 @@
require 'bottles'
require 'tab'
require 'keg'
+require 'cmd/versions'
class BottleMerger < Formula
# This provides a URL and Version which are the only needed properties of
@@ -50,8 +51,12 @@ def bottle_formula f
return ofail "Formula not installed with '--build-bottle': #{f.name}"
... | false |
Other | Homebrew | brew | c8832868407cad5156f20f09237e4db989314622.json | versions: use bottle_filename only if f.bottle. | Library/Homebrew/cmd/versions.rb | @@ -39,7 +39,7 @@ def versions
def bottle_filenames branch='HEAD'
filenames = []
rev_list(branch).each do |sha|
- filename = formula_for_sha(sha) {|f| bottle_filename f }
+ filename = formula_for_sha(sha) {|f| bottle_filename f if f.bottle }
unless filenames.include? filename or filename.n... | false |
Other | Homebrew | brew | 82eee276e3cbd5ace72606273484022e69390334.json | versions: add bottle filenames method.
Closes Homebrew/homebrew#22727. | Library/Homebrew/cmd/versions.rb | @@ -36,6 +36,17 @@ def versions
return versions
end
+ def bottle_filenames branch='HEAD'
+ filenames = []
+ rev_list(branch).each do |sha|
+ filename = formula_for_sha(sha) {|f| bottle_filename f }
+ unless filenames.include? filename or filename.nil?
+ filenames << filename
+ end... | false |
Other | Homebrew | brew | 22e47ffa435fdacc12b7c5b65f64dfba36998201.json | versions: add branch support in rev_list. | Library/Homebrew/cmd/versions.rb | @@ -61,9 +61,9 @@ def entry_name
end
end
- def rev_list
+ def rev_list branch='HEAD'
repository.cd do
- `git rev-list --abbrev-commit HEAD -- #{entry_name}`.split
+ `git rev-list --abbrev-commit #{branch} -- #{entry_name}`.split
end
end
| false |
Other | Homebrew | brew | 5511a8b3f528445a79ae04138698e43620400640.json | Move dependencies to SoftwareSpec | Library/Homebrew/formula.rb | @@ -1,4 +1,3 @@
-require 'dependency_collector'
require 'formula_support'
require 'formula_lock'
require 'formula_pin'
@@ -105,6 +104,14 @@ def resources
active_spec.resources.values
end
+ def deps
+ active_spec.deps
+ end
+
+ def requirements
+ active_spec.requirements
+ end
+
# if the dir is... | true |
Other | Homebrew | brew | 5511a8b3f528445a79ae04138698e43620400640.json | Move dependencies to SoftwareSpec | Library/Homebrew/software_spec.rb | @@ -3,11 +3,13 @@
require 'checksum'
require 'version'
require 'build_options'
+require 'dependency_collector'
class SoftwareSpec
extend Forwardable
attr_reader :build, :resources, :owner
+ attr_reader :dependency_collector
def_delegators :@resource, :stage, :fetch
def_delegators :@resource, :dow... | true |
Other | Homebrew | brew | 5511a8b3f528445a79ae04138698e43620400640.json | Move dependencies to SoftwareSpec | Library/Homebrew/test/test_formula.rb | @@ -208,25 +208,4 @@ def initialize(*args)
ensure
path.unlink
end
-
- def test_dependency_option_integration
- f = formula do
- url 'foo-1.0'
- depends_on 'foo' => :optional
- depends_on 'bar' => :recommended
- end
-
- assert f.build.has_option?('with-foo')
- assert f.build.has_op... | true |
Other | Homebrew | brew | 5511a8b3f528445a79ae04138698e43620400640.json | Move dependencies to SoftwareSpec | Library/Homebrew/test/test_software_spec.rb | @@ -47,6 +47,24 @@ def test_option_accepts_symbols
@spec.option(:foo)
assert @spec.build.has_option? 'foo'
end
+
+ def test_depends_on
+ @spec.depends_on('foo')
+ assert_equal 'foo', @spec.deps.first.name
+ end
+
+ def test_dependency_option_integration
+ @spec.depends_on 'foo' => :optional
+ ... | true |
Other | Homebrew | brew | a8d3aca169c7d6d83790ff52eb5cd973b54446e7.json | Move options to SoftwareSpec | Library/Homebrew/formula.rb | @@ -17,7 +17,7 @@ class Formula
include Utils::Inreplace
extend BuildEnvironmentDSL
- attr_reader :name, :path, :homepage, :downloader
+ attr_reader :name, :path, :homepage, :downloader, :build
attr_reader :stable, :bottle, :devel, :head, :active_spec
# The current working directory during builds and ... | true |
Other | Homebrew | brew | a8d3aca169c7d6d83790ff52eb5cd973b54446e7.json | Move options to SoftwareSpec | Library/Homebrew/software_spec.rb | @@ -2,11 +2,12 @@
require 'resource'
require 'checksum'
require 'version'
+require 'build_options'
class SoftwareSpec
extend Forwardable
- attr_reader :resources, :owner
+ attr_reader :build, :resources, :owner
def_delegators :@resource, :stage, :fetch
def_delegators :@resource, :download_strategy,... | true |
Other | Homebrew | brew | a8d3aca169c7d6d83790ff52eb5cd973b54446e7.json | Move options to SoftwareSpec | Library/Homebrew/test/test_software_spec.rb | @@ -29,6 +29,24 @@ def test_resource_owner
@spec.owner = owner
@spec.resources.each_value { |r| assert_equal owner, r.owner }
end
+
+ def test_option
+ @spec.option('foo')
+ assert @spec.build.has_option? 'foo'
+ end
+
+ def test_option_raises_when_begins_with_dashes
+ assert_raises(RuntimeErro... | true |
Other | Homebrew | brew | 5d3d385a656d55166775b1ec66e68ec72b2a46dd.json | bottle: improve outputted messages. | Library/Homebrew/cmd/bottle.rb | @@ -65,13 +65,14 @@ def bottle_formula f
tmp_cellar = '/tmp/Cellar'
HOMEBREW_CELLAR.cd do
- ohai "Bottling #{f.name} #{f.version}..."
+ ohai "Bottling #{filename}..."
# Use gzip, faster to compress than bzip2, faster to uncompress than bzip2
# or an uncompressed tarball (and more ban... | false |
Other | Homebrew | brew | a7e1dbae63ee62e7900dc7fbb3f67ea5c435a0a4.json | Bottles: use options hash for install_bottle? | Library/Homebrew/bottles.rb | @@ -3,16 +3,14 @@
require 'extend/ARGV'
require 'bottle_version'
-# TODO: use options={} for some arguments.
-
def bottle_filename f, bottle_revision=nil
name = f.name.downcase
version = f.stable.version
bottle_revision ||= f.bottle.revision.to_i if f.bottle
"#{name}-#{version}#{bottle_native_suffix(bo... | true |
Other | Homebrew | brew | a7e1dbae63ee62e7900dc7fbb3f67ea5c435a0a4.json | Bottles: use options hash for install_bottle? | Library/Homebrew/formula_installer.rb | @@ -30,8 +30,9 @@ def initialize ff
check_install_sanity
end
- def pour_bottle? warn=false
- tab.used_options.empty? && options.empty? && install_bottle?(f, warn)
+ def pour_bottle? install_bottle_options={:warn=>false}
+ tab.used_options.empty? && options.empty? && \
+ install_bottle?(f, install... | true |
Other | Homebrew | brew | 50d2f632d9157c953dcbaeb33c5b79ef50fee38a.json | Allow partial installation of resources | Library/Homebrew/extend/pathname.rb | @@ -1,5 +1,6 @@
require 'pathname'
require 'mach'
+require 'resource'
# we enhance pathname to make our code more readable
class Pathname
@@ -12,6 +13,8 @@ def install *sources
case src
when Resource
src.stage(self)
+ when Resource::Partial
+ src.resource.stage { install(*src.fi... | true |
Other | Homebrew | brew | 50d2f632d9157c953dcbaeb33c5b79ef50fee38a.json | Allow partial installation of resources | Library/Homebrew/resource.rb | @@ -62,6 +62,12 @@ def stage(target=nil)
end
end
+ Partial = Struct.new(:resource, :files)
+
+ def files(*files)
+ Partial.new(self, files)
+ end
+
# For brew-fetch and others.
def fetch
# Ensure the cache exists | true |
Other | Homebrew | brew | 28cb9978ee6d9b4bcabb9b9b238c98da52411da0.json | create: use resource for checksum detection | Library/Homebrew/cmd/create.rb | @@ -102,10 +102,11 @@ def generate!
puts "You'll need to add an explicit 'version' to the formula."
end
+ # XXX: why is "and version" here?
unless ARGV.include? "--no-fetch" and version
- spec = SoftwareSpec.new(url, version)
- strategy = spec.download_strategy
- @sha1 = strategy.ne... | false |
Other | Homebrew | brew | 6116450328307530d6d25a3fa5b9c34e2a055f1f.json | Move formula resources to SoftwareSpec | Library/Homebrew/formula.rb | @@ -1,4 +1,3 @@
-require 'resource'
require 'dependency_collector'
require 'formula_support'
require 'formula_lock'
@@ -57,9 +56,6 @@ def initialize name='__UNKNOWN__', path=nil
end
@pin = FormulaPin.new(self)
-
- @resources = self.class.resources
- @resources.each_value { |r| r.owner = self }
e... | true |
Other | Homebrew | brew | 6116450328307530d6d25a3fa5b9c34e2a055f1f.json | Move formula resources to SoftwareSpec | Library/Homebrew/resource.rb | @@ -18,14 +18,15 @@ class Resource
# XXX: for bottles, address this later
attr_writer :url, :checksum
- def initialize name, url=nil, version=nil
+ def initialize name, url=nil, version=nil, &block
@name = name
@url = url
@version = version
@mirrors = []
@specs = {}
@checksum = n... | true |
Other | Homebrew | brew | 6116450328307530d6d25a3fa5b9c34e2a055f1f.json | Move formula resources to SoftwareSpec | Library/Homebrew/software_spec.rb | @@ -6,14 +6,30 @@
class SoftwareSpec
extend Forwardable
- def_delegators :@resource, :owner=
+ attr_reader :resources, :owner
+
def_delegators :@resource, :stage, :fetch
def_delegators :@resource, :download_strategy, :verify_download_integrity
def_delegators :@resource, :checksum, :mirrors, :specs, :us... | true |
Other | Homebrew | brew | df537528c7730e9a6d791b86ed529547fdf48496.json | Reimplement SoftwareSpec on top of Resource | Library/Homebrew/compat/md5.rb | @@ -1,11 +1,17 @@
class Formula
def self.md5(val)
- @stable ||= SoftwareSpec.new
+ @stable ||= create_spec(SoftwareSpec)
@stable.md5(val)
end
end
class SoftwareSpec
+ def md5(val)
+ @resource.md5(val)
+ end
+end
+
+class Resource
def md5(val)
@checksum = Checksum.new(:md5, val)
end | true |
Other | Homebrew | brew | df537528c7730e9a6d791b86ed529547fdf48496.json | Reimplement SoftwareSpec on top of Resource | Library/Homebrew/formula.rb | @@ -1,5 +1,4 @@
require 'resource'
-require 'download_strategy'
require 'dependency_collector'
require 'formula_support'
require 'formula_lock'
@@ -49,7 +48,7 @@ def initialize name='__UNKNOWN__', path=nil
@active_spec = determine_active_spec
validate_attributes :url, :name, :version
- @downloader = ... | true |
Other | Homebrew | brew | df537528c7730e9a6d791b86ed529547fdf48496.json | Reimplement SoftwareSpec on top of Resource | Library/Homebrew/resource.rb | @@ -2,32 +2,35 @@
require 'checksum'
require 'version'
-# A Resource describes a tarball that a formula needs in addition
-# to the formula's own download.
+# Resource is the fundamental representation of an external resource. The
+# primary formula download, along with other declared resources, are instances
+# of... | true |
Other | Homebrew | brew | df537528c7730e9a6d791b86ed529547fdf48496.json | Reimplement SoftwareSpec on top of Resource | Library/Homebrew/software_spec.rb | @@ -1,69 +1,19 @@
-require 'download_strategy'
+require 'forwardable'
+require 'resource'
require 'checksum'
require 'version'
class SoftwareSpec
- attr_reader :checksum, :mirrors, :specs, :using
+ extend Forwardable
- def initialize url=nil, version=nil
- @url = url
- @version = version
- @mirrors =... | true |
Other | Homebrew | brew | 32315c93480edea8cdf02c97876ffca6b1d99b32.json | Combine attr declarations | Library/Homebrew/software_spec.rb | @@ -3,8 +3,7 @@
require 'version'
class SoftwareSpec
- attr_reader :checksum, :mirrors, :specs
- attr_reader :using # for auditing
+ attr_reader :checksum, :mirrors, :specs, :using
def initialize url=nil, version=nil
@url = url | false |
Other | Homebrew | brew | 1ae81f0bf70d7fe0b39cc05ae53b51514a9d3435.json | Move CompilerSelector logic into build env setup
This moves the CompilerSelector fails_with logic into the build
environment setup, making the compiler selection available before
performing actions that depends on knowing what the compiler is, e.g.
setting up PATH.
ENV.setup_build_environment now optionally takes a F... | Library/Homebrew/build.rb | @@ -120,12 +120,12 @@ def install
ENV.keg_only_deps = keg_only_deps.map(&:to_s)
ENV.deps = deps.map { |d| d.to_formula.to_s }
ENV.x11 = reqs.any? { |rq| rq.kind_of?(X11Dependency) }
- ENV.setup_build_environment
+ ENV.setup_build_environment(f)
post_superenv_hacks
reqs.each(... | true |
Other | Homebrew | brew | 1ae81f0bf70d7fe0b39cc05ae53b51514a9d3435.json | Move CompilerSelector logic into build env setup
This moves the CompilerSelector fails_with logic into the build
environment setup, making the compiler selection available before
performing actions that depends on knowing what the compiler is, e.g.
setting up PATH.
ENV.setup_build_environment now optionally takes a F... | Library/Homebrew/extend/ENV/shared.rb | @@ -111,6 +111,19 @@ def compiler
end
end
+ # If the given compiler isn't compatible, will try to select
+ # an alternate compiler, altering the value of environment variables.
+ # If no valid compiler is found, raises an exception.
+ def validate_cc!(formula)
+ if formula.fails_with? ENV.compiler
+ ... | true |
Other | Homebrew | brew | 1ae81f0bf70d7fe0b39cc05ae53b51514a9d3435.json | Move CompilerSelector logic into build env setup
This moves the CompilerSelector fails_with logic into the build
environment setup, making the compiler selection available before
performing actions that depends on knowing what the compiler is, e.g.
setting up PATH.
ENV.setup_build_environment now optionally takes a F... | Library/Homebrew/extend/ENV/std.rb | @@ -14,7 +14,7 @@ def self.extended(base)
end
end
- def setup_build_environment
+ def setup_build_environment(formula=nil)
# Clear CDPATH to avoid make issues that depend on changing directories
delete('CDPATH')
delete('GREP_OPTIONS') # can break CMake (lol)
@@ -68,8 +68,13 @@ def setup_build... | true |
Other | Homebrew | brew | 1ae81f0bf70d7fe0b39cc05ae53b51514a9d3435.json | Move CompilerSelector logic into build env setup
This moves the CompilerSelector fails_with logic into the build
environment setup, making the compiler selection available before
performing actions that depends on knowing what the compiler is, e.g.
setting up PATH.
ENV.setup_build_environment now optionally takes a F... | Library/Homebrew/extend/ENV/super.rb | @@ -54,16 +54,18 @@ def reset
delete('CLICOLOR_FORCE') # autotools doesn't like this
end
- def setup_build_environment
+ def setup_build_environment(formula=nil)
reset
+
self.cc = 'cc'
self.cxx = 'c++'
+ self['HOMEBREW_CC'] = determine_cc
+ validate_cc!(formula) unless formula.nil?
... | true |
Other | Homebrew | brew | 91e6c993f868a648d57d9666e9855198686003e3.json | inreplace: Open the file as binary
Closes Homebrew/homebrew#22628.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/utils/inreplace.rb | @@ -2,7 +2,7 @@ module Utils
module Inreplace
def inreplace paths, before=nil, after=nil
Array(paths).each do |path|
- f = File.open(path, 'r')
+ f = File.open(path, 'rb')
s = f.read
if before.nil? && after.nil?
@@ -17,7 +17,7 @@ def inreplace paths, before=nil, after=ni... | false |
Other | Homebrew | brew | 907ac79606537189a0a7c822be1210c4d4801df3.json | make linkapps official | Library/Contributions/cmd/brew-linkapps.rb | @@ -1,31 +0,0 @@
-# Links any Applications (.app) found in installed prefixes to /Applications
-require 'keg'
-
-TARGET_DIR = ARGV.include?("--local") ? File.expand_path("~/Applications") : "/Applications"
-
-unless File.exist? TARGET_DIR
- opoo "#{TARGET_DIR} does not exist, stopping."
- puts "Run `mkdir #{TARGET_DI... | true |
Other | Homebrew | brew | 907ac79606537189a0a7c822be1210c4d4801df3.json | make linkapps official | Library/Homebrew/cmd/linkapps.rb | @@ -0,0 +1,36 @@
+# Links any Applications (.app) found in installed prefixes to /Applications
+require 'keg'
+
+module Homebrew extend self
+
+ def linkapps
+ target_dir = ARGV.include?("--local") ? File.expand_path("~/Applications") : "/Applications"
+
+ unless File.exist? target_dir
+ opoo "#{target_dir}... | true |
Other | Homebrew | brew | a126946a9be8a1915ce516a674ffe4663583f691.json | move paths to utils | Library/Homebrew/cmd/commands.rb | @@ -1,14 +1,4 @@
module Homebrew extend self
- def paths
- @paths ||= ENV['PATH'].split(File::PATH_SEPARATOR).collect do |p|
- begin
- File.expand_path(p).chomp('/')
- rescue ArgumentError
- onoe "The following PATH component is invalid: #{p}"
- end
- end.uniq.compact
- end
-
de... | true |
Other | Homebrew | brew | a126946a9be8a1915ce516a674ffe4663583f691.json | move paths to utils | Library/Homebrew/cmd/doctor.rb | @@ -41,16 +41,6 @@ def get_mounts path=nil
class Checks
############# HELPERS
- def paths
- @paths ||= ENV['PATH'].split(File::PATH_SEPARATOR).collect do |p|
- begin
- File.expand_path(p).chomp('/')
- rescue ArgumentError
- onoe "The following PATH component is invalid: #{p}"
- end
... | true |
Other | Homebrew | brew | a126946a9be8a1915ce516a674ffe4663583f691.json | move paths to utils | Library/Homebrew/utils.rb | @@ -238,6 +238,16 @@ def nostdout
end
end
+def paths
+ @paths ||= ENV['PATH'].split(File::PATH_SEPARATOR).collect do |p|
+ begin
+ File.expand_path(p).chomp('/')
+ rescue ArgumentError
+ onoe "The following PATH component is invalid: #{p}"
+ end
+ end.uniq.compact
+end
+
module GitHub extend... | true |
Other | Homebrew | brew | a31fcb554c1c1ca247bf10073a8c2425afe19a82.json | Move SoftwareSpec to a separate file | Library/Homebrew/formula.rb | @@ -11,6 +11,7 @@
require 'build_environment'
require 'build_options'
require 'formulary'
+require 'software_spec'
class Formula | true |
Other | Homebrew | brew | a31fcb554c1c1ca247bf10073a8c2425afe19a82.json | Move SoftwareSpec to a separate file | Library/Homebrew/formula_support.rb | @@ -1,118 +1,5 @@
-require 'download_strategy'
-require 'checksum'
-require 'version'
-
FormulaConflict = Struct.new(:name, :reason)
-class SoftwareSpec
- attr_reader :checksum, :mirrors, :specs
- attr_reader :using # for auditing
-
- def initialize url=nil, version=nil
- @url = url
- @version = version
- ... | true |
Other | Homebrew | brew | a31fcb554c1c1ca247bf10073a8c2425afe19a82.json | Move SoftwareSpec to a separate file | Library/Homebrew/software_spec.rb | @@ -0,0 +1,111 @@
+require 'download_strategy'
+require 'checksum'
+require 'version'
+
+class SoftwareSpec
+ attr_reader :checksum, :mirrors, :specs
+ attr_reader :using # for auditing
+
+ def initialize url=nil, version=nil
+ @url = url
+ @version = version
+ @mirrors = []
+ @specs = {}
+ @checksum ... | true |
Other | Homebrew | brew | a31fcb554c1c1ca247bf10073a8c2425afe19a82.json | Move SoftwareSpec to a separate file | Library/Homebrew/test/test_software_spec.rb | @@ -1,5 +1,5 @@
require 'testing_env'
-require 'formula_support'
+require 'software_spec'
require 'bottles'
class SoftwareSpecTests < Test::Unit::TestCase | true |
Other | Homebrew | brew | 16cb25e422021eeb1f78c82b6c41a7c45ce718c4.json | brew-test-bot: use OSX name for test prefix. | Library/Contributions/cmd/brew-test-bot.xml.erb | @@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<% tests.each do |test| %>
- <testsuite name="brew-test-bot.<%= test.name %>" tests="<%= test.steps.count %>">
+ <testsuite name="brew-test-bot.<%= MacOS.cat %>" tests="<%= test.steps.count %>">
<% test.steps.each do |step| %>
<testcas... | false |
Other | Homebrew | brew | 5d03149d816b66ae4375636d8182e99c2b320628.json | brew-test-bot: use Jenkins variables when no args.
Otherwise specifying arguments means that you can't effectively build just a single commit or pull request as Jenkins will try and override the start commit. | Library/Contributions/cmd/brew-test-bot.rb | @@ -165,7 +165,7 @@ def single_commit? start_revision, end_revision
@start_branch = current_branch
# Use Jenkins environment variables if present.
- if ENV['GIT_PREVIOUS_COMMIT'] and ENV['GIT_COMMIT'] \
+ if no_args? and ENV['GIT_PREVIOUS_COMMIT'] and ENV['GIT_COMMIT'] \
and not ENV['ghprbPull... | false |
Other | Homebrew | brew | 7535ba3be475674748f588cf21d2feea2951dff4.json | brew-test-bot: pull no args check into a method. | Library/Contributions/cmd/brew-test-bot.rb | @@ -134,6 +134,10 @@ def initialize argument
FileUtils.mkdir_p @brewbot_root
end
+ def no_args?
+ @hash == 'HEAD'
+ end
+
def git arguments
Dir.chdir HOMEBREW_REPOSITORY do
`git #{arguments}`
@@ -186,7 +190,7 @@ def single_commit? start_revision, end_revision
end
end
- if ... | false |
Other | Homebrew | brew | 7804d2d5f3f0250b7f6d693476791be5bb0e597c.json | Remove unused attr | Library/Homebrew/resource.rb | @@ -7,9 +7,6 @@ class Resource
# This is the resource name
attr_reader :name
- # This is the associated formula name
- attr_reader :owner_name
-
def initialize name, spec
@name = name
@spec = spec | false |
Other | Homebrew | brew | 809fc87da02749435da3ffd843691b38f2169811.json | Allow resource fetching
Closes Homebrew/homebrew#20047. | Library/Homebrew/cmd/fetch.rb | @@ -16,14 +16,36 @@ def fetch
end
puts "Fetching: #{bucket * ', '}" if bucket.size > 1
- bucket.each { |f| fetch_formula(f) }
+ bucket.each do |f|
+ fetch_formula(f)
+ f.resources.each do |r|
+ fetch_resource(r)
+ end
+ end
end
def already_fetched? f
f.cached_down... | false |
Other | Homebrew | brew | 4c55082e7c0bcf0c6bb2b1401286fda466ad3248.json | update: restore previous state when interrupted
Fixes Homebrew/homebrew#19460.
Closes Homebrew/homebrew#22375. | Library/Homebrew/cmd/update.rb | @@ -86,11 +86,19 @@ def pull!
# the refspec ensures that 'origin/master' gets updated
args << "refs/heads/master:refs/remotes/origin/master"
- safe_system "git", *args
+ reset_on_interrupt { safe_system "git", *args }
@current_revision = read_current_revision
end
+ def reset_on_interrupt
... | false |
Other | Homebrew | brew | 0b958ed607705993dc83ca0738a90ad9d12cc8c2.json | Add audit to zsh tab completion
Closes Homebrew/homebrew#22339.
Signed-off-by: Adam Vandenberg <flangy@gmail.com> | Library/Contributions/brew_zsh_completion.zsh | @@ -24,6 +24,7 @@ _brew_outdated_formulae() {
local -a _1st_arguments
_1st_arguments=(
+ 'audit:check formulae for Homebrew coding style'
'cat:display formula file for a formula'
'cleanup:uninstall unused and old versions of packages'
'create:create a new formula'
@@ -88,7 +89,7 @@ case "$words[1]" in
... | false |
Other | Homebrew | brew | 3a0204dd0b1e31f1ebfb34224e1ffb2d3ca84b8d.json | git-etc: add removed files too. | Library/Homebrew/formula_installer.rb | @@ -78,7 +78,7 @@ def git_etc_preinstall
etc.cd do
quiet_system 'git', 'init' unless (etc+'.git').directory?
quiet_system 'git', 'checkout', '-B', "#{f.name}-last"
- system 'git', 'add', '.'
+ system 'git', 'add', '--all', '.'
system 'git', 'commit', '-m', "#{f.name}-#{f.version}: pr... | false |
Other | Homebrew | brew | 4489a8684f258c6a56d3e44397fae15bc6784ddb.json | Rewrite conditions in more natural way | Library/Homebrew/formula_installer.rb | @@ -39,7 +39,7 @@ def check_install_sanity
if f.installed?
msg = "#{f}-#{f.installed_version} already installed"
- msg << ", it's just not linked" if not f.linked_keg.symlink? and not f.keg_only?
+ msg << ", it's just not linked" unless f.linked_keg.symlink? or f.keg_only?
raise FormulaAl... | false |
Other | Homebrew | brew | 45d5471a43798cfb51ecbd41691b6302f7d70549.json | Enable verbose compile command in create template.
* Add "--disable-silent-rules" option to autotools-based configure
options.
- Also add comments to notify user removing unrecognized configure
options.
* Add "-DCMAKE_VERBOSE_MAKEFILE=ON" to cmake-based configure options. | Library/Homebrew/cmd/create.rb | @@ -139,10 +139,16 @@ def install
<% if mode == :cmake %>
system "cmake", ".", *std_cmake_args
<% elsif mode == :autotools %>
- system "./configure", "--disable-debug", "--disable-dependency-tracking",
+ # Remove unrecognized options if warned by configure
+ system "./configure",... | true |
Other | Homebrew | brew | 45d5471a43798cfb51ecbd41691b6302f7d70549.json | Enable verbose compile command in create template.
* Add "--disable-silent-rules" option to autotools-based configure
options.
- Also add comments to notify user removing unrecognized configure
options.
* Add "-DCMAKE_VERBOSE_MAKEFILE=ON" to cmake-based configure options. | Library/Homebrew/formula.rb | @@ -308,6 +308,7 @@ def std_cmake_args
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_BUILD_TYPE=None
-DCMAKE_FIND_FRAMEWORK=LAST
+ -DCMAKE_VERBOSE_MAKEFILE=ON
-Wno-dev
]
end | true |
Other | Homebrew | brew | 6d7cda77e9a0724b9098b21b630fd0ada4561ae8.json | ENV: remove trailing slash from OpenGL header path | Library/Homebrew/extend/ENV/super.rb | @@ -176,7 +176,7 @@ def determine_cmake_include_path
paths << "#{MacOS::X11.include}/freetype2" if x11?
paths << "#{sdk}/usr/include/libxml2" unless deps.include? 'libxml2'
paths << "#{sdk}/usr/include/apache2" if MacOS::Xcode.without_clt?
- paths << "#{sdk}/System/Library/Frameworks/OpenGL.framework/... | false |
Other | Homebrew | brew | 59a0c1e1b5604ab198e9694df030cd855b5ccbd6.json | Improve python tests for brew bots
Allow `build.with?` and similar methods to be used during the test
phase. The BuildOptions (`build`) are initialized with the
`Tab.used_options` unless explicitly overwritten on the command line.
So basically `build.with?` works in `def install` and in `test do` as
one would naively... | Library/Homebrew/build_options.rb | @@ -100,13 +100,26 @@ def unused_options
# implicit_options are needed because `depends_on 'spam' => 'with-stuff'`
# complains if 'spam' has stuff as default and only defines `--without-stuff`.
def implicit_options
- implicit = unused_options.map do |o|
- if o.name =~ /^with-(.+)$/ && without?($1)
- ... | true |
Other | Homebrew | brew | 59a0c1e1b5604ab198e9694df030cd855b5ccbd6.json | Improve python tests for brew bots
Allow `build.with?` and similar methods to be used during the test
phase. The BuildOptions (`build`) are initialized with the
`Tab.used_options` unless explicitly overwritten on the command line.
So basically `build.with?` works in `def install` and in `test do` as
one would naively... | Library/Homebrew/formula.rb | @@ -515,6 +515,9 @@ def verify_download_integrity fn
def test
require 'test/unit/assertions'
extend(Test::Unit::Assertions)
+ # Adding the used options allows us to use `build.with?` inside of tests
+ tab = Tab.for_name(name)
+ tab.used_options.each { |opt| build.args << opt unless build.has_oppos... | true |
Other | Homebrew | brew | 59a0c1e1b5604ab198e9694df030cd855b5ccbd6.json | Improve python tests for brew bots
Allow `build.with?` and similar methods to be used during the test
phase. The BuildOptions (`build`) are initialized with the
`Tab.used_options` unless explicitly overwritten on the command line.
So basically `build.with?` works in `def install` and in `test do` as
one would naively... | Library/Homebrew/python_helper.rb | @@ -16,11 +16,11 @@
def python_helper(options={:allowed_major_versions => [2, 3]}, &block)
if !block_given? and !@current_python.nil?
# We are already inside of a `python do ... end` block, so just return
- # the current_python or false if the version.major is not allowed.
+ # the current_python or nil i... | true |
Other | Homebrew | brew | 59a0c1e1b5604ab198e9694df030cd855b5ccbd6.json | Improve python tests for brew bots
Allow `build.with?` and similar methods to be used during the test
phase. The BuildOptions (`build`) are initialized with the
`Tab.used_options` unless explicitly overwritten on the command line.
So basically `build.with?` works in `def install` and in `test do` as
one would naively... | Library/Homebrew/test/test_build_options.rb | @@ -1,9 +1,9 @@
-require 'testing_env'
+ require 'testing_env'
require 'build_options'
class BuildOptionsTests < Test::Unit::TestCase
def setup
- args = %w{--with-foo --with-bar --without-qux}
+ args = %w{--with-foo --with-bar --without-qux} # args fake the command line
@build = BuildOptions.new(args... | true |
Other | Homebrew | brew | e278135156dc318b55dd4095d271d92c66bc8638.json | SUPPORTERS: add new link. | SUPPORTERS.md | @@ -139,7 +139,7 @@ These awesome people supported our Kickstarter by giving us £50 or more:
* Nick Zadrozny
* Mikael Roos
* Stephen Eckenrode
-* Kevin Sumner
+* [Kevin Sumner](http://kevinsumner.com)
* Rahul
* [Nothing Interactive](http://www.nothing.ch)
* [Nick Sivo](http://nicksivo.com) | false |
Other | Homebrew | brew | 7e079fc37db703da48efff9e6d2f3ab3f1178f0c.json | ENV: convert values to strings in cc setters | Library/Homebrew/extend/ENV/shared.rb | @@ -64,11 +64,11 @@ def remove keys, value
end
def cc= val
- self['CC'] = self['OBJC'] = val
+ self['CC'] = self['OBJC'] = val.to_s
end
def cxx= val
- self['CXX'] = self['OBJCXX'] = val
+ self['CXX'] = self['OBJCXX'] = val.to_s
end
def cc; self['CC']; end | false |
Other | Homebrew | brew | 922a4f1b778eb7a0acb03d78f2d0c758f5f6e6e1.json | Formula: record full path to non-core formula
If a formula is passed with a relative path, the build process might
try to expand it in the wrong directory, where it doesn't exist.
Fixes Homebrew/homebrew#22266. | Library/Homebrew/formula.rb | @@ -28,7 +28,7 @@ class Formula
def initialize name='__UNKNOWN__', path=nil
@name = name
# If we got an explicit path, use that, else determine from the name
- @path = path.nil? ? self.class.path(name) : Pathname.new(path)
+ @path = path.nil? ? self.class.path(name) : Pathname.new(path).expand_path
... | false |
Other | Homebrew | brew | 7c3d6ea81c23d4c2c9daf4c9d97e75e6ac6320a5.json | Check dependencies for a compatible C++ stdlib
There are now a few possible C++ standard libraries a given build could
be using, with subtle incompatibilities and possibility of breakage
when mixed. This makes sure that the dependency chain was compiled in
a compatible manner.
Fortunately all of the Apple compilers u... | Library/Homebrew/build.rb | @@ -13,6 +13,7 @@
end
require 'global'
+require 'cxxstdlib'
require 'debrew' if ARGV.debug?
def main
@@ -148,6 +149,14 @@ def install
end
end
+ # We only support libstdc++ right now
+ stdlib_in_use = CxxStdlib.new(:libstdcxx, ENV.compiler)
+
+ # This is a bad place for this check, but we ... | true |
Other | Homebrew | brew | 7c3d6ea81c23d4c2c9daf4c9d97e75e6ac6320a5.json | Check dependencies for a compatible C++ stdlib
There are now a few possible C++ standard libraries a given build could
be using, with subtle incompatibilities and possibility of breakage
when mixed. This makes sure that the dependency chain was compiled in
a compatible manner.
Fortunately all of the Apple compilers u... | Library/Homebrew/exceptions.rb | @@ -112,6 +112,21 @@ def initialize formula, reqs
end
end
+class IncompatibleCxxStdlibs < Homebrew::InstallationError
+ def initialize(f, dep, wrong, right)
+ super f, <<-EOS.undent
+ #{f} dependency #{dep} was built with the following
+ C++ standard library: #{wrong.type_string} (from #{wrong.compiler}... | true |
Other | Homebrew | brew | 7c3d6ea81c23d4c2c9daf4c9d97e75e6ac6320a5.json | Check dependencies for a compatible C++ stdlib
There are now a few possible C++ standard libraries a given build could
be using, with subtle incompatibilities and possibility of breakage
when mixed. This makes sure that the dependency chain was compiled in
a compatible manner.
Fortunately all of the Apple compilers u... | Library/Homebrew/formula_installer.rb | @@ -1,5 +1,6 @@
# encoding: UTF-8
+require 'cxxstdlib'
require 'exceptions'
require 'formula'
require 'keg'
@@ -94,6 +95,17 @@ def install
raise "Unrecognized architecture for --bottle-arch: #{arch}"
end
+ if pour_bottle? true
+ # TODO We currently only support building with libstdc++ as
+ ... | true |
Other | Homebrew | brew | 3ac74331a86d031179c3e25fe46bcb9f292dacc1.json | Move Tab creation into build process
The parent process doesn't have access to the selected compiler, which
will be important in the next commit.
Fortunately the child process already has a filtered and massaged
ARGV, so it has enough information to build the tab itself. | Library/Homebrew/build.rb | @@ -170,6 +170,7 @@ def install
begin
f.install
+ Tab.create(f, Options.coerce(ARGV.options_only)).write
rescue Exception => e
if ARGV.debug?
debrew e, f | true |
Other | Homebrew | brew | 3ac74331a86d031179c3e25fe46bcb9f292dacc1.json | Move Tab creation into build process
The parent process doesn't have access to the selected compiler, which
will be important in the next commit.
Fortunately the child process already has a filtered and massaged
ARGV, so it has enough information to build the tab itself. | Library/Homebrew/formula_installer.rb | @@ -355,8 +355,6 @@ def build
raise "Empty installation" if Dir["#{f.prefix}/*"].empty?
- Tab.create(f, build_argv).write # INSTALL_RECEIPT.json
-
rescue Exception
ignore_interrupts do
# any exceptions must leave us with nothing installed | true |
Other | Homebrew | brew | ef1d9c0cd04c21b5b19cae17e83bbdc6ef28d712.json | Implement fails_with for non-Apple compilers
This adds support for non-Apple GCC compilers in the fails_with code.
A fails_with block for a non-Apple compiler looks like:
fails_with :gcc => '4.8.1' do
cause 'Foo'
end
Non-Apple compilers don't have build numbers, so compiler failures are
based on version strings in... | Library/Homebrew/compilers.rb | @@ -2,16 +2,28 @@ class Compiler < Struct.new(:name, :priority)
def build
MacOS.send("#{name}_build_version")
end
+
+ def version
+ MacOS.non_apple_gcc_version(name) if name.is_a? String
+ end
end
class CompilerFailure
- attr_reader :compiler
+ attr_reader :compiler, :version
attr_rw :build, :c... | true |
Other | Homebrew | brew | ef1d9c0cd04c21b5b19cae17e83bbdc6ef28d712.json | Implement fails_with for non-Apple compilers
This adds support for non-Apple GCC compilers in the fails_with code.
A fails_with block for a non-Apple compiler looks like:
fails_with :gcc => '4.8.1' do
cause 'Foo'
end
Non-Apple compilers don't have build numbers, so compiler failures are
based on version strings in... | Library/Homebrew/extend/ENV/std.rb | @@ -167,6 +167,16 @@ def gcc
end
alias_method :gcc_4_2, :gcc
+ GNU_GCC_VERSIONS.each do |n|
+ define_method(:"gcc-4.#{n}") do
+ gcc = "gcc-4.#{n}"
+ self.cc = self['OBJC'] = gcc
+ self.cxx = self['OBJCXX'] = gcc.gsub('c', '+')
+ set_cpu_cflags
+ @compiler = gcc
+ end
+ end
+
... | true |
Other | Homebrew | brew | ef1d9c0cd04c21b5b19cae17e83bbdc6ef28d712.json | Implement fails_with for non-Apple compilers
This adds support for non-Apple GCC compilers in the fails_with code.
A fails_with block for a non-Apple compiler looks like:
fails_with :gcc => '4.8.1' do
cause 'Foo'
end
Non-Apple compilers don't have build numbers, so compiler failures are
based on version strings in... | Library/Homebrew/extend/ENV/super.rb | @@ -266,6 +266,13 @@ def clang
self.cc = self['HOMEBREW_CC'] = "clang"
self.cxx = "clang++"
end
+ GNU_GCC_VERSIONS.each do |n|
+ define_method(:"gcc-4.#{n}") do
+ gcc = "gcc-4.#{n}"
+ self.cc = self['HOMEBREW_CC'] = gcc
+ self.cxx = gcc.gsub('c', '+')
+ end
+ end
def make_jobs
... | true |
Other | Homebrew | brew | ef1d9c0cd04c21b5b19cae17e83bbdc6ef28d712.json | Implement fails_with for non-Apple compilers
This adds support for non-Apple GCC compilers in the fails_with code.
A fails_with block for a non-Apple compiler looks like:
fails_with :gcc => '4.8.1' do
cause 'Foo'
end
Non-Apple compilers don't have build numbers, so compiler failures are
based on version strings in... | Library/Homebrew/formula.rb | @@ -212,7 +212,12 @@ def keg_only_reason
def fails_with? cc
cc = Compiler.new(cc) unless cc.is_a? Compiler
(self.class.cc_failures || []).any? do |failure|
- failure.compiler == cc.name && failure.build >= cc.build
+ if cc.version
+ # non-Apple GCCs don't have builds, just version numbers
... | true |
Other | Homebrew | brew | ef1d9c0cd04c21b5b19cae17e83bbdc6ef28d712.json | Implement fails_with for non-Apple compilers
This adds support for non-Apple GCC compilers in the fails_with code.
A fails_with block for a non-Apple compiler looks like:
fails_with :gcc => '4.8.1' do
cause 'Foo'
end
Non-Apple compilers don't have build numbers, so compiler failures are
based on version strings in... | Library/Homebrew/macos.rb | @@ -151,6 +151,16 @@ def clang_build_version
end
end
+ def non_apple_gcc_version(cc)
+ return unless path = locate(cc)
+
+ ivar = "@#{cc.gsub(/(-|\.)/, '')}_version"
+ return instance_variable_get(ivar) if instance_variable_defined?(ivar)
+
+ `#{path} --version` =~ /gcc-\d.\d \(GCC\) (\d\.\d\.\... | true |
Other | Homebrew | brew | ef1d9c0cd04c21b5b19cae17e83bbdc6ef28d712.json | Implement fails_with for non-Apple compilers
This adds support for non-Apple GCC compilers in the fails_with code.
A fails_with block for a non-Apple compiler looks like:
fails_with :gcc => '4.8.1' do
cause 'Foo'
end
Non-Apple compilers don't have build numbers, so compiler failures are
based on version strings in... | Library/Homebrew/test/test_compiler_selector.rb | @@ -22,16 +22,29 @@ def setup
MacOS.stubs(:gcc_build_version).returns(5666)
MacOS.stubs(:llvm_build_version).returns(2336)
MacOS.stubs(:clang_build_version).returns(425)
+ # Yes, this is ugly - we only want one GCC version to be available.
+ MacOS.send(:alias_method, :old_non_apple_gcc_version, :no... | true |
Other | Homebrew | brew | ef1d9c0cd04c21b5b19cae17e83bbdc6ef28d712.json | Implement fails_with for non-Apple compilers
This adds support for non-Apple GCC compilers in the fails_with code.
A fails_with block for a non-Apple compiler looks like:
fails_with :gcc => '4.8.1' do
cause 'Foo'
end
Non-Apple compilers don't have build numbers, so compiler failures are
based on version strings in... | Library/Homebrew/test/test_fails_with.rb | @@ -3,7 +3,7 @@
class FailsWithTests < Test::Unit::TestCase
class Double < Compiler
- attr_accessor :name, :build
+ attr_accessor :name, :build, :version
end
def assert_fails_with(cc)
@@ -18,10 +18,11 @@ def fails_with(*args, &block)
@f.send(:fails_with, *args, &block)
end
- def build_cc(... | true |
Other | Homebrew | brew | f870d605fac5ac2f1b68f3bfea274242cccedcea.json | formula_installer: handle post_install exceptions.
Warn users and point them to `brew postinstall` (which can provide a
backtrace).
Closes Homebrew/homebrew#21887. | Library/Homebrew/formula_installer.rb | @@ -118,7 +118,11 @@ def install
clean
end
- f.post_install
+ begin
+ f.post_install
+ rescue
+ opoo "#{f.name} post_install failed. Rerun with `brew postinstall #{f.name}`."
+ end
opoo "Nothing was installed to #{f.prefix}" unless f.installed?
end | false |
Other | Homebrew | brew | 626b56f9f6ad913f723b8fef3c5f515b7c4a3817.json | brew-postinstall: add new command.
Runs post-install jobs in case they failed or need rerun for any reason. | Library/Homebrew/cmd/postinstall.rb | @@ -0,0 +1,7 @@
+require 'formula_installer'
+
+module Homebrew extend self
+ def postinstall
+ ARGV.formulae.each {|f| f.post_install }
+ end
+end | false |
Other | Homebrew | brew | dd94518a409ca54fef1e08f4a0be894d53794636.json | Add test for option description rules | Library/Homebrew/test/test_formula.rb | @@ -220,4 +220,14 @@ def test_dependency_option_integration
assert f.build.has_option?('with-foo')
assert f.build.has_option?('without-bar')
end
+
+ def test_explicit_options_override_default_dep_option_description
+ f = formula do
+ url 'foo-1.0'
+ option 'with-foo', 'blah'
+ depends_on... | false |
Other | Homebrew | brew | 6ed24d3877eca5b117924831ae3e3267123e0675.json | Add test for dependency options | Library/Homebrew/test/test_formula.rb | @@ -209,4 +209,15 @@ def initialize(*args)
ensure
path.unlink
end
+
+ def test_dependency_option_integration
+ f = formula do
+ url 'foo-1.0'
+ depends_on 'foo' => :optional
+ depends_on 'bar' => :recommended
+ end
+
+ assert f.build.has_option?('with-foo')
+ assert f.build.has_op... | false |
Other | Homebrew | brew | 8828187b4c7d9b0220875d607fd5ff73d3894b89.json | ENV: use fc accessor | Library/Homebrew/extend/ENV/shared.rb | @@ -120,10 +120,10 @@ def userpaths!
end
def fortran
- if self['FC']
+ if fc
ohai "Building with an alternative Fortran compiler"
puts "This is unsupported."
- self['F77'] ||= self['FC']
+ self['F77'] ||= fc
if ARGV.include? '--default-fortran-flags'
flags_to_set ... | false |
Other | Homebrew | brew | 405ba3df68ce1e03800f67d631b76bbec2b1d14a.json | Fix conditional in ENV.fortran | Library/Homebrew/extend/ENV/shared.rb | @@ -129,7 +129,7 @@ def fortran
flags_to_set = FC_FLAG_VARS.reject { |key| self[key] }
flags_to_set.each {|key| self[key] = cflags}
set_cpu_flags(flags_to_set)
- elsif not self['FCFLAGS'] or self['FFLAGS']
+ elsif values_at(*FC_FLAG_VARS).compact.empty?
opoo <<-EOS.undent
... | false |
Other | Homebrew | brew | 2cb8c443e4bd44ea660657a3159268664f77a173.json | ENV: use cflags setter | Library/Homebrew/extend/ENV/std.rb | @@ -231,11 +231,11 @@ def macosxsdk version=MacOS.version
end
def minimal_optimization
- self['CFLAGS'] = self['CXXFLAGS'] = "-Os #{SAFE_CFLAGS_FLAGS}"
+ set_cflags "-Os #{SAFE_CFLAGS_FLAGS}"
macosxsdk unless MacOS::CLT.installed?
end
def no_optimization
- self['CFLAGS'] = self['CXXFLAGS'] =... | false |
Other | Homebrew | brew | 43bd5d44c26ec72b13c8965f5d29b971bddcff06.json | Remove PATH hack from ENV.fortran | Library/Homebrew/extend/ENV/shared.rb | @@ -112,10 +112,6 @@ def userpaths!
end
def fortran
- # superenv removes these PATHs, but this option needs them
- # TODO fix better, probably by making a super-fc
- self['PATH'] += ":#{HOMEBREW_PREFIX}/bin:/usr/local/bin"
-
if self['FC']
ohai "Building with an alternative Fortran compiler"... | false |
Other | Homebrew | brew | 51d1a8e3c5e1a0119837304c7678a3287eb66a67.json | Use system path for more tools, for Linux compat.
Closes Homebrew/homebrew#22196.
Signed-off-by: Adam Vandenberg <flangy@gmail.com> | Library/Homebrew/cmd/doctor.rb | @@ -660,7 +660,7 @@ def check_for_multiple_volumes
real_cellar = HOMEBREW_CELLAR.realpath
tmp_prefix = ENV['HOMEBREW_TEMP'] || '/tmp'
- tmp = Pathname.new `/usr/bin/mktemp -d #{tmp_prefix}/homebrew-brew-doctor-XXXX`.strip
+ tmp = Pathname.new with_system_path { `mktemp -d #{tmp_prefix}/homebrew-brew-doctor-XX... | true |
Other | Homebrew | brew | 51d1a8e3c5e1a0119837304c7678a3287eb66a67.json | Use system path for more tools, for Linux compat.
Closes Homebrew/homebrew#22196.
Signed-off-by: Adam Vandenberg <flangy@gmail.com> | Library/Homebrew/formula.rb | @@ -612,8 +612,8 @@ def patch
ohai "Patching"
patch_list.each do |p|
case p.compression
- when :gzip then safe_system "/usr/bin/gunzip", p.compressed_filename
- when :bzip2 then safe_system "/usr/bin/bunzip2", p.compressed_filename
+ when :gzip then with_system_path { safe_syste... | true |
Other | Homebrew | brew | 51d1a8e3c5e1a0119837304c7678a3287eb66a67.json | Use system path for more tools, for Linux compat.
Closes Homebrew/homebrew#22196.
Signed-off-by: Adam Vandenberg <flangy@gmail.com> | Library/Homebrew/utils.rb | @@ -203,7 +203,7 @@ def safe_exec cmd, *args
# GZips the given paths, and returns the gzipped paths
def gzip *paths
paths.collect do |path|
- system "/usr/bin/gzip", path
+ with_system_path { safe_system 'gzip', path }
Pathname.new("#{path}.gz")
end
end | true |
Other | Homebrew | brew | fb50be432a3231af65af4fa2a70c122f93d55c66.json | Remove default values from ENV.{cc,cxx}
Closes Homebrew/homebrew#22138. | Library/Homebrew/extend/ENV/shared.rb | @@ -53,8 +53,8 @@ def remove keys, value
end if value
end
- def cc; self['CC'] or "cc"; end
- def cxx; self['CXX'] or "c++"; end
+ def cc; self['CC']; end
+ def cxx; self['CXX']; end
def cflags; self['CFLAGS']; end
def cxxflags; self['CXXFLAGS']; ... | false |
Other | Homebrew | brew | c58d707158c365dd9c185b72f5a0003cad25a786.json | Allow building bottles with custom architectures
This allows overriding the "oldest CPU" behaviour - for instance, to
build Intel bottles for a newer CPU than Core 2, to build a PPC bottle
with or without Altivec on the same computer, etc. | Library/ENV/4.3/cc | @@ -157,7 +157,10 @@ class Cmd
args = %w{-pipe -w -Os}
# When bottling use the oldest supported CPU type.
- if cccfg? 'bi6'
+ if cccfg? 'bc'
+ # Custom bottle specified during the build
+ args << ENV['HOMEBREW_ARCHFLAGS']
+ elsif cccfg? 'bi6'
args << '-march=core2'
elsif cccfg... | true |
Other | Homebrew | brew | c58d707158c365dd9c185b72f5a0003cad25a786.json | Allow building bottles with custom architectures
This allows overriding the "oldest CPU" behaviour - for instance, to
build Intel bottles for a newer CPU than Core 2, to build a PPC bottle
with or without Altivec on the same computer, etc. | Library/Homebrew/extend/ARGV.rb | @@ -133,6 +133,11 @@ def build_bottle?
include? '--build-bottle' or !ENV['HOMEBREW_BUILD_BOTTLE'].nil?
end
+ def bottle_arch
+ arch = value 'bottle-arch'
+ arch.to_sym if arch
+ end
+
def build_from_source?
include? '--build-from-source' or !ENV['HOMEBREW_BUILD_FROM_SOURCE'].nil? \
or b... | true |
Other | Homebrew | brew | c58d707158c365dd9c185b72f5a0003cad25a786.json | Allow building bottles with custom architectures
This allows overriding the "oldest CPU" behaviour - for instance, to
build Intel bottles for a newer CPU than Core 2, to build a PPC bottle
with or without Altivec on the same computer, etc. | Library/Homebrew/extend/ENV/std.rb | @@ -324,7 +324,8 @@ def set_cpu_flags flags, default=DEFAULT_FLAGS, map=Hardware::CPU.optimization_f
append flags, xarch unless xarch.empty?
if ARGV.build_bottle?
- append flags, Hardware::CPU.optimization_flags[Hardware.oldest_cpu]
+ arch = ARGV.bottle_arch || Hardware.oldest_cpu
+ append fl... | true |
Other | Homebrew | brew | c58d707158c365dd9c185b72f5a0003cad25a786.json | Allow building bottles with custom architectures
This allows overriding the "oldest CPU" behaviour - for instance, to
build Intel bottles for a newer CPU than Core 2, to build a PPC bottle
with or without Altivec on the same computer, etc. | Library/Homebrew/extend/ENV/super.rb | @@ -76,13 +76,20 @@ def setup_build_environment
self['CMAKE_LIBRARY_PATH'] = determine_cmake_library_path
self['ACLOCAL_PATH'] = determine_aclocal_path
+ # For custom bottles, need to specify the arch in the environment
+ # so that the compiler shims have access
+ if (arch = ARGV.bottle_arch)
+ ... | true |
Other | Homebrew | brew | 23c2ec56f8d7f7fd39528851f7670559c8f1f588.json | Prefer interpolation to concatenation | Library/Homebrew/cmd/--config.rb | @@ -69,7 +69,7 @@ def describe_path path
def describe_x11
return "N/A" unless MacOS::XQuartz.installed?
- return "#{MacOS::XQuartz.version} => " + describe_path(MacOS::XQuartz.prefix)
+ return "#{MacOS::XQuartz.version} => #{describe_path(MacOS::XQuartz.prefix)}"
end
def describe_perl | false |
Other | Homebrew | brew | 870e47e68ca5d2f9b1ceb1ead9cddd5ffbd951a6.json | Add some tests for ENV.{append,prepend} behavior | Library/Homebrew/test/test_ENV.rb | @@ -57,6 +57,52 @@ def test_with_build_environment_does_not_mutate_interface
assert_equal expected, @env.methods
end
+ def test_append_existing_key
+ @env['foo'] = 'bar'
+ @env.append 'foo', '1'
+ assert_equal 'bar 1', @env['foo']
+ end
+
+ def test_append_existing_key_empty
+ @env['foo'] = ''
... | false |
Other | Homebrew | brew | 3703d60e573a152eea183c5ca030edd86167ad6f.json | Fix const reference in mach
Fixes Homebrew/homebrew#22090. | Library/Homebrew/mach.rb | @@ -21,7 +21,7 @@ def universal?
end
def ppc?
- (PPC_32BIT_ARCHS+PPC_64BIT_ARCHS).any? {|a| self.include? a}
+ (Hardware::CPU::PPC_32BIT_ARCHS+Hardware::CPU::PPC_64BIT_ARCHS).any? {|a| self.include? a}
end
def remove_ppc! | false |
Other | Homebrew | brew | 3cf3fa7d8fc0b8d3572464ace150a847cc0bf33d.json | superenv: fix CC value for ENV.gcc
'gcc' could refer to anything of llvm-gcc, clang, or gcc-4.0 on
various Xcode versions. | Library/Homebrew/extend/ENV/super.rb | @@ -283,7 +283,7 @@ def deparallelize
end
alias_method :j1, :deparallelize
def gcc
- self['CC'] = self['OBJC'] = self['HOMEBREW_CC'] = "gcc"
+ self['CC'] = self['OBJC'] = self['HOMEBREW_CC'] = "gcc-4.2"
self['CXX'] = self['OBJCXX'] = "g++-4.2"
end
def llvm | false |
Other | Homebrew | brew | 95af184a0c678d075841b956f776f6bc7c648ee7.json | Add an accessor to make the intent more clear here | Library/Homebrew/options.rb | @@ -50,13 +50,16 @@ def split_name(name)
class Options
include Enumerable
+ attr_reader :options
+ protected :options
+
def initialize(*args)
@options = Set.new(*args)
end
def initialize_copy(other)
super
- @options = @options.dup
+ @options = other.options.dup
end
def each(*a... | false |
Other | Homebrew | brew | 71586d09aa42a5a6f67fb7006e1cbe178ec27f52.json | Avoid the need to compact the expanded deps array | Library/Homebrew/dependency.rb | @@ -73,13 +73,13 @@ def expand(dependent, &block)
deps = dependent.deps.map do |dep|
case action(dependent, dep, &block)
when :prune
- next
+ next []
when :skip
expand(dep.to_formula, &block)
else
expand(dep.to_formula, &block) << dep
... | false |
Other | Homebrew | brew | 865b68de103ccd4a0386dbd127db1827105aae4d.json | Add tests for ENV.{append,prepend}_path | Library/Homebrew/test/test_ENV.rb | @@ -56,4 +56,18 @@ def test_with_build_environment_does_not_mutate_interface
@env.with_build_environment { assert_equal expected, @env.methods }
assert_equal expected, @env.methods
end
+
+ def test_append_path
+ @env.append_path 'FOO', '/usr/bin'
+ assert_equal '/usr/bin', @env['FOO']
+ @env.appe... | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.