From b5e1715333d9e34499f19a46ff9aeecfe4b05e6c Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 5 Mar 2014 20:12:51 -0600 Subject: [PATCH] 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. --- Library/Homebrew/formula.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index ca943a27df..6ad5eae3a6 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