From 0ef3e1e0dcbcd5aa55408fe81d23613e1c2c5e79 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sat, 3 Sep 2016 21:10:44 +0100 Subject: Preserve alias when installing formulae Part of #567 --- Library/Homebrew/tab.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Library/Homebrew/tab.rb') diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index cf398fcbf..0b26116c5 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -27,6 +27,7 @@ class Tab < OpenStruct "time" => Time.now.to_i, "source_modified_time" => formula.source_modified_time.to_i, "HEAD" => HOMEBREW_REPOSITORY.git_head, + "install_name" => formula.install_name, "compiler" => compiler, "stdlib" => stdlib, "source" => { @@ -161,6 +162,7 @@ class Tab < OpenStruct "time" => nil, "source_modified_time" => 0, "HEAD" => nil, + "install_name" => nil, "stdlib" => nil, "compiler" => DevelopmentTools.default_compiler, "source" => { @@ -292,6 +294,7 @@ class Tab < OpenStruct "time" => time, "source_modified_time" => source_modified_time.to_i, "HEAD" => self.HEAD, + "install_name" => install_name, "stdlib" => (stdlib.to_s if stdlib), "compiler" => (compiler.to_s if compiler), "source" => source -- cgit v1.2.3 From 65ee5408c3d000393c1b73bfe8fb731a651ee281 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 5 Sep 2016 01:11:36 +0100 Subject: Replace install_name/install_ref with alias_path --- Library/Homebrew/tab.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Library/Homebrew/tab.rb') diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 0b26116c5..ec8cbe235 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -27,7 +27,7 @@ class Tab < OpenStruct "time" => Time.now.to_i, "source_modified_time" => formula.source_modified_time.to_i, "HEAD" => HOMEBREW_REPOSITORY.git_head, - "install_name" => formula.install_name, + "alias_path" => formula.alias_path.to_s, "compiler" => compiler, "stdlib" => stdlib, "source" => { @@ -162,7 +162,7 @@ class Tab < OpenStruct "time" => nil, "source_modified_time" => 0, "HEAD" => nil, - "install_name" => nil, + "alias_path" => nil, "stdlib" => nil, "compiler" => DevelopmentTools.default_compiler, "source" => { @@ -294,7 +294,7 @@ class Tab < OpenStruct "time" => time, "source_modified_time" => source_modified_time.to_i, "HEAD" => self.HEAD, - "install_name" => install_name, + "alias_path" => alias_path, "stdlib" => (stdlib.to_s if stdlib), "compiler" => (compiler.to_s if compiler), "source" => source -- cgit v1.2.3 From b90eba8ffd9549879bf4c911377d8d4cf9aa7b39 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 5 Sep 2016 14:21:00 +0100 Subject: Update Tap for alias_path --- Library/Homebrew/tab.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Library/Homebrew/tab.rb') diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index ec8cbe235..d84c64329 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -56,6 +56,10 @@ class Tab < OpenStruct attributes["source_modified_time"] ||= 0 attributes["source"] ||= {} + if alias_path = attributes["alias_path"] + attributes["alias_path"] = Pathname.new(alias_path) + end + tapped_from = attributes["tapped_from"] unless tapped_from.nil? || tapped_from == "path or URL" attributes["source"]["tap"] = attributes.delete("tapped_from") @@ -294,7 +298,7 @@ class Tab < OpenStruct "time" => time, "source_modified_time" => source_modified_time.to_i, "HEAD" => self.HEAD, - "alias_path" => alias_path, + "alias_path" => alias_path && alias_path.to_s, "stdlib" => (stdlib.to_s if stdlib), "compiler" => (compiler.to_s if compiler), "source" => source -- cgit v1.2.3 From ba10ce70bd36cbdc05a574f2227093da0ab7f470 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 5 Sep 2016 22:01:05 +0100 Subject: More consistent style --- Library/Homebrew/tab.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/tab.rb') diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index d84c64329..cf15e4c7b 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -298,7 +298,7 @@ class Tab < OpenStruct "time" => time, "source_modified_time" => source_modified_time.to_i, "HEAD" => self.HEAD, - "alias_path" => alias_path && alias_path.to_s, + "alias_path" => (alias_path.to_s if alias_path), "stdlib" => (stdlib.to_s if stdlib), "compiler" => (compiler.to_s if compiler), "source" => source -- cgit v1.2.3 From f9e16ee2e04b7b23b273bfa683ab54a85ed40660 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 7 Sep 2016 22:48:52 +0100 Subject: Combine Tab alias_path with source.path --- Library/Homebrew/tab.rb | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'Library/Homebrew/tab.rb') diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index cf15e4c7b..13082a213 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -27,11 +27,10 @@ class Tab < OpenStruct "time" => Time.now.to_i, "source_modified_time" => formula.source_modified_time.to_i, "HEAD" => HOMEBREW_REPOSITORY.git_head, - "alias_path" => formula.alias_path.to_s, "compiler" => compiler, "stdlib" => stdlib, "source" => { - "path" => formula.path.to_s, + "path" => formula.specified_path.to_s, "tap" => formula.tap ? formula.tap.name : nil, "spec" => formula.active_spec_sym.to_s, "versions" => { @@ -56,10 +55,6 @@ class Tab < OpenStruct attributes["source_modified_time"] ||= 0 attributes["source"] ||= {} - if alias_path = attributes["alias_path"] - attributes["alias_path"] = Pathname.new(alias_path) - end - tapped_from = attributes["tapped_from"] unless tapped_from.nil? || tapped_from == "path or URL" attributes["source"]["tap"] = attributes.delete("tapped_from") @@ -142,7 +137,7 @@ class Tab < OpenStruct tab = empty tab.unused_options = f.options.as_flags tab.source = { - "path" => f.path.to_s, + "path" => f.specified_path.to_s, "tap" => f.tap ? f.tap.name : f.tap, "spec" => f.active_spec_sym.to_s, "versions" => { @@ -166,7 +161,6 @@ class Tab < OpenStruct "time" => nil, "source_modified_time" => 0, "HEAD" => nil, - "alias_path" => nil, "stdlib" => nil, "compiler" => DevelopmentTools.default_compiler, "source" => { @@ -298,7 +292,6 @@ class Tab < OpenStruct "time" => time, "source_modified_time" => source_modified_time.to_i, "HEAD" => self.HEAD, - "alias_path" => (alias_path.to_s if alias_path), "stdlib" => (stdlib.to_s if stdlib), "compiler" => (compiler.to_s if compiler), "source" => source -- cgit v1.2.3