aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-06-30 20:16:58 -0500
committerJack Nagel2014-06-30 20:31:13 -0500
commit894d61c10ea8d1259d256b93725a8b80424acdaf (patch)
tree28ea92f4e163345156d433078aa86176f2f9e031 /Library
parenteae9d5c3788a1b3b8bcf35fda5fbc2010f45783e (diff)
downloadhomebrew-894d61c10ea8d1259d256b93725a8b80424acdaf.tar.bz2
Add methods for manipulating the opt record
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index 190630604..e0e29afab 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -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