From 818c65542d2bb57ba01959f1bedfddf0b4cf3be5 Mon Sep 17 00:00:00 2001 From: Alex Dunn Date: Sat, 5 Sep 2015 11:49:02 -0700 Subject: [PATCH] remove Formula#file_modified? It's been more trouble than it's worth. Fixes Homebrew/homebrew#43607. Closes Homebrew/homebrew#43049. Closes Homebrew/homebrew#43615. Signed-off-by: Mike McQuaid --- Library/Homebrew/cmd/fetch.rb | 7 ------- Library/Homebrew/formula.rb | 10 ---------- Library/Homebrew/formula_installer.rb | 7 ------- Library/Homebrew/test/test_bottle_hooks.rb | 2 -- 4 files changed, 26 deletions(-) diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index 61c8bf7817..ea642e6e97 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -33,13 +33,6 @@ module Homebrew return true if ARGV.force_bottle? && f.bottle return false unless f.bottle && f.pour_bottle? return false if ARGV.build_from_source? || ARGV.build_bottle? - if f.file_modified? - filename = f.path.to_s.gsub("#{HOMEBREW_PREFIX}/", "") - opoo "Formula file is modified!" - puts "Fetching source because #{filename} has local changes" - puts "To fetch the bottle instead, run with --force-bottle" - return false - end return false unless f.bottle.compatible_cellar? true end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 68649e7856..7b3d0062ef 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -916,16 +916,6 @@ class Formula "#" end - # @private - def file_modified? - return false unless Utils.git_available? - - path.parent.cd do - diff = Utils.popen_read("git", "diff", "origin/master", "--", "#{path}") - !diff.empty? && $?.exitstatus == 0 - end - end - # Standard parameters for CMake builds. # Setting CMAKE_FIND_FRAMEWORK to "LAST" tells CMake to search for our # libraries before trying to utilize Frameworks, many of which will be from diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index c997176f91..7395edc49c 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -75,7 +75,6 @@ class FormulaInstaller return false if build_from_source? || build_bottle? || interactive? return false unless options.empty? return true if formula.local_bottle_path - return false if formula.file_modified? return false unless bottle && formula.pour_bottle? unless bottle.compatible_cellar? @@ -199,12 +198,6 @@ class FormulaInstaller build_bottle_preinstall if build_bottle? unless @poured_bottle - if formula.file_modified? && !build_from_source? - filename = formula.path.to_s.gsub("#{HOMEBREW_PREFIX}/", "") - opoo "Formula file is modified!" - puts "Building from source because #{filename} has local changes" - puts "To install from a bottle instead, run with --force-bottle" - end compute_and_install_dependencies if @pour_failed && !ignore_deps? build clean diff --git a/Library/Homebrew/test/test_bottle_hooks.rb b/Library/Homebrew/test/test_bottle_hooks.rb index f2ae5a6b72..ff9d95c9cd 100644 --- a/Library/Homebrew/test/test_bottle_hooks.rb +++ b/Library/Homebrew/test/test_bottle_hooks.rb @@ -10,8 +10,6 @@ class BottleHookTests < Homebrew::TestCase def some_random_method true end - - def file_modified?; end end def setup