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 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 i = 0
platform = get_platform(triple) 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" % raise Exception("no snapshot file found for platform %s, rev %s" %
(platform, rev)) (platform, rev))
return (date, rev, platform, hsh) return full_snapshot_name(date, rev, platform, hsh)
def determine_curr_snapshot(triple):
return full_snapshot_name(*determine_curr_snapshot_info(triple))

View File

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