diff options
Diffstat (limited to 'src')
| -rwxr-xr-x | src/etc/get-snapshot.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/etc/get-snapshot.py b/src/etc/get-snapshot.py index 9a076af0..f1a85189 100755 --- a/src/etc/get-snapshot.py +++ b/src/etc/get-snapshot.py @@ -35,24 +35,24 @@ def determine_curr_snapshot_for_platform(): date = None rev = None - with open(snapshotfile) as f: - for line in f.xreadlines(): - i += 1 - parsed = parse_line(i, line) - if (not parsed): continue - - if parsed["type"] == "transition": - raise Exception("working on a transition, not updating stage0") - - if found_snap and parsed["type"] == "file": - if parsed["platform"] == platform: - hsh = parsed["hash"] - found_file = True - break; - elif parsed["type"] == "snapshot": - date = parsed["date"] - rev = parsed["rev"] - found_snap = True + f = open(snapshotfile) + for line in f.readlines(): + i += 1 + parsed = parse_line(i, line) + if (not parsed): continue + + if parsed["type"] == "transition": + raise Exception("working on a transition, not updating stage0") + + if found_snap and parsed["type"] == "file": + if parsed["platform"] == platform: + hsh = parsed["hash"] + found_file = True + break; + elif parsed["type"] == "snapshot": + date = parsed["date"] + rev = parsed["rev"] + found_snap = True if not found_snap: raise Exception("no snapshot entries in file") |