do not re-write the class map header if not neccessary

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2016-06-18 12:59:22 +00:00
parent 3a1f7dac3b
commit 441af8a0d9

View file

@ -44,9 +44,10 @@ for component in components:
mapdata += '\n#endif\n'
sys.stdout.write('-- Writing: %s\n' % mapoutput)
with open(mapoutput, 'wb') as f:
if sys.version_info[0] == 3:
f.write(bytes(mapdata, 'utf-8'))
else:
f.write(mapdata)
with open(mapoutput, 'r+b') as f:
if f.read() != mapdata:
sys.stdout.write('-- Writing: %s\n' % mapoutput)
if sys.version_info[0] == 3:
f.write(bytes(mapdata, 'utf-8'))
else:
f.write(mapdata)