зеркало из https://github.com/mozilla/gecko-dev.git
Bug 852103 - Fix race condition with .deps directory creation. r=ted
This commit is contained in:
Родитель
ff9d05fb1f
Коммит
0e9991d4c8
|
@ -2,6 +2,8 @@
|
|||
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
import errno
|
||||
|
||||
dependencies = []
|
||||
targets = []
|
||||
|
||||
|
@ -10,6 +12,14 @@ def makeQuote(filename):
|
|||
|
||||
def writeMakeDependOutput(filename):
|
||||
print "Creating makedepend file", filename
|
||||
dir = os.path.dirname(filename)
|
||||
if dir and not os.path.exists(dir):
|
||||
try:
|
||||
os.makedirs(dir)
|
||||
except OSError as error:
|
||||
if error.errno != errno.EEXIST:
|
||||
raise
|
||||
|
||||
with open(filename, 'w') as f:
|
||||
if len(targets) > 0:
|
||||
f.write("%s:" % makeQuote(targets[0]))
|
||||
|
|
Загрузка…
Ссылка в новой задаче