make-dissector-reg
authorJörg Mayer <jmayer@loplof.de>
Mon, 24 Sep 2012 05:59:56 +0000 (05:59 -0000)
committerJörg Mayer <jmayer@loplof.de>
Mon, 24 Sep 2012 05:59:56 +0000 (05:59 -0000)
Only update outfile if it differs from newly created outfile
make-dissector-reg.py
Add a comment that we should do the same here (probably a small
task for python knowledeable people).

svn path=/trunk/; revision=45083

tools/make-dissector-reg
tools/make-dissector-reg.py

index de486de3e227626be2fd6647fd59d3063b685a6c..62bee694326a909b896e63515dffa42a16f32c99 100755 (executable)
@@ -181,4 +181,7 @@ EOF
        echo "  return $proto_regs + $handoff_regs;" >>${outfile}-tmp
        echo '}' >>${outfile}-tmp
 fi
-mv ${outfile}-tmp ${outfile}
+
+# Only overwrite outfile if it differs from newly generated file
+diff ${outfile}-tmp ${outfile} >/dev/null || mv ${outfile}-tmp ${outfile}
+
index 531a63ddbefdd7c0d5add01bdbc2296ba0c337a9..b20e052f5d02b51905a71628345a5255469a33a9 100755 (executable)
@@ -302,4 +302,5 @@ except OSError:
        pass
 
 # Move from tmp file to final file
+# FIXME: only overwrite final_filename if it differes from tmp_filename
 os.rename(tmp_filename, final_filename)