From 15c1a0e5e77f666e3e1ce1ee119935e66e70dd93 Mon Sep 17 00:00:00 2001 From: Brian O'Connor Date: Tue, 30 Jul 2013 18:11:20 -0700 Subject: [PATCH] install.sh automatically detects wireshark version and installs correct version of of-dissector fixes #180 --- util/install.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/util/install.sh b/util/install.sh index 1fd7eb0..0521612 100755 --- a/util/install.sh +++ b/util/install.sh @@ -227,6 +227,20 @@ function of13 { cd $BUILD_DIR } +function wireshark_version_check { + # Check Wireshark version + WS=$(which wireshark) + WS_VER_PATCH=(1 10) # targetting wireshark 1.10.0 + WS_VER=($($WS --version | sed 's/[a-z ]*\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1 \2 \3/')) + if [ "${WS_VER[0]}" -lt "${WS_VER_PATCH[0]}" ] || + [[ "${WS_VER[0]}" -le "${WS_VER_PATCH[0]}" && "${WS_VER[1]}" -lt "${WS_VER_PATCH[1]}" ]] + then + # pre-1.10.0 wireshark + echo "Setting revision: pre-ws-1.10.0" + WS_DISSECTOR_REV="pre-ws-1.10.0" + fi +} + function wireshark { echo "Installing Wireshark dissector..." @@ -238,10 +252,14 @@ function wireshark { sudo apt-get install -y libwiretap-dev libwireshark-dev cd $BUILD_DIR hg clone https://bitbucket.org/barnstorm/of-dissector + if [[ -z "$WS_DISSECTOR_REV" ]]; then + wireshark_version_check + fi cd of-dissector if [[ -n "$WS_DISSECTOR_REV" ]]; then hg checkout ${WS_DISSECTOR_REV} fi + # Build dissector cd src export WIRESHARK=/usr/include/wireshark scons