From c2fdcf1a3490106fbe9e7a1d03375b2a75304f0a Mon Sep 17 00:00:00 2001 From: Nicolas Despres Date: Fri, 20 Apr 2012 17:07:45 +0200 Subject: [PATCH] Honor build options and bottles when upgrading Fixes Homebrew/homebrew#11552. Closes Homebrew/homebrew#11777. Signed-off-by: Jack Nagel --- Library/Homebrew/cmd/upgrade.rb | 1 + Library/Homebrew/formula_installer.rb | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index d9c1309725..566649ed38 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -54,6 +54,7 @@ module Homebrew extend self installer = FormulaInstaller.new(f, tab) installer.show_header = false + installer.install_bottle = install_bottle?(f) and tab.used_options.empty? oh1 "Upgrading #{f.name}" diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 3f48e2dd6c..db893e2ad6 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -182,7 +182,12 @@ class FormulaInstaller args = ARGV.clone unless args.include? '--fresh' - args.concat tab.used_options unless tab.nil? + unless tab.nil? + args.concat tab.used_options + # FIXME: enforce the download of the non-bottled package + # in the spawned Ruby process. + args << '--build-from-source' + end args.uniq! # Just in case some dupes were added end