aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-01-26 13:18:44 -0600
committerJack Nagel2013-01-26 13:18:45 -0600
commita91d0df514fa5457c6795af10e4bab85a4fcb5a4 (patch)
tree892040bed16789264ec53fc4009f7309e8902fe8 /Library
parenta2bca6783b322ac6503a93e32d2f316ebb249780 (diff)
downloadhomebrew-a91d0df514fa5457c6795af10e4bab85a4fcb5a4.tar.bz2
locks: ensure lock directory exists
Fixes #17326.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb1
-rw-r--r--Library/Homebrew/keg.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 15ce8889c..7af0989a7 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -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)
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index 4949d24dc..674ac881f 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -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)