From 5f5e68975244beab041ca4aee4b8a83f6dc7e402 Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Sat, 2 Dec 2017 13:41:11 +0000 Subject: [PATCH 1/5] Remember `--ignore-dependencies` when installing and upgrading --- Library/Homebrew/cmd/upgrade.rb | 1 + Library/Homebrew/formula_installer.rb | 2 ++ Library/Homebrew/tab.rb | 3 +++ 3 files changed, 6 insertions(+) diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index de886ff3dd..bc6acd217d 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -128,6 +128,7 @@ module Homebrew if tab fi.installed_as_dependency = tab.installed_as_dependency fi.installed_on_request ||= tab.installed_on_request + fi.ignore_deps = tab.ignored_dependencies end fi.prelude diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index b5c5e7fb53..10ca579428 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -333,6 +333,7 @@ class FormulaInstaller tab = Tab.for_keg(keg) tab.installed_as_dependency = installed_as_dependency tab.installed_on_request = installed_on_request + tab.ignored_dependencies = ignore_deps? tab.write end @@ -891,6 +892,7 @@ class FormulaInstaller tab.installed_as_dependency = installed_as_dependency tab.installed_on_request = installed_on_request tab.aliases = formula.aliases + tab.ignored_dependencies = ignore_deps? tab.write end diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index aa0208d51a..a88dda828b 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -19,6 +19,7 @@ class Tab < OpenStruct build = formula.build attributes = { "homebrew_version" => HOMEBREW_VERSION, + "ignored_dependencies" => false, "used_options" => build.used_options.as_flags, "unused_options" => build.unused_options.as_flags, "tabfile" => formula.prefix/FILENAME, @@ -177,6 +178,7 @@ class Tab < OpenStruct "unused_options" => [], "built_as_bottle" => false, "installed_as_dependency" => false, + "ignored_dependencies" => false, "installed_on_request" => true, "poured_from_bottle" => false, "time" => nil, @@ -322,6 +324,7 @@ class Tab < OpenStruct "poured_from_bottle" => poured_from_bottle, "installed_as_dependency" => installed_as_dependency, "installed_on_request" => installed_on_request, + "ignored_dependencies" => ignored_dependencies, "changed_files" => changed_files&.map(&:to_s), "time" => time, "source_modified_time" => source_modified_time.to_i, From 4dfe6e32e44ef1e2a3d38134188abf3ca748b6ca Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Sat, 2 Dec 2017 17:14:46 +0000 Subject: [PATCH 2/5] Let the upgrade command add new build flags --- Library/Homebrew/cmd/upgrade.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index bc6acd217d..7ba2adff0c 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -119,8 +119,11 @@ module Homebrew tab = Tab.for_keg(keg) end + new_build_options = BuildOptions.new(Options.create(ARGV.flags_only), f.options) + fi = FormulaInstaller.new(f) - fi.options = f.build.used_options + fi.options = new_build_options.used_options + fi.options |= f.build.used_options fi.options &= f.options fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && f.build.build_bottle?) fi.installed_on_request = !ARGV.named.empty? From da764c6d6c4cc905a93ad7c71a6da5f9e61f28e0 Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Sat, 2 Dec 2017 20:03:38 +0000 Subject: [PATCH 3/5] Delete `--ignore-dependencies` additions --- Library/Homebrew/cmd/install.rb | 1 - Library/Homebrew/cmd/upgrade.rb | 1 - Library/Homebrew/formula_installer.rb | 2 -- Library/Homebrew/tab.rb | 3 --- 4 files changed, 7 deletions(-) diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 575dbc4b3a..0fb12d2a09 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -328,7 +328,6 @@ module Homebrew fi = FormulaInstaller.new(f) fi.options = build_options.used_options fi.invalid_option_names = build_options.invalid_option_names - fi.ignore_deps = ARGV.ignore_deps? fi.only_deps = ARGV.only_deps? fi.build_bottle = ARGV.build_bottle? fi.interactive = ARGV.interactive? diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 7ba2adff0c..8fa0a9e6ed 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -131,7 +131,6 @@ module Homebrew if tab fi.installed_as_dependency = tab.installed_as_dependency fi.installed_on_request ||= tab.installed_on_request - fi.ignore_deps = tab.ignored_dependencies end fi.prelude diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 10ca579428..b5c5e7fb53 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -333,7 +333,6 @@ class FormulaInstaller tab = Tab.for_keg(keg) tab.installed_as_dependency = installed_as_dependency tab.installed_on_request = installed_on_request - tab.ignored_dependencies = ignore_deps? tab.write end @@ -892,7 +891,6 @@ class FormulaInstaller tab.installed_as_dependency = installed_as_dependency tab.installed_on_request = installed_on_request tab.aliases = formula.aliases - tab.ignored_dependencies = ignore_deps? tab.write end diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index a88dda828b..aa0208d51a 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -19,7 +19,6 @@ class Tab < OpenStruct build = formula.build attributes = { "homebrew_version" => HOMEBREW_VERSION, - "ignored_dependencies" => false, "used_options" => build.used_options.as_flags, "unused_options" => build.unused_options.as_flags, "tabfile" => formula.prefix/FILENAME, @@ -178,7 +177,6 @@ class Tab < OpenStruct "unused_options" => [], "built_as_bottle" => false, "installed_as_dependency" => false, - "ignored_dependencies" => false, "installed_on_request" => true, "poured_from_bottle" => false, "time" => nil, @@ -324,7 +322,6 @@ class Tab < OpenStruct "poured_from_bottle" => poured_from_bottle, "installed_as_dependency" => installed_as_dependency, "installed_on_request" => installed_on_request, - "ignored_dependencies" => ignored_dependencies, "changed_files" => changed_files&.map(&:to_s), "time" => time, "source_modified_time" => source_modified_time.to_i, From 9603e39f164bb379118557b9f103aa3cdad349f3 Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Sat, 2 Dec 2017 20:04:03 +0000 Subject: [PATCH 4/5] Rename whole build_options block (copypaste from reinstall) --- Library/Homebrew/cmd/upgrade.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 8fa0a9e6ed..9f8763904b 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -119,12 +119,13 @@ module Homebrew tab = Tab.for_keg(keg) end - new_build_options = BuildOptions.new(Options.create(ARGV.flags_only), f.options) + build_options = BuildOptions.new(Options.create(ARGV.flags_only), f.options) + options = build_options.used_options + options |= f.build.used_options + options &= f.options fi = FormulaInstaller.new(f) - fi.options = new_build_options.used_options - fi.options |= f.build.used_options - fi.options &= f.options + fi.options = options fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && f.build.build_bottle?) fi.installed_on_request = !ARGV.named.empty? fi.link_keg = keg_was_linked if keg_had_linked_opt From cf892c432ef12bffd01518a4fa507ae277056c63 Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Sat, 2 Dec 2017 20:07:17 +0000 Subject: [PATCH 5/5] Revert extra deletion --- Library/Homebrew/cmd/install.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 0fb12d2a09..575dbc4b3a 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -328,6 +328,7 @@ module Homebrew fi = FormulaInstaller.new(f) fi.options = build_options.used_options fi.invalid_option_names = build_options.invalid_option_names + fi.ignore_deps = ARGV.ignore_deps? fi.only_deps = ARGV.only_deps? fi.build_bottle = ARGV.build_bottle? fi.interactive = ARGV.interactive?