Override manifest file only after it is fully written to disk.

We called "Override()" before closing the file passed in argument.

Change-Id: I15adb99deb14297ef72fcb1b0945eb246f172fb0
This commit is contained in:
Nico Sallembien 2010-04-20 15:28:19 -07:00
parent 5732e47ebb
commit 719965af35

View File

@ -226,13 +226,13 @@ uncommitted changes are present' % project.relpath
f = open(manifest_path, 'w') f = open(manifest_path, 'w')
try: try:
f.write(manifest_str) f.write(manifest_str)
self.manifest.Override(manifest_name)
finally: finally:
f.close() f.close()
except IOError: except IOError:
print >>sys.stderr, 'error: cannot write manifest to %s' % \ print >>sys.stderr, 'error: cannot write manifest to %s' % \
manifest_path manifest_path
sys.exit(1) sys.exit(1)
self.manifest.Override(manifest_name)
else: else:
print >>sys.stderr, 'error: %s' % manifest_str print >>sys.stderr, 'error: %s' % manifest_str
sys.exit(1) sys.exit(1)