migrator: link Cellar and opt before the keg.

When there's absolute symlinks in a linked directory in the `keg`
(e.g. `bin`)that point to the `Cellar` or `opt` then linking the `keg`
will fail before the `Cellar` or `opt` has been linked.

Closes Homebrew/homebrew#44306.

Closes Homebrew/homebrew#44329.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Mike McQuaid 2015-09-25 14:37:50 +01:00
parent d0cfad03dd
commit be45e6a0c5

View File

@ -163,9 +163,9 @@ class Migrator
unlink_oldname
move_to_new_directory
repin
link_newname unless old_linked_keg.nil?
link_oldname_opt
link_oldname_cellar
link_oldname_opt
link_newname unless old_linked_keg.nil?
update_tabs
rescue Interrupt
ignore_interrupts { backup_oldname }