aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/git.rb
diff options
context:
space:
mode:
authorMax Howell2009-12-30 19:01:18 +0000
committerMax Howell2009-12-30 20:49:16 +0000
commit87b5cfccc80dd555043d4ca26162248c5653937c (patch)
tree4f4b14e0883c35d2a0ce97734fa84a516fb9df76 /Library/Formula/git.rb
parent270a1bcd9b1c7656a159c5f302a4c3d9bcba1e57 (diff)
downloadhomebrew-87b5cfccc80dd555043d4ca26162248c5653937c.tar.bz2
Compare md5s rather than filesizes
Lets be more robust at the expense of milliseconds of cpu time.
Diffstat (limited to 'Library/Formula/git.rb')
-rw-r--r--Library/Formula/git.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/Library/Formula/git.rb b/Library/Formula/git.rb
index 1b831d507..784f7f057 100644
--- a/Library/Formula/git.rb
+++ b/Library/Formula/git.rb
@@ -24,10 +24,12 @@ class Git <Formula
# these files are exact copies of the git binary, so like the contents
# of libexec/git-core lets hard link them
# I am assuming this is an overisght by the git devs
+ git_md5 = (bin+'git').md5
%w[git-receive-pack git-upload-archive].each do |fn|
- next unless (bin+'git').stat.size == (bin+fn).stat.size
- (bin+fn).unlink
- (bin+fn).make_link bin+'git'
+ fn = bin + fn
+ next unless git_md5 == fn.md5
+ fn.unlink
+ fn.make_link bin+'git'
end
# we could build the manpages ourselves, but the build process depends