Skip to content
Snippets Groups Projects
Commit 9a179d8b authored by Jack Nagel's avatar Jack Nagel
Browse files

locks: ensure lock directory exists

Fixes Homebrew/homebrew#17326.
parent 2534c1d4
No related branches found
No related tags found
No related merge requests found
......@@ -229,6 +229,7 @@ class Formula
end
def lock
HOMEBREW_CACHE_FORMULA.mkpath
lockpath = HOMEBREW_CACHE_FORMULA/"#{@name}.brewing"
@lockfile = lockpath.open(File::RDWR | File::CREAT)
unless @lockfile.flock(File::LOCK_EX | File::LOCK_NB)
......
......@@ -62,6 +62,7 @@ class Keg < Pathname
end
def lock
HOMEBREW_CACHE_FORMULA.mkpath
path = HOMEBREW_CACHE_FORMULA/"#{fname}.brewing"
file = path.open(File::RDWR | File::CREAT)
unless file.flock(File::LOCK_EX | File::LOCK_NB)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment