Allow build to be set externally

This commit is contained in:
Jack Nagel 2014-08-11 17:48:30 -05:00
parent 1455d83dd8
commit 0b468c528c

View File

@ -25,6 +25,7 @@ class Formula
attr_reader :buildpath, :testpath
attr_accessor :local_bottle_path
attr_accessor :build
def initialize(name, path, spec)
@name = name
@ -38,6 +39,7 @@ class Formula
@active_spec = determine_active_spec(spec)
validate_attributes :url, :name, :version
@pkg_version = PkgVersion.new(version, revision)
@build = active_spec.build
@pin = FormulaPin.new(self)
end
@ -109,10 +111,6 @@ class Formula
active_spec.option_defined?(name)
end
def build
active_spec.build
end
# if the dir is there, but it's empty we consider it not installed
def installed?
(dir = installed_prefix).directory? && dir.children.length > 0