Commit f3d0d1c3 authored by scottmg@chromium.org's avatar scottmg@chromium.org

Always write .landmines

Otherwise, if .landmines exists, and isn't clobbered by the clobber in
compile.py, every build will cause a clobber until .landmines is removed.

Trying to fix http://crbug.com/375459 brought this up. In that case
compile.py wasn't removing .landmines, which is necessary in the case
of a landmines change on two subsequent builds. If .landmines isn't
maintained, then there's nothing to diff against on the second build
and so a clobber won't be correctly triggered.

R=iannucci@chromium.org,kbr@chromium.org
BUG=376359

Review URL: https://codereview.chromium.org/293983017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272341 0039d316-1c4b-4281-b951-d872f2087c98
parent 3b84344b
...@@ -64,10 +64,7 @@ def set_up_landmines(target, new_landmines): ...@@ -64,10 +64,7 @@ def set_up_landmines(target, new_landmines):
if e.errno == errno.EEXIST: if e.errno == errno.EEXIST:
pass pass
if not os.path.exists(landmines_path): if os.path.exists(landmines_path):
with open(landmines_path, 'w') as f:
f.writelines(new_landmines)
else:
triggered = os.path.join(out_dir, '.landmines_triggered') triggered = os.path.join(out_dir, '.landmines_triggered')
with open(landmines_path, 'r') as f: with open(landmines_path, 'r') as f:
old_landmines = f.readlines() old_landmines = f.readlines()
...@@ -82,6 +79,8 @@ def set_up_landmines(target, new_landmines): ...@@ -82,6 +79,8 @@ def set_up_landmines(target, new_landmines):
elif os.path.exists(triggered): elif os.path.exists(triggered):
# Remove false triggered landmines. # Remove false triggered landmines.
os.remove(triggered) os.remove(triggered)
with open(landmines_path, 'w') as f:
f.writelines(new_landmines)
def process_options(): def process_options():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment