Add methods for manipulating the opt record

This commit is contained in:
Jack Nagel 2014-06-30 20:16:58 -05:00
parent 0744ed9410
commit d792b64655

View File

@ -163,14 +163,19 @@ class Keg
linked_keg_record.parent.rmdir_if_possible
end
def optlinked?
opt_record.symlink? && path == opt_record.resolved_path
end
def remove_opt_record
opt_record.unlink
opt_record.parent.rmdir_if_possible
end
def uninstall
path.rmtree
path.parent.rmdir_if_possible
if opt_record.symlink? && path == opt_record.resolved_path
opt_record.unlink
opt_record.parent.rmdir_if_possible
end
remove_opt_record if optlinked?
end
def unlink