Hide lockfiles being cleaned up again.

This commit is contained in:
Markus Reiter 2018-08-16 05:55:17 +02:00
parent 63a66efe59
commit efd1884c2e

View File

@ -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