Merge pull request #4700 from reitermarkus/hide-lockfile-cleanup
Hide lockfiles being cleaned up.
This commit is contained in:
commit
880f6fa509
@ -245,9 +245,9 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def cleanup_lockfiles(*lockfiles)
|
def cleanup_lockfiles(*lockfiles)
|
||||||
return unless HOMEBREW_LOCK_DIR.directory?
|
return if dry_run?
|
||||||
|
|
||||||
if lockfiles.empty?
|
if lockfiles.empty? && HOMEBREW_LOCK_DIR.directory?
|
||||||
lockfiles = HOMEBREW_LOCK_DIR.children.select(&:file?)
|
lockfiles = HOMEBREW_LOCK_DIR.children.select(&:file?)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ module Homebrew
|
|||||||
next unless file.open(File::RDWR).flock(File::LOCK_EX | File::LOCK_NB)
|
next unless file.open(File::RDWR).flock(File::LOCK_EX | File::LOCK_NB)
|
||||||
|
|
||||||
begin
|
begin
|
||||||
cleanup_path(file) { file.unlink }
|
file.unlink
|
||||||
ensure
|
ensure
|
||||||
file.open(File::RDWR).flock(File::LOCK_UN) if file.exist?
|
file.open(File::RDWR).flock(File::LOCK_UN) if file.exist?
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user