Use the keg object to manipulate the linked keg record
This commit is contained in:
parent
2de2d64907
commit
982a165e52
@ -546,14 +546,13 @@ class FormulaInstaller
|
||||
end
|
||||
|
||||
def link
|
||||
if f.linked_keg.directory? and f.linked_keg.resolved_path == f.prefix
|
||||
opoo "This keg was marked linked already, continuing anyway"
|
||||
# otherwise Keg.link will bail
|
||||
f.linked_keg.unlink
|
||||
end
|
||||
|
||||
keg = Keg.new(f.prefix)
|
||||
|
||||
if keg.linked?
|
||||
opoo "This keg was marked linked already, continuing anyway"
|
||||
keg.remove_linked_keg_record
|
||||
end
|
||||
|
||||
begin
|
||||
keg.link
|
||||
rescue Keg::ConflictError => e
|
||||
|
||||
@ -180,16 +180,18 @@ class Keg
|
||||
end
|
||||
end
|
||||
|
||||
if linked?
|
||||
linked_keg_record.unlink
|
||||
linked_keg_record.parent.rmdir_if_possible
|
||||
end
|
||||
remove_linked_keg_record if linked?
|
||||
|
||||
dirs.reverse_each(&:rmdir_if_possible)
|
||||
|
||||
ObserverPathnameExtension.total
|
||||
end
|
||||
|
||||
def remove_linked_keg_record
|
||||
linked_keg_record.unlink
|
||||
linked_keg_record.parent.rmdir_if_possible
|
||||
end
|
||||
|
||||
def lock
|
||||
FormulaLock.new(name).with_lock { yield }
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user