Keep track of pruned parent directories

This commit is contained in:
Jack Nagel 2013-08-09 11:29:19 -05:00
parent 1d8a85c0ae
commit e4b951520a
2 changed files with 4 additions and 4 deletions

View File

@ -41,8 +41,8 @@ class Keg < Pathname
next unless dir.exist?
dir.find do |src|
next if src == self
dst=HOMEBREW_PREFIX+src.relative_path_from(self)
dst.extend ObserverPathnameExtension
dst = HOMEBREW_PREFIX + src.relative_path_from(self)
dst.extend(ObserverPathnameExtension)
# check whether the file to be unlinked is from the current keg first
if !dst.symlink? || !dst.exist? || src != dst.resolved_path
@ -51,7 +51,7 @@ class Keg < Pathname
dst.uninstall_info if dst.to_s =~ INFOFILE_RX and ENV['HOMEBREW_KEEP_INFO']
dst.unlink
dst.parent.rmdir_if_possible
dst.parent.extend(ObserverPathnameExtension).rmdir_if_possible
Find.prune if src.directory?
end
end

View File

@ -31,7 +31,7 @@ class LinkTests < Test::Unit::TestCase
def test_unlinking_keg
@keg.link
assert_equal 3, @keg.unlink
assert_equal 4, @keg.unlink
end
def test_link_dry_run