Fix "possible reference to past scope" warnings on 2.2

This commit is contained in:
Jack Nagel 2014-12-26 11:58:09 -05:00
parent c50fdbd139
commit dd90030213
3 changed files with 9 additions and 9 deletions

View File

@ -202,8 +202,8 @@ class FormulaInstaller
return if ARGV.force?
conflicts = formula.conflicts.select do |c|
formula = Formulary.factory(c.name)
formula.linked_keg.exist? && formula.opt_prefix.exist?
f = Formulary.factory(c.name)
f.linked_keg.exist? && f.opt_prefix.exist?
end
raise FormulaConflictError.new(formula, conflicts) unless conflicts.empty?

View File

@ -259,8 +259,8 @@ class Keg
link_dir('sbin', mode) {:skip_dir}
link_dir('include', mode) {:link}
link_dir('share', mode) do |path|
case path.to_s
link_dir('share', mode) do |relative_path|
case relative_path.to_s
when 'locale/locale.alias' then :skip_file
when INFOFILE_RX then :info
when LOCALEDIR_RX then :mkpath
@ -273,8 +273,8 @@ class Keg
end
end
link_dir('lib', mode) do |path|
case path.to_s
link_dir('lib', mode) do |relative_path|
case relative_path.to_s
when 'charset.alias' then :skip_file
# pkg-config database gets explicitly created
when 'pkgconfig' then :mkpath
@ -294,12 +294,12 @@ class Keg
end
end
link_dir('Frameworks', mode) do |path|
link_dir('Frameworks', mode) do |relative_path|
# Frameworks contain symlinks pointing into a subdir, so we have to use
# the :link strategy. However, for Foo.framework and
# Foo.framework/Versions we have to use :mkpath so that multiple formulae
# can link their versions into it and `brew [un]link` works.
if path.to_s =~ /[^\/]*\.framework(\/Versions)?$/
if relative_path.to_s =~ /[^\/]*\.framework(\/Versions)?$/
:mkpath
else
:link

View File

@ -45,7 +45,7 @@ class Tab < OpenStruct
def self.remap_deprecated_options deprecated_options, options
deprecated_options.each do |deprecated_option|
option = options.find {|option| option.name == deprecated_option.old }
option = options.find { |o| o.name == deprecated_option.old }
next unless option
options -= [option]
options << Option.new(deprecated_option.current, option.description)