Unlock lockfiles again on --dry-run.

This commit is contained in:
Markus Reiter 2018-08-11 17:23:35 +02:00
parent ddfecd1cca
commit f83314164c

View File

@ -153,8 +153,8 @@ module Homebrew
end end
cleanup_cache cleanup_cache
cleanup_logs cleanup_logs
return if dry_run?
cleanup_lockfiles cleanup_lockfiles
return if dry_run?
rm_ds_store rm_ds_store
else else
args.each do |arg| args.each do |arg|
@ -254,7 +254,12 @@ module Homebrew
lockfiles.each do |file| lockfiles.each do |file|
next unless file.readable? next unless file.readable?
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)
cleanup_path(file) { file.unlink }
begin
cleanup_path(file) { file.unlink }
ensure
file.open(File::RDWR).flock(File::LOCK_UN) if file.exist?
end
end end
end end