aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/descriptions.rb
diff options
context:
space:
mode:
authorXu Cheng2016-02-26 19:20:18 +0800
committerXu Cheng2016-04-02 21:51:36 +0800
commite9886cac6cd7cffbd39f812d02e9f4c5f308e470 (patch)
tree31c09a9fafedc7a68d4397480ae698988ca7be29 /Library/Homebrew/descriptions.rb
parent13141de0fd3bbe2a967e7f78d6b87fe193b304b7 (diff)
downloadbrew-e9886cac6cd7cffbd39f812d02e9f4c5f308e470.tar.bz2
descriptions: update for core/formula separation
Update the description update logic, since now all formulae are in the taps.
Diffstat (limited to 'Library/Homebrew/descriptions.rb')
-rw-r--r--Library/Homebrew/descriptions.rb15
1 files changed, 2 insertions, 13 deletions
diff --git a/Library/Homebrew/descriptions.rb b/Library/Homebrew/descriptions.rb
index bab14f148..804fc39cd 100644
--- a/Library/Homebrew/descriptions.rb
+++ b/Library/Homebrew/descriptions.rb
@@ -33,25 +33,14 @@ class Descriptions
self.save_cache
end
- # Return true if the cache exists, and neither Homebrew nor any of the Taps
+ # Return true if the cache exists, and none of the Taps
# repos were updated more recently than it was.
def self.cache_fresh?
return false unless CACHE_FILE.exist?
- cache_mtime = File.mtime(CACHE_FILE)
- ref_master = ".git/refs/heads/master"
-
- master = HOMEBREW_REPOSITORY/ref_master
-
- # If ref_master doesn't exist, it means brew update is never run.
- # Since cache is found, we can assume it's fresh.
- if master.exist?
- core_mtime = File.mtime(master)
- return false if core_mtime > cache_mtime
- end
Tap.each do |tap|
next unless tap.git?
- repo_mtime = File.mtime(tap.path/ref_master)
+ repo_mtime = File.mtime(tap.path/".git/refs/heads/master")
return false if repo_mtime > cache_mtime
end