Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(782)

Unified Diff: build/landmines.py

Issue 457063002: Fix v8 landmines script. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/run-tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/landmines.py
diff --git a/build/landmines.py b/build/landmines.py
index 4f9773f41441f59e92e41d984ef1f442fd3112b2..bd1fb28f719c622a90888a90ca41815729c3b996 100755
--- a/build/landmines.py
+++ b/build/landmines.py
@@ -61,30 +61,30 @@ def set_up_landmines(target, new_landmines):
if not os.path.exists(landmines_path):
print "Landmines tracker didn't exists."
- # Make sure the landmines tracker exists.
- open(landmines_path, 'a').close()
-
- triggered = os.path.join(out_dir, '.landmines_triggered')
- with open(landmines_path, 'r') as f:
- old_landmines = f.readlines()
- if old_landmines != new_landmines:
- old_date = time.ctime(os.stat(landmines_path).st_ctime)
- diff = difflib.unified_diff(old_landmines, new_landmines,
- fromfile='old_landmines', tofile='new_landmines',
- fromfiledate=old_date, tofiledate=time.ctime(), n=0)
-
- with open(triggered, 'w') as f:
- f.writelines(diff)
- print "Setting landmine: %s" % triggered
- elif os.path.exists(triggered):
- # Remove false triggered landmines.
- os.remove(triggered)
- print "Removing landmine: %s" % triggered
+ # FIXME(machenbach): Clobber deletes the .landmines tracker. Difficult
+ # to know if we are right after a clobber or if it is first-time landmines
+ # deployment. Also, a landmine-triggered clobber right after a clobber is
+ # not possible. Different clobber methods for msvs, xcode and make all
+ # have different blacklists of files that are not deleted.
+ 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()
+ if old_landmines != new_landmines:
+ old_date = time.ctime(os.stat(landmines_path).st_ctime)
+ diff = difflib.unified_diff(old_landmines, new_landmines,
+ fromfile='old_landmines', tofile='new_landmines',
+ fromfiledate=old_date, tofiledate=time.ctime(), n=0)
+
+ with open(triggered, 'w') as f:
+ f.writelines(diff)
+ print "Setting landmine: %s" % triggered
+ elif os.path.exists(triggered):
+ # Remove false triggered landmines.
+ os.remove(triggered)
+ print "Removing landmine: %s" % triggered
with open(landmines_path, 'w') as f:
f.writelines(new_landmines)
- with open(landmines_path, 'r') as f:
- print "Content of the landmines tracker:"
- print f.read()
def process_options():
« no previous file with comments | « no previous file | tools/run-tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698