aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/upgrade.rb
diff options
context:
space:
mode:
authorMike McQuaid2018-02-05 09:31:17 +0000
committerMike McQuaid2018-02-05 10:59:11 +0000
commit3a2e6b82fd008974c47b87a98c6c7bbf1dcdcea7 (patch)
tree79b037e1d66772c089abc31ea4caaaf4876390b6 /Library/Homebrew/cmd/upgrade.rb
parent62f85cfabbcff722afb406e48e56d5b10e6fc654 (diff)
downloadbrew-3a2e6b82fd008974c47b87a98c6c7bbf1dcdcea7.tar.bz2
Make pinning more robust
Don’t autoremove pins on uninstall or upgrade and note this in the manpage.
Diffstat (limited to 'Library/Homebrew/cmd/upgrade.rb')
-rw-r--r--Library/Homebrew/cmd/upgrade.rb22
1 files changed, 4 insertions, 18 deletions
diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb
index 7832983e3..401a02e67 100644
--- a/Library/Homebrew/cmd/upgrade.rb
+++ b/Library/Homebrew/cmd/upgrade.rb
@@ -50,11 +50,8 @@ module Homebrew
exit 1 if outdated.empty?
end
- unless upgrade_pinned?
- pinned = outdated.select(&:pinned?)
- outdated -= pinned
- end
-
+ pinned = outdated.select(&:pinned?)
+ outdated -= pinned
formulae_to_install = outdated.map(&:latest_formula)
if formulae_to_install.empty?
@@ -64,8 +61,8 @@ module Homebrew
puts formulae_to_install.map { |f| "#{f.full_specified_name} #{f.pkg_version}" } * ", "
end
- unless upgrade_pinned? || pinned.empty?
- oh1 "Not upgrading #{Formatter.pluralize(pinned.length, "pinned package")}:"
+ unless pinned.empty?
+ onoe "Not upgrading #{Formatter.pluralize(pinned.length, "pinned package")}:"
puts pinned.map { |f| "#{f.full_specified_name} #{f.pkg_version}" } * ", "
end
@@ -95,10 +92,6 @@ module Homebrew
end
end
- def upgrade_pinned?
- !ARGV.named.empty?
- end
-
def upgrade_formula(f)
if f.opt_prefix.directory?
keg = Keg.new(f.opt_prefix.resolved_path)
@@ -143,13 +136,6 @@ module Homebrew
fi.install
fi.finish
-
- # If the formula was pinned, and we were force-upgrading it, unpin and
- # pin it again to get a symlink pointing to the correct keg.
- if f.pinned?
- f.unpin
- f.pin
- end
rescue FormulaInstallationAlreadyAttemptedError
# We already attempted to upgrade f as part of the dependency tree of
# another formula. In that case, don't generate an error, just move on.