mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-25 04:11:44 +00:00
build system: use FileUtils.mkdir_p
instead of a mutex for creating directories
No need for a full-blown mutex as `mkdir_p` already handles the directory existing correctly via catching the corresponding exception. See #2194.
This commit is contained in:
parent
6b43072ed1
commit
eebe77f6a3
@ -5,7 +5,6 @@ require "fileutils"
|
||||
|
||||
$git_mutex = Mutex.new
|
||||
$message_mutex = Mutex.new
|
||||
$dir_mutex = Mutex.new
|
||||
$action_width = 12
|
||||
|
||||
def puts(message)
|
||||
@ -103,10 +102,8 @@ def runq_git(msg, cmdline, options = {})
|
||||
end
|
||||
|
||||
def ensure_dir dir
|
||||
$dir_mutex.synchronize {
|
||||
File.unlink(dir) if FileTest.exist?(dir) && !FileTest.directory?(dir)
|
||||
Dir.mkdir(dir) if !FileTest.exist?(dir)
|
||||
}
|
||||
File.unlink(dir) if FileTest.exist?(dir) && !FileTest.directory?(dir)
|
||||
FileUtils.mkdir_p(dir)
|
||||
end
|
||||
|
||||
def create_dependency_dirs
|
||||
|
Loading…
Reference in New Issue
Block a user