aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2016-01-14 19:01:31 +0800
committerXu Cheng2016-01-15 16:26:04 +0800
commit7958343f1694a72c8f15b7bf0e00a888fa321996 (patch)
tree8363f5f307b6bb2adf5311e079d2d177e7f0106f
parent6c8c56a689b6da8d68a3c15524ad216b040ae5ae (diff)
downloadbrew-7958343f1694a72c8f15b7bf0e00a888fa321996.tar.bz2
bottle: read source modified time from tabfile
* Avoid unnecessary stage overhead * Support different download strategy, e.g. `git`.
-rw-r--r--Library/Homebrew/cmd/bottle.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb
index c2ea0941d..b6c10b35b 100644
--- a/Library/Homebrew/cmd/bottle.rb
+++ b/Library/Homebrew/cmd/bottle.rb
@@ -140,10 +140,6 @@ module Homebrew
erb.result(bottle.instance_eval { binding }).gsub(/^\s*$\n/, "")
end
- def most_recent_mtime(pathname)
- pathname.to_enum(:find).select(&:exist?).map(&:mtime).max
- end
-
def bottle_formula(f)
unless f.installed?
return ofail "Formula not installed or up-to-date: #{f.full_name}"
@@ -194,10 +190,6 @@ module Homebrew
relocatable = false
skip_relocation = false
- formula_source_time = f.stable.stage do
- most_recent_mtime(Pathname.pwd)
- end
-
keg.lock do
original_tab = nil
@@ -216,11 +208,11 @@ module Homebrew
tab.time = nil
tab.write
- keg.find {|k| File.utime(File.atime(k), formula_source_time, k) }
+ keg.find {|k| File.utime(File.atime(k), tab.source_modified_time, k) }
cd cellar do
safe_system "tar", "cf", tar_path, "#{f.name}/#{f.pkg_version}"
- File.utime(File.atime(tar_path), formula_source_time, tar_path)
+ File.utime(File.atime(tar_path), tab.source_modified_time, tar_path)
relocatable_tar_path = "#{f}-bottle.tar"
mv tar_path, relocatable_tar_path
# Use gzip, faster to compress than bzip2, faster to uncompress than bzip2