diff options
| author | Alyssa Ross | 2016-09-05 01:11:36 +0100 |
|---|---|---|
| committer | Alyssa Ross | 2016-09-05 01:19:08 +0100 |
| commit | 65ee5408c3d000393c1b73bfe8fb731a651ee281 (patch) | |
| tree | c9c68f12bba237f4e556493eab85d9ee00899905 /Library/Homebrew/formula.rb | |
| parent | c17664b124a84c7b6f8373337b3623003ca30772 (diff) | |
| download | brew-65ee5408c3d000393c1b73bfe8fb731a651ee281.tar.bz2 | |
Replace install_name/install_ref with alias_path
Diffstat (limited to 'Library/Homebrew/formula.rb')
| -rw-r--r-- | Library/Homebrew/formula.rb | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 479798829..90e6b2212 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -61,7 +61,7 @@ class Formula # The name specified when installing this {Formula}. # Could be the name of the {Formula}, or an alias. # e.g. `another-name-for-this-formula` - attr_reader :install_name + attr_reader :alias_path # The fully-qualified name of this {Formula}. # For core formula it's the same as {#name}. @@ -148,10 +148,10 @@ class Formula attr_accessor :build # @private - def initialize(name, path, spec, install_name: name) + def initialize(name, path, spec, alias_path: nil) @name = name @path = path - @install_name = install_name + @alias_path = alias_path @revision = self.class.revision || 0 @version_scheme = self.class.version_scheme || 0 @@ -508,21 +508,6 @@ class Formula installed_prefixes.map { |dir| Keg.new(dir) } end - # Formula reference to use to get an identical installation of the formula. - # - # Usually, the formula's path is a good canonical identifier for the formula. - # Just using whatever was passed to `brew install` isn't a good idea, because - # if it was e.g. a URL, it could end up being downloaded twice. - # - # However, if the formula was installed with an alias (i.e. `install_name` is - # different from `name`), that should be used instead so that information is - # preserved. Aliases are looked up in repositories that have already been - # tapped, so we don't have to worry about doing extra HTTP requests, or other - # expensive operations, when looking them up again. - def install_ref - install_name == name ? path : install_name - end - # The directory where the formula's binaries should be installed. # This is symlinked into `HOMEBREW_PREFIX` after installation or with # `brew link` for formulae that are not keg-only. |
