aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2016-01-14 19:00:06 +0800
committerXu Cheng2016-01-15 16:26:04 +0800
commit6c8c56a689b6da8d68a3c15524ad216b040ae5ae (patch)
tree4183dc89803ed3ea391f95fb240c0d1bf7b5fa89
parentb24f1743255efe631a1d8fdd1357c5a4f475fa0e (diff)
downloadbrew-6c8c56a689b6da8d68a3c15524ad216b040ae5ae.tar.bz2
build: store source modified time in tabfile
-rw-r--r--Library/Homebrew/build.rb2
-rw-r--r--Library/Homebrew/formula.rb6
-rw-r--r--Library/Homebrew/resource.rb3
-rw-r--r--Library/Homebrew/software_spec.rb2
4 files changed, 9 insertions, 4 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb
index 4d804e509..f7187e8f3 100644
--- a/Library/Homebrew/build.rb
+++ b/Library/Homebrew/build.rb
@@ -130,7 +130,7 @@ class Build
formula.install
stdlibs = detect_stdlibs(ENV.compiler)
- Tab.create(formula, ENV.compiler, stdlibs.first, formula.build).write
+ Tab.create(formula, ENV.compiler, stdlibs.first, formula.build, formula.source_modified_time).write
# Find and link metafiles
formula.prefix.install_metafiles Pathname.pwd
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 7abcc0b44..884385996 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -78,7 +78,6 @@ class Formula
# This contains all the attributes (e.g. URL, checksum) that apply to the
# stable version of this formula.
# @private
-
attr_reader :stable
# The development {SoftwareSpec} for this {Formula}.
@@ -108,6 +107,10 @@ class Formula
# @private
attr_reader :active_spec_sym
+ # most recent modified time for source files
+ # @private
+ attr_reader :source_modified_time
+
# Used for creating new Homebrew versions of software without new upstream
# versions.
# @see .revision
@@ -1550,6 +1553,7 @@ class Formula
def stage
active_spec.stage do
+ @source_modified_time = active_spec.source_modified_time
@buildpath = Pathname.pwd
env_home = buildpath/".brew_home"
mkdir_p env_home
diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb
index 202b45774..bc5d62aee 100644
--- a/Library/Homebrew/resource.rb
+++ b/Library/Homebrew/resource.rb
@@ -8,7 +8,7 @@ require "version"
class Resource
include FileUtils
- attr_reader :mirrors, :specs, :using
+ attr_reader :mirrors, :specs, :using, :source_modified_time
attr_writer :version
attr_accessor :download_strategy, :checksum
@@ -87,6 +87,7 @@ class Resource
def unpack(target = nil)
mktemp(download_name) do
downloader.stage
+ @source_modified_time = downloader.source_modified_time
if block_given?
yield self
elsif target
diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb
index b6ca59961..2edc51a07 100644
--- a/Library/Homebrew/software_spec.rb
+++ b/Library/Homebrew/software_spec.rb
@@ -25,7 +25,7 @@ class SoftwareSpec
attr_reader :bottle_specification
attr_reader :compiler_failures
- def_delegators :@resource, :stage, :fetch, :verify_download_integrity
+ def_delegators :@resource, :stage, :fetch, :verify_download_integrity, :source_modified_time
def_delegators :@resource, :cached_download, :clear_cache
def_delegators :@resource, :checksum, :mirrors, :specs, :using
def_delegators :@resource, :version, :mirror, *Checksum::TYPES