mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Keep track of pruned parent directories
This commit is contained in:
parent
1d8a85c0ae
commit
e4b951520a
@ -42,7 +42,7 @@ class Keg < Pathname
|
|||||||
dir.find do |src|
|
dir.find do |src|
|
||||||
next if src == self
|
next if src == self
|
||||||
dst = HOMEBREW_PREFIX + src.relative_path_from(self)
|
dst = HOMEBREW_PREFIX + src.relative_path_from(self)
|
||||||
dst.extend ObserverPathnameExtension
|
dst.extend(ObserverPathnameExtension)
|
||||||
|
|
||||||
# check whether the file to be unlinked is from the current keg first
|
# check whether the file to be unlinked is from the current keg first
|
||||||
if !dst.symlink? || !dst.exist? || src != dst.resolved_path
|
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.uninstall_info if dst.to_s =~ INFOFILE_RX and ENV['HOMEBREW_KEEP_INFO']
|
||||||
dst.unlink
|
dst.unlink
|
||||||
dst.parent.rmdir_if_possible
|
dst.parent.extend(ObserverPathnameExtension).rmdir_if_possible
|
||||||
Find.prune if src.directory?
|
Find.prune if src.directory?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -31,7 +31,7 @@ class LinkTests < Test::Unit::TestCase
|
|||||||
|
|
||||||
def test_unlinking_keg
|
def test_unlinking_keg
|
||||||
@keg.link
|
@keg.link
|
||||||
assert_equal 3, @keg.unlink
|
assert_equal 4, @keg.unlink
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_link_dry_run
|
def test_link_dry_run
|
||||||
|
Loading…
x
Reference in New Issue
Block a user