Skip to content
Snippets Groups Projects
Commit e3fe2704 authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #983 from MikeMcQuaid/update-force-linkedkegs-migration

Always run LinkedKegs migration (if needed).
parents 789cfb09 8aa18510
No related branches found
No related tags found
No related merge requests found
......@@ -172,7 +172,11 @@ module Homebrew
legacy_linked_kegs = HOMEBREW_LIBRARY/"LinkedKegs"
return unless legacy_linked_kegs.directory?
legacy_linked_kegs.children.each {|f| Keg.new(f.realpath).link }
legacy_linked_kegs.children.each do |f|
keg = Keg.new(f.realpath)
keg.unlink
keg.link
end
FileUtils.rm_rf legacy_linked_kegs
legacy_pinned_kegs = HOMEBREW_LIBRARY/"PinnedKegs"
......@@ -181,7 +185,9 @@ module Homebrew
legacy_pinned_kegs.children.each do |f|
pin_version = Keg.new(f.realpath).version
formula = Formulary.factory(f.basename.to_s)
FormulaPin.new(formula).pin_at(pin_version)
pin = FormulaPin.new(formula)
pin.unpin
pin.pin_at(pin_version)
end
FileUtils.rm_rf legacy_pinned_kegs
end
......
......@@ -534,6 +534,7 @@ EOS
if [[ -n "$HOMEBREW_UPDATED" ||
-n "$HOMEBREW_UPDATE_FAILED" ||
-n "$HOMEBREW_UPDATE_FORCE" ||
-d "$HOMEBREW_LIBRARY/LinkedKegs" ||
(-n "$HOMEBREW_DEVELOPER" && -z "$HOMEBREW_UPDATE_PREINSTALL") ]]
then
brew update-report "$@"
......
......@@ -18,10 +18,18 @@ HOMEBREW_LIBRARY = Pathname.new(ENV["HOMEBREW_LIBRARY"])
HOMEBREW_SHIMS_PATH = HOMEBREW_LIBRARY/"Homebrew/shims"
# Where we store symlinks to currently linked kegs
HOMEBREW_LINKED_KEGS = HOMEBREW_PREFIX/"var/homebrew/linked"
HOMEBREW_LINKED_KEGS = if (HOMEBREW_LIBRARY/"LinkedKegs").exist?
HOMEBREW_LIBRARY/"LinkedKegs"
else
HOMEBREW_PREFIX/"var/homebrew/linked"
end
# Wehere we store symlinks to currently version-pinned kegs
HOMEBREW_PINNED_KEGS = HOMEBREW_PREFIX/"var/homebrew/pinned"
# Where we store symlinks to currently version-pinned kegs
HOMEBREW_PINNED_KEGS = if (HOMEBREW_LIBRARY/"PinnedKegs").exist?
HOMEBREW_LIBRARY/"PinnedKegs"
else
HOMEBREW_PREFIX/"var/homebrew/pinned"
end
# Where we store lock files
HOMEBREW_LOCK_DIR = HOMEBREW_PREFIX/"var/homebrew/locks"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment