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
commit1ad70245d1a79cc4c9c0415b65559282f25376fa (patch)
tree0ae25e636dce9a77d84e32ab922a7474d87eb2bb /Library
parent60aa0e2c4091c179161f64c6cf011ccb4f4bcf73 (diff)
downloadhomebrew-1ad70245d1a79cc4c9c0415b65559282f25376fa.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