Merge remote-tracking branch 'origin/master' into HEAD
This commit is contained in:
		
						commit
						b8647778ee
					
				@ -296,6 +296,13 @@ source "$HOMEBREW_LIBRARY/Homebrew/utils/analytics.sh"
 | 
				
			|||||||
setup-analytics
 | 
					setup-analytics
 | 
				
			||||||
report-analytics-screenview-command
 | 
					report-analytics-screenview-command
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Let user know we're still updating Homebrew if brew update --preinstall
 | 
				
			||||||
 | 
					# exceeds 3 seconds.
 | 
				
			||||||
 | 
					update-preinstall-timer() {
 | 
				
			||||||
 | 
					  sleep 3
 | 
				
			||||||
 | 
					  echo 'Updating Homebrew...' >&2
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
update-preinstall() {
 | 
					update-preinstall() {
 | 
				
			||||||
  [[ -z "$HOMEBREW_HELP" ]] || return
 | 
					  [[ -z "$HOMEBREW_HELP" ]] || return
 | 
				
			||||||
  [[ -z "$HOMEBREW_NO_AUTO_UPDATE" ]] || return
 | 
					  [[ -z "$HOMEBREW_NO_AUTO_UPDATE" ]] || return
 | 
				
			||||||
@ -306,7 +313,19 @@ update-preinstall() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  if [[ "$HOMEBREW_COMMAND" = "install" || "$HOMEBREW_COMMAND" = "upgrade" || "$HOMEBREW_COMMAND" = "tap" ]]
 | 
					  if [[ "$HOMEBREW_COMMAND" = "install" || "$HOMEBREW_COMMAND" = "upgrade" || "$HOMEBREW_COMMAND" = "tap" ]]
 | 
				
			||||||
  then
 | 
					  then
 | 
				
			||||||
 | 
					    if [[ -z "$HOMEBREW_VERBOSE" ]]
 | 
				
			||||||
 | 
					    then
 | 
				
			||||||
 | 
					      update-preinstall-timer &
 | 
				
			||||||
 | 
					      timer_pid=$!
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    brew update --preinstall
 | 
					    brew update --preinstall
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if [[ -n "$timer_pid" ]]
 | 
				
			||||||
 | 
					    then
 | 
				
			||||||
 | 
					      kill "$timer_pid" 2>/dev/null
 | 
				
			||||||
 | 
					      wait "$timer_pid" 2>/dev/null
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # If brew update --preinstall did a migration then export the new locations.
 | 
					  # If brew update --preinstall did a migration then export the new locations.
 | 
				
			||||||
 | 
				
			|||||||
@ -142,6 +142,7 @@ module Homebrew
 | 
				
			|||||||
          msg = "#{current.full_name}-#{current.installed_version} already installed"
 | 
					          msg = "#{current.full_name}-#{current.installed_version} already installed"
 | 
				
			||||||
          unless current.linked_keg.symlink? || current.keg_only?
 | 
					          unless current.linked_keg.symlink? || current.keg_only?
 | 
				
			||||||
            msg << ", it's just not linked"
 | 
					            msg << ", it's just not linked"
 | 
				
			||||||
 | 
					            puts "You can link formula with `brew link #{f}`"
 | 
				
			||||||
          end
 | 
					          end
 | 
				
			||||||
          opoo msg
 | 
					          opoo msg
 | 
				
			||||||
        elsif f.migration_needed? && !ARGV.force?
 | 
					        elsif f.migration_needed? && !ARGV.force?
 | 
				
			||||||
@ -222,25 +223,12 @@ module Homebrew
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  def check_development_tools
 | 
					  def check_development_tools
 | 
				
			||||||
    checks = Diagnostic::Checks.new
 | 
					    checks = Diagnostic::Checks.new
 | 
				
			||||||
    all_development_tools_checks = checks.development_tools_checks +
 | 
					    checks.fatal_development_tools_checks.each do |check|
 | 
				
			||||||
                                   checks.fatal_development_tools_checks
 | 
					 | 
				
			||||||
    all_development_tools_checks.each do |check|
 | 
					 | 
				
			||||||
      out = checks.send(check)
 | 
					      out = checks.send(check)
 | 
				
			||||||
      next if out.nil?
 | 
					      next if out.nil?
 | 
				
			||||||
      if checks.fatal_development_tools_checks.include?(check)
 | 
					      ofail out
 | 
				
			||||||
        odie out
 | 
					 | 
				
			||||||
      else
 | 
					 | 
				
			||||||
        opoo out
 | 
					 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    end
 | 
					    exit 1 if Homebrew.failed?
 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  def check_macports
 | 
					 | 
				
			||||||
    return if MacOS.macports_or_fink.empty?
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    opoo "It appears you have MacPorts or Fink installed."
 | 
					 | 
				
			||||||
    puts "Software installed with other package managers causes known problems for"
 | 
					 | 
				
			||||||
    puts "Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again."
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def check_cellar
 | 
					  def check_cellar
 | 
				
			||||||
@ -282,8 +270,5 @@ module Homebrew
 | 
				
			|||||||
    # another formula. In that case, don't generate an error, just move on.
 | 
					    # another formula. In that case, don't generate an error, just move on.
 | 
				
			||||||
  rescue CannotInstallFormulaError => e
 | 
					  rescue CannotInstallFormulaError => e
 | 
				
			||||||
    ofail e.message
 | 
					    ofail e.message
 | 
				
			||||||
  rescue BuildError
 | 
					 | 
				
			||||||
    check_macports
 | 
					 | 
				
			||||||
    raise
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
				
			|||||||
@ -415,7 +415,7 @@ class Reporter
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      # This means it is a Cask
 | 
					      # This means it is a Cask
 | 
				
			||||||
      if report[:DC].include? full_name
 | 
					      if report[:DC].include? full_name
 | 
				
			||||||
        next unless (HOMEBREW_REPOSITORY/"Caskroom"/name).exist?
 | 
					        next unless (HOMEBREW_PREFIX/"Caskroom"/name).exist?
 | 
				
			||||||
        new_tap = Tap.fetch(new_tap_name)
 | 
					        new_tap = Tap.fetch(new_tap_name)
 | 
				
			||||||
        new_tap.install unless new_tap.installed?
 | 
					        new_tap.install unless new_tap.installed?
 | 
				
			||||||
        ohai "#{name} has been moved to Homebrew.", <<-EOS.undent
 | 
					        ohai "#{name} has been moved to Homebrew.", <<-EOS.undent
 | 
				
			||||||
@ -442,7 +442,7 @@ class Reporter
 | 
				
			|||||||
      new_tap = Tap.fetch(new_tap_name)
 | 
					      new_tap = Tap.fetch(new_tap_name)
 | 
				
			||||||
      # For formulae migrated to cask: Auto-install cask or provide install instructions.
 | 
					      # For formulae migrated to cask: Auto-install cask or provide install instructions.
 | 
				
			||||||
      if new_tap_name == "caskroom/cask"
 | 
					      if new_tap_name == "caskroom/cask"
 | 
				
			||||||
        if new_tap.installed? && (HOMEBREW_REPOSITORY/"Caskroom").directory?
 | 
					        if new_tap.installed? && (HOMEBREW_PREFIX/"Caskroom").directory?
 | 
				
			||||||
          ohai "#{name} has been moved to Homebrew-Cask."
 | 
					          ohai "#{name} has been moved to Homebrew-Cask."
 | 
				
			||||||
          ohai "brew uninstall --force #{name}"
 | 
					          ohai "brew uninstall --force #{name}"
 | 
				
			||||||
          system HOMEBREW_BREW_FILE, "uninstall", "--force", name
 | 
					          system HOMEBREW_BREW_FILE, "uninstall", "--force", name
 | 
				
			||||||
 | 
				
			|||||||
@ -251,6 +251,8 @@ module Homebrew
 | 
				
			|||||||
          relocatable = false if keg_contain?(cellar, keg, ignores)
 | 
					          relocatable = false if keg_contain?(cellar, keg, ignores)
 | 
				
			||||||
          if prefix != prefix_check
 | 
					          if prefix != prefix_check
 | 
				
			||||||
            relocatable = false if keg_contain_absolute_symlink_starting_with?(prefix, keg)
 | 
					            relocatable = false if keg_contain_absolute_symlink_starting_with?(prefix, keg)
 | 
				
			||||||
 | 
					            relocatable = false if keg_contain?("#{prefix}/etc", keg, ignores)
 | 
				
			||||||
 | 
					            relocatable = false if keg_contain?("#{prefix}/var", keg, ignores)
 | 
				
			||||||
          end
 | 
					          end
 | 
				
			||||||
          skip_relocation = relocatable && !keg.require_relocation?
 | 
					          skip_relocation = relocatable && !keg.require_relocation?
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
 | 
				
			|||||||
@ -86,12 +86,17 @@ module Homebrew
 | 
				
			|||||||
      def development_tools_checks
 | 
					      def development_tools_checks
 | 
				
			||||||
        %w[
 | 
					        %w[
 | 
				
			||||||
          check_for_installed_developer_tools
 | 
					          check_for_installed_developer_tools
 | 
				
			||||||
        ]
 | 
					        ].freeze
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      def fatal_development_tools_checks
 | 
					      def fatal_development_tools_checks
 | 
				
			||||||
        %w[
 | 
					        %w[
 | 
				
			||||||
        ]
 | 
					        ].freeze
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      def build_error_checks
 | 
				
			||||||
 | 
					        (development_tools_checks + %w[
 | 
				
			||||||
 | 
					        ]).freeze
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      def check_for_installed_developer_tools
 | 
					      def check_for_installed_developer_tools
 | 
				
			||||||
@ -172,6 +177,7 @@ module Homebrew
 | 
				
			|||||||
          "libUFSDExtFS.dylib", # Paragon ExtFS
 | 
					          "libUFSDExtFS.dylib", # Paragon ExtFS
 | 
				
			||||||
          "libecomlodr.dylib", # Symantec Endpoint Protection
 | 
					          "libecomlodr.dylib", # Symantec Endpoint Protection
 | 
				
			||||||
          "libsymsea.*.dylib", # Symantec Endpoint Protection
 | 
					          "libsymsea.*.dylib", # Symantec Endpoint Protection
 | 
				
			||||||
 | 
					          "sentinel.dylib", # SentinelOne
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        __check_stray_files "/usr/local/lib", "*.dylib", white_list, <<-EOS.undent
 | 
					        __check_stray_files "/usr/local/lib", "*.dylib", white_list, <<-EOS.undent
 | 
				
			||||||
 | 
				
			|||||||
@ -327,22 +327,9 @@ class BuildError < RuntimeError
 | 
				
			|||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def dump
 | 
					  def dump
 | 
				
			||||||
    if !ARGV.verbose?
 | 
					 | 
				
			||||||
    puts
 | 
					    puts
 | 
				
			||||||
      puts Formatter.error(Formatter.url(OS::ISSUES_URL), label: "READ THIS")
 | 
					
 | 
				
			||||||
      if formula.tap
 | 
					    if ARGV.verbose?
 | 
				
			||||||
        case formula.tap.name
 | 
					 | 
				
			||||||
        when "homebrew/boneyard"
 | 
					 | 
				
			||||||
          puts "#{formula} was moved to homebrew-boneyard because it has unfixable issues."
 | 
					 | 
				
			||||||
          puts "Please do not file any issues about this. Sorry!"
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
          if issues_url = formula.tap.issues_url
 | 
					 | 
				
			||||||
            puts "If reporting this issue please do so at (not Homebrew/brew):"
 | 
					 | 
				
			||||||
            puts "  #{Formatter.url(issues_url)}"
 | 
					 | 
				
			||||||
          end
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
      end
 | 
					 | 
				
			||||||
    else
 | 
					 | 
				
			||||||
      require "system_config"
 | 
					      require "system_config"
 | 
				
			||||||
      require "build_environment"
 | 
					      require "build_environment"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -360,15 +347,50 @@ class BuildError < RuntimeError
 | 
				
			|||||||
        puts logs.map { |fn| "     #{fn}" }.join("\n")
 | 
					        puts logs.map { |fn| "     #{fn}" }.join("\n")
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if formula.tap && formula.tap.name == "homebrew/boneyard"
 | 
				
			||||||
 | 
					      onoe <<-EOS.undent
 | 
				
			||||||
 | 
					        #{formula} was moved to homebrew-boneyard because it has unfixable issues.
 | 
				
			||||||
 | 
					        Please do not file any issues about this. Sorry!
 | 
				
			||||||
 | 
					      EOS
 | 
				
			||||||
 | 
					      return
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if formula.tap
 | 
				
			||||||
 | 
					      if formula.tap.official?
 | 
				
			||||||
 | 
					        puts Formatter.error(Formatter.url(OS::ISSUES_URL), label: "READ THIS")
 | 
				
			||||||
 | 
					      elsif issues_url = formula.tap.issues_url
 | 
				
			||||||
 | 
					        puts <<-EOS.undent
 | 
				
			||||||
 | 
					          If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
 | 
				
			||||||
 | 
					          #{Formatter.url(issues_url)}
 | 
				
			||||||
 | 
					        EOS
 | 
				
			||||||
 | 
					      else
 | 
				
			||||||
 | 
					        puts <<-EOS.undent
 | 
				
			||||||
 | 
					          If reporting this issue please do so to (not Homebrew/brew or Homebrew/core):
 | 
				
			||||||
 | 
					          #{formula.tap}
 | 
				
			||||||
 | 
					        EOS
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      puts <<-EOS.undent
 | 
				
			||||||
 | 
					        Do not report this issue to Homebrew/brew or Homebrew/core!
 | 
				
			||||||
 | 
					      EOS
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    puts
 | 
					    puts
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if issues && !issues.empty?
 | 
					    if issues && !issues.empty?
 | 
				
			||||||
      puts "These open issues may also help:"
 | 
					      puts "These open issues may also help:"
 | 
				
			||||||
      puts issues.map { |i| "#{i["title"]} #{i["html_url"]}" }.join("\n")
 | 
					      puts issues.map { |i| "#{i["title"]} #{i["html_url"]}" }.join("\n")
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    require "diagnostic"
 | 
					    require "diagnostic"
 | 
				
			||||||
    unsupported_macos = Homebrew::Diagnostic::Checks.new.check_for_unsupported_macos
 | 
					    checks = Homebrew::Diagnostic::Checks.new
 | 
				
			||||||
    opoo unsupported_macos if unsupported_macos
 | 
					    checks.build_error_checks.each do |check|
 | 
				
			||||||
 | 
					      out = checks.send(check)
 | 
				
			||||||
 | 
					      next if out.nil?
 | 
				
			||||||
 | 
					      puts
 | 
				
			||||||
 | 
					      ofail out
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -10,19 +10,23 @@ module Homebrew
 | 
				
			|||||||
          check_xcode_license_approved
 | 
					          check_xcode_license_approved
 | 
				
			||||||
          check_for_osx_gcc_installer
 | 
					          check_for_osx_gcc_installer
 | 
				
			||||||
          check_xcode_8_without_clt_on_el_capitan
 | 
					          check_xcode_8_without_clt_on_el_capitan
 | 
				
			||||||
        ]
 | 
					          check_xcode_up_to_date
 | 
				
			||||||
 | 
					          check_clt_up_to_date
 | 
				
			||||||
 | 
					          check_for_other_package_managers
 | 
				
			||||||
 | 
					        ].freeze
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      def fatal_development_tools_checks
 | 
					      def fatal_development_tools_checks
 | 
				
			||||||
        if MacOS.version >= :sierra && ENV["CI"].nil?
 | 
					 | 
				
			||||||
        %w[
 | 
					        %w[
 | 
				
			||||||
            check_xcode_up_to_date
 | 
					          check_xcode_minimum_version
 | 
				
			||||||
            check_clt_up_to_date
 | 
					          check_clt_minimum_version
 | 
				
			||||||
          ]
 | 
					        ].freeze
 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
          %w[
 | 
					 | 
				
			||||||
          ]
 | 
					 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      def build_error_checks
 | 
				
			||||||
 | 
					        (development_tools_checks + %w[
 | 
				
			||||||
 | 
					          check_for_unsupported_macos
 | 
				
			||||||
 | 
					        ]).freeze
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      def check_for_unsupported_macos
 | 
					      def check_for_unsupported_macos
 | 
				
			||||||
@ -62,7 +66,8 @@ module Homebrew
 | 
				
			|||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      def check_xcode_up_to_date
 | 
					      def check_xcode_up_to_date
 | 
				
			||||||
        return unless MacOS::Xcode.installed? && MacOS::Xcode.outdated?
 | 
					        return unless MacOS::Xcode.installed?
 | 
				
			||||||
 | 
					        return unless MacOS::Xcode.outdated?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        message = <<-EOS.undent
 | 
					        message = <<-EOS.undent
 | 
				
			||||||
          Your Xcode (#{MacOS::Xcode.version}) is outdated.
 | 
					          Your Xcode (#{MacOS::Xcode.version}) is outdated.
 | 
				
			||||||
@ -83,7 +88,8 @@ module Homebrew
 | 
				
			|||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      def check_clt_up_to_date
 | 
					      def check_clt_up_to_date
 | 
				
			||||||
        return unless MacOS::CLT.installed? && MacOS::CLT.outdated?
 | 
					        return unless MacOS::CLT.installed?
 | 
				
			||||||
 | 
					        return unless MacOS::CLT.outdated?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <<-EOS.undent
 | 
					        <<-EOS.undent
 | 
				
			||||||
          A newer Command Line Tools release is available.
 | 
					          A newer Command Line Tools release is available.
 | 
				
			||||||
@ -94,7 +100,8 @@ module Homebrew
 | 
				
			|||||||
      def check_xcode_8_without_clt_on_el_capitan
 | 
					      def check_xcode_8_without_clt_on_el_capitan
 | 
				
			||||||
        return unless MacOS::Xcode.without_clt?
 | 
					        return unless MacOS::Xcode.without_clt?
 | 
				
			||||||
        # Scope this to Xcode 8 on El Cap for now
 | 
					        # Scope this to Xcode 8 on El Cap for now
 | 
				
			||||||
        return unless MacOS.version == :el_capitan && MacOS::Xcode.version >= "8"
 | 
					        return unless MacOS.version == :el_capitan
 | 
				
			||||||
 | 
					        return unless MacOS::Xcode.version >= "8"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <<-EOS.undent
 | 
					        <<-EOS.undent
 | 
				
			||||||
          You have Xcode 8 installed without the CLT;
 | 
					          You have Xcode 8 installed without the CLT;
 | 
				
			||||||
@ -104,6 +111,27 @@ module Homebrew
 | 
				
			|||||||
        EOS
 | 
					        EOS
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      def check_xcode_minimum_version
 | 
				
			||||||
 | 
					        return unless MacOS::Xcode.installed?
 | 
				
			||||||
 | 
					        return unless MacOS::Xcode.minimum_version?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <<-EOS.undent
 | 
				
			||||||
 | 
					          Your Xcode (#{MacOS::Xcode.version}) is too outdated.
 | 
				
			||||||
 | 
					          Please update to Xcode #{MacOS::Xcode.latest_version} (or delete it).
 | 
				
			||||||
 | 
					          #{MacOS::Xcode.update_instructions}
 | 
				
			||||||
 | 
					        EOS
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      def check_clt_minimum_version
 | 
				
			||||||
 | 
					        return unless MacOS::CLT.installed?
 | 
				
			||||||
 | 
					        return unless MacOS::CLT.minimum_version?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <<-EOS.undent
 | 
				
			||||||
 | 
					          Your Command Line Tools are too outdated.
 | 
				
			||||||
 | 
					          #{MacOS::CLT.update_instructions}
 | 
				
			||||||
 | 
					        EOS
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      def check_for_osx_gcc_installer
 | 
					      def check_for_osx_gcc_installer
 | 
				
			||||||
        return unless MacOS.version < "10.7" || ((MacOS::Xcode.version || "0") > "4.1")
 | 
					        return unless MacOS.version < "10.7" || ((MacOS::Xcode.version || "0") > "4.1")
 | 
				
			||||||
        return unless DevelopmentTools.clang_version == "2.1"
 | 
					        return unless DevelopmentTools.clang_version == "2.1"
 | 
				
			||||||
 | 
				
			|||||||
@ -38,7 +38,6 @@ module Utils
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      # Allows a bottle tag to specify a specific OS or later,
 | 
					      # Allows a bottle tag to specify a specific OS or later,
 | 
				
			||||||
      # so the same bottle can target multiple OSs.
 | 
					      # so the same bottle can target multiple OSs.
 | 
				
			||||||
      # Not used in core, used in taps.
 | 
					 | 
				
			||||||
      def find_or_later_tag(tag)
 | 
					      def find_or_later_tag(tag)
 | 
				
			||||||
        begin
 | 
					        begin
 | 
				
			||||||
          tag_version = MacOS::Version.from_symbol(tag)
 | 
					          tag_version = MacOS::Version.from_symbol(tag)
 | 
				
			||||||
 | 
				
			|||||||
@ -159,6 +159,11 @@ class Formulary
 | 
				
			|||||||
    attr_reader :tap
 | 
					    attr_reader :tap
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def initialize(tapped_name)
 | 
					    def initialize(tapped_name)
 | 
				
			||||||
 | 
					      name, path = formula_name_path(tapped_name)
 | 
				
			||||||
 | 
					      super name, path
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def formula_name_path(tapped_name, warn: true)
 | 
				
			||||||
      user, repo, name = tapped_name.split("/", 3).map(&:downcase)
 | 
					      user, repo, name = tapped_name.split("/", 3).map(&:downcase)
 | 
				
			||||||
      @tap = Tap.fetch user, repo
 | 
					      @tap = Tap.fetch user, repo
 | 
				
			||||||
      formula_dir = @tap.formula_dir || @tap.path
 | 
					      formula_dir = @tap.formula_dir || @tap.path
 | 
				
			||||||
@ -170,12 +175,25 @@ class Formulary
 | 
				
			|||||||
          name = path.basename(".rb").to_s
 | 
					          name = path.basename(".rb").to_s
 | 
				
			||||||
        elsif (new_name = @tap.formula_renames[name]) &&
 | 
					        elsif (new_name = @tap.formula_renames[name]) &&
 | 
				
			||||||
              (new_path = formula_dir/"#{new_name}.rb").file?
 | 
					              (new_path = formula_dir/"#{new_name}.rb").file?
 | 
				
			||||||
 | 
					          old_name = name
 | 
				
			||||||
          path = new_path
 | 
					          path = new_path
 | 
				
			||||||
          name = new_name
 | 
					          name = new_name
 | 
				
			||||||
 | 
					          new_name = @tap.core_tap? ? name : "#{@tap}/#{name}"
 | 
				
			||||||
 | 
					        elsif (new_tap_name = @tap.tap_migrations[name])
 | 
				
			||||||
 | 
					          new_tap = Tap.fetch new_tap_name
 | 
				
			||||||
 | 
					          new_tap.install unless new_tap.installed?
 | 
				
			||||||
 | 
					          new_tapped_name = "#{new_tap_name}/#{name}"
 | 
				
			||||||
 | 
					          name, path = formula_name_path(new_tapped_name, warn: false)
 | 
				
			||||||
 | 
					          old_name = tapped_name
 | 
				
			||||||
 | 
					          new_name = new_tap.core_tap? ? name : new_tapped_name
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if warn && old_name && new_name
 | 
				
			||||||
 | 
					          opoo "Use #{new_name} instead of deprecated #{old_name}"
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      super name, path
 | 
					      [name, path]
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_formula(spec, alias_path: nil)
 | 
					    def get_formula(spec, alias_path: nil)
 | 
				
			||||||
 | 
				
			|||||||
@ -13,7 +13,10 @@ module OS
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  if OS.mac?
 | 
					  if OS.mac?
 | 
				
			||||||
    require "os/mac"
 | 
					    require "os/mac"
 | 
				
			||||||
 | 
					    # Don't tell people to report issues on unsupported versions of macOS.
 | 
				
			||||||
 | 
					    if !OS::Mac.prerelease? && !OS::Mac.outdated_release?
 | 
				
			||||||
      ISSUES_URL = "https://git.io/brew-troubleshooting".freeze
 | 
					      ISSUES_URL = "https://git.io/brew-troubleshooting".freeze
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    PATH_OPEN = "/usr/bin/open".freeze
 | 
					    PATH_OPEN = "/usr/bin/open".freeze
 | 
				
			||||||
    # compatibility
 | 
					    # compatibility
 | 
				
			||||||
    ::MACOS_FULL_VERSION = OS::Mac.full_version.to_s.freeze
 | 
					    ::MACOS_FULL_VERSION = OS::Mac.full_version.to_s.freeze
 | 
				
			||||||
 | 
				
			|||||||
@ -25,6 +25,17 @@ module OS
 | 
				
			|||||||
        end
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      def minimum_version
 | 
				
			||||||
 | 
					        case MacOS.version
 | 
				
			||||||
 | 
					        when "10.12" then "8.0"
 | 
				
			||||||
 | 
					        else "2.0"
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      def minimum_version?
 | 
				
			||||||
 | 
					        version < minimum_version
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      def prerelease?
 | 
					      def prerelease?
 | 
				
			||||||
        # TODO: bump to version >= "8.3" after Xcode 8.2 is stable.
 | 
					        # TODO: bump to version >= "8.3" after Xcode 8.2 is stable.
 | 
				
			||||||
        version >= "8.2"
 | 
					        version >= "8.2"
 | 
				
			||||||
@ -205,6 +216,17 @@ module OS
 | 
				
			|||||||
        end
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      def minimum_version
 | 
				
			||||||
 | 
					        case MacOS.version
 | 
				
			||||||
 | 
					        when "10.12" then "8.0.0"
 | 
				
			||||||
 | 
					        else "4.0.0"
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      def minimum_version?
 | 
				
			||||||
 | 
					        version < minimum_version
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      def outdated?
 | 
					      def outdated?
 | 
				
			||||||
        if MacOS.version >= :mavericks
 | 
					        if MacOS.version >= :mavericks
 | 
				
			||||||
          version = Utils.popen_read("#{MAVERICKS_PKG_PATH}/usr/bin/clang --version")
 | 
					          version = Utils.popen_read("#{MAVERICKS_PKG_PATH}/usr/bin/clang --version")
 | 
				
			||||||
 | 
				
			|||||||
@ -221,7 +221,7 @@ class Bottle
 | 
				
			|||||||
    def initialize(name, version, tag, rebuild)
 | 
					    def initialize(name, version, tag, rebuild)
 | 
				
			||||||
      @name = name
 | 
					      @name = name
 | 
				
			||||||
      @version = version
 | 
					      @version = version
 | 
				
			||||||
      @tag = tag
 | 
					      @tag = tag.to_s.gsub(/_or_later$/, "")
 | 
				
			||||||
      @rebuild = rebuild
 | 
					      @rebuild = rebuild
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -805,7 +805,7 @@ Homebrew wants to maintain a consistent Ruby style across all formulae based on
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
### Version detection fails
 | 
					### Version detection fails
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Homebrew tries to automatically determine the [`version`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#version-class_method) from the [`url`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#url-class_method) in avoid duplication. If the tarball has an unusual name you may need to manually assign the [`version`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#version-class_method).
 | 
					Homebrew tries to automatically determine the [`version`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#version-class_method) from the [`url`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#url-class_method) to avoid duplication. If the tarball has an unusual name you may need to manually assign the [`version`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#version-class_method).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Bad Makefiles
 | 
					## Bad Makefiles
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user