From 441af8a0d9768d630953f4b255c76ffc7dda6add Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 18 Jun 2016 12:59:22 +0000 Subject: [PATCH] do not re-write the class map header if not neccessary Signed-off-by: Ivailo Monev --- scripts/genmap.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/genmap.py b/scripts/genmap.py index 1f0faa4fa..3f5b53fbd 100755 --- a/scripts/genmap.py +++ b/scripts/genmap.py @@ -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) \ No newline at end of file +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) \ No newline at end of file -- 2.11.0