aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2012-09-24 05:59:56 +0000
committerJörg Mayer <jmayer@loplof.de>2012-09-24 05:59:56 +0000
commita9ddd42c2844aebd19263b57411d6fe4c831edeb (patch)
tree0a0635cd0358bfabba63e53f2f633073699e6735 /tools
parent88ee7291cf21192b3e934b94adc8adea7c46bf44 (diff)
make-dissector-reg
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
Diffstat (limited to 'tools')
-rwxr-xr-xtools/make-dissector-reg5
-rwxr-xr-xtools/make-dissector-reg.py1
2 files changed, 5 insertions, 1 deletions
diff --git a/tools/make-dissector-reg b/tools/make-dissector-reg
index de486de3e2..62bee69432 100755
--- a/tools/make-dissector-reg
+++ b/tools/make-dissector-reg
@@ -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}
+
diff --git a/tools/make-dissector-reg.py b/tools/make-dissector-reg.py
index 531a63ddbe..b20e052f5d 100755
--- a/tools/make-dissector-reg.py
+++ b/tools/make-dissector-reg.py
@@ -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)