summaryrefslogtreecommitdiffstats
path: root/chromium/build/landmines.py
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/build/landmines.py')
-rwxr-xr-xchromium/build/landmines.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/chromium/build/landmines.py b/chromium/build/landmines.py
index 7b4c5b5ecc6..220b8a7989f 100755
--- a/chromium/build/landmines.py
+++ b/chromium/build/landmines.py
@@ -15,7 +15,7 @@ build is clobbered.
"""
import difflib
-import gyp_helper
+import errno
import logging
import optparse
import os
@@ -58,13 +58,13 @@ def set_up_landmines(target, new_landmines):
landmine_utils.platform() == 'ios')
landmines_path = os.path.join(out_dir, '.landmines')
- if not os.path.exists(out_dir):
+ try:
os.makedirs(out_dir)
+ except OSError as e:
+ if e.errno == errno.EEXIST:
+ pass
- if not os.path.exists(landmines_path):
- with open(landmines_path, 'w') as f:
- f.writelines(new_landmines)
- else:
+ if os.path.exists(landmines_path):
triggered = os.path.join(out_dir, '.landmines_triggered')
with open(landmines_path, 'r') as f:
old_landmines = f.readlines()
@@ -79,6 +79,8 @@ def set_up_landmines(target, new_landmines):
elif os.path.exists(triggered):
# Remove false triggered landmines.
os.remove(triggered)
+ with open(landmines_path, 'w') as f:
+ f.writelines(new_landmines)
def process_options():
@@ -113,7 +115,9 @@ def process_options():
def main():
landmine_scripts = process_options()
- gyp_helper.apply_chromium_gyp_env()
+
+ if landmine_utils.builder() in ('dump_dependency_json', 'eclipse'):
+ return 0
for target in ('Debug', 'Release', 'Debug_x64', 'Release_x64'):
landmines = []