etc/tidy: don't check SNAP against triple

This commit is contained in:
Adrien Tétar 2014-02-02 11:24:43 +01:00
parent 2bf575c86f
commit fc1d655ed2
2 changed files with 30 additions and 9 deletions

View File

@ -195,7 +195,30 @@ def make_snapshot(stage, triple):
return file1
def determine_curr_snapshot_info(triple):
def curr_snapshot_rev():
i = 0
found_snap = False
date = None
rev = None
f = open(snapshotfile)
for line in f.readlines():
i += 1
parsed = parse_line(i, line)
if (not parsed): continue
if parsed["type"] == "snapshot":
date = parsed["date"]
rev = parsed["rev"]
found_snap = True
break
if not found_snap:
raise Exception("no snapshot entries in file")
return (date, rev)
def determine_curr_snapshot(triple):
i = 0
platform = get_platform(triple)
@ -228,7 +251,4 @@ def determine_curr_snapshot_info(triple):
raise Exception("no snapshot file found for platform %s, rev %s" %
(platform, rev))
return (date, rev, platform, hsh)
def determine_curr_snapshot(triple):
return full_snapshot_name(*determine_curr_snapshot_info(triple))
return full_snapshot_name(date, rev, platform, hsh)

View File

@ -57,12 +57,13 @@ try:
match = re.match(r'^.*//\s*SNAP\s+(\w+)', line)
if match:
hsh = match.group(1)
a, b, c, phash = snapshot.determine_curr_snapshot_info()
if not phash.startswith(hsh):
report_err("Snapshot out of date: " + line)
date, rev = snapshot.curr_snapshot_rev()
if not hsh.startswith(rev):
report_err("snapshot out of date (" + date
+ "): " + line)
else:
if "SNAP" in line:
report_warn("Unmatched SNAP line: " + line)
report_warn("unmatched SNAP line: " + line)
if (line.find('\t') != -1 and
fileinput.filename().find("Makefile") == -1):