aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-03-05 20:12:51 -0600
committerJack Nagel2014-03-05 20:12:51 -0600
commitb5e1715333d9e34499f19a46ff9aeecfe4b05e6c (patch)
treef37289cafec1842dfb8e325b2de646bc13175277 /Library
parent7e8c693218499811897ebc502aa2cac5c7ab59cc (diff)
downloadbrew-b5e1715333d9e34499f19a46ff9aeecfe4b05e6c.tar.bz2
Enable tracking of formula revisions
It is useful to be able to prompt upgrades in response to events other than a version update; for example, when a dependency is updated and its library version changes, dependents need to be rebuilt to link against the new library. Currently we cannot do this automatically, which means a flood of tickets whenever the library version of a popular library changes. To address this, we need to track an additional piece of metadata, the "revision" of the formula, which can be incremented when appropriate to prompt an upgrade. It can then be reset to zero when the next version change occurs.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index ca943a27d..6ad5eae3a 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -18,6 +18,7 @@ class Formula
attr_reader :name, :path, :homepage, :build
attr_reader :stable, :bottle, :devel, :head, :active_spec
+ attr_reader :revision
# The current working directory during builds and tests.
# Will only be non-nil inside #stage and #test.
@@ -34,6 +35,7 @@ class Formula
@name = name
@path = path
@homepage = self.class.homepage
+ @revision = self.class.revision || 0
set_spec :stable
set_spec :devel
@@ -662,7 +664,7 @@ class Formula
class << self
attr_reader :keg_only_reason, :cc_failures
- attr_rw :homepage, :plist_startup, :plist_manual
+ attr_rw :homepage, :plist_startup, :plist_manual, :revision
def specs
@specs ||= [stable, devel, head, bottle].freeze