aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2016-12-10 18:12:36 +0000
committerGitHub2016-12-10 18:12:36 +0000
commit51c31f4d515567b66333a031d8c8c62c7239ddba (patch)
tree961938fb91b9e685749d10cb0274a83c2f1faa93 /Library
parenta566540c46563b1ea84158c963134862167ca993 (diff)
parente347f7ade38cc1695fc08e4f321751e800039929 (diff)
downloadbrew-51c31f4d515567b66333a031d8c8c62c7239ddba.tar.bz2
Merge pull request #1642 from MikeMcQuaid/always-output-options
reinstall/upgrade/install: always output options.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/reinstall.rb15
-rw-r--r--Library/Homebrew/cmd/upgrade.rb2
-rw-r--r--Library/Homebrew/formula_installer.rb16
-rw-r--r--Library/Homebrew/test/reinstall_test.rb2
4 files changed, 17 insertions, 18 deletions
diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb
index 598286562..2eb2840a5 100644
--- a/Library/Homebrew/cmd/reinstall.rb
+++ b/Library/Homebrew/cmd/reinstall.rb
@@ -20,19 +20,15 @@ module Homebrew
end
def reinstall_formula(f)
- options = BuildOptions.new(Options.create(ARGV.flags_only), f.options).used_options
- options |= f.build.used_options
- options &= f.options
-
- notice = "Reinstalling #{f.full_name}"
- notice += " with #{options * ", "}" unless options.empty?
- oh1 notice
-
if f.opt_prefix.directory?
keg = Keg.new(f.opt_prefix.resolved_path)
backup keg
end
+ options = BuildOptions.new(Options.create(ARGV.flags_only), f.options).used_options
+ options |= f.build.used_options
+ options &= f.options
+
fi = FormulaInstaller.new(f)
fi.options = options
fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && f.build.build_bottle?)
@@ -43,6 +39,9 @@ module Homebrew
fi.verbose = ARGV.verbose?
fi.debug = ARGV.debug?
fi.prelude
+
+ oh1 "Reinstalling #{f.full_name} #{options.to_a.join " "}"
+
fi.install
fi.finish
rescue FormulaInstallationAlreadyAttemptedError
diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb
index f92832aa2..5b49a9f65 100644
--- a/Library/Homebrew/cmd/upgrade.rb
+++ b/Library/Homebrew/cmd/upgrade.rb
@@ -104,7 +104,7 @@ module Homebrew
fi.debug = ARGV.debug?
fi.prelude
- oh1 "Upgrading #{f.full_specified_name}"
+ oh1 "Upgrading #{f.full_specified_name} #{fi.options.to_a.join " "}"
# first we unlink the currently active keg for this formula otherwise it is
# possible for the existing build to interfere with the build we are about to
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 1eae668a4..2f00a824f 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -219,16 +219,16 @@ class FormulaInstaller
opoo "#{formula.full_name}: this formula has no #{option} option so it will be ignored!"
end
- oh1 "Installing #{Formatter.identifier(formula.full_name)}" if show_header?
+ options = []
+ if formula.head?
+ options << "--HEAD"
+ elsif formula.devel?
+ options << "--devel"
+ end
+ options += effective_build_options_for(formula).used_options.to_a
+ oh1 "Installing #{Formatter.identifier(formula.full_name)} #{options.join " "}" if show_header?
if formula.tap && !formula.tap.private?
- options = []
- if formula.head?
- options << "--HEAD"
- elsif formula.devel?
- options << "--devel"
- end
- options += effective_build_options_for(formula).used_options.to_a
category = "install"
action = ([formula.full_name] + options).join(" ")
Utils::Analytics.report_event(category, action)
diff --git a/Library/Homebrew/test/reinstall_test.rb b/Library/Homebrew/test/reinstall_test.rb
index 73877b35d..613c06188 100644
--- a/Library/Homebrew/test/reinstall_test.rb
+++ b/Library/Homebrew/test/reinstall_test.rb
@@ -8,7 +8,7 @@ class IntegrationCommandTestReinstall < IntegrationCommandTestCase
foo_dir = HOMEBREW_CELLAR/"testball/0.1/foo"
assert foo_dir.exist?
foo_dir.rmtree
- assert_match "Reinstalling testball with --with-foo",
+ assert_match "Reinstalling testball --with-foo",
cmd("reinstall", "testball")
assert foo_dir.exist?
end