diff options
author | Роман Донченко <dpb@corrigendum.ru> | 2014-07-06 20:59:56 +0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-07-07 07:24:24 +0000 |
commit | 4ce4e3a41e80aa7f4b45db2877979b7377ba2371 (patch) | |
tree | fe18439cc2d1a191ffb864db7ca074d86b28d94c | |
parent | 4cdd17a59dca0c9d2597d7974846e2b8ad9e1462 (diff) | |
download | wireshark-4ce4e3a41e80aa7f4b45db2877979b7377ba2371.tar.gz |
make-dissector-reg: minor tweaks
* use grep -c instead of a grep/wc combo;
* use cmp instead of diff, since we're only interested in whether the files
are identical;
* remove the temporary file if it's the same as the existing one.
Change-Id: If61c5675535c483b9dc2aee179d7be58c7bd6e4f
Reviewed-on: https://code.wireshark.org/review/2894
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rwxr-xr-x | tools/make-dissector-reg | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/make-dissector-reg b/tools/make-dissector-reg index 72e896d0b2..baeb41d642 100755 --- a/tools/make-dissector-reg +++ b/tools/make-dissector-reg @@ -131,12 +131,16 @@ else gulong register_count(void) { EOF - proto_regs=`grep RA_REGISTER ${outfile}-tmp | wc -l` - handoff_regs=`grep RA_HANDOFF ${outfile}-tmp | wc -l` + proto_regs=`grep -c RA_REGISTER ${outfile}-tmp` + handoff_regs=`grep -c RA_HANDOFF ${outfile}-tmp` echo " return $proto_regs + $handoff_regs;" >>${outfile}-tmp echo '}' >>${outfile}-tmp fi # Only overwrite outfile if it differs from newly generated file -diff ${outfile}-tmp ${outfile} >/dev/null || mv ${outfile}-tmp ${outfile} - +if cmp -s ${outfile}-tmp ${outfile} +then + rm ${outfile}-tmp +else + mv ${outfile}-tmp ${outfile} +fi |