Bug 852103 - Fix race condition with .deps directory creation. r=ted

This commit is contained in:
Mike Hommey 2013-03-19 06:29:48 +01:00
Родитель ff9d05fb1f
Коммит 0e9991d4c8
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -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]))