Revision 15c1a0e5

View differences:

util/install.sh
227 227
    cd $BUILD_DIR
228 228
}
229 229

  
230
function wireshark_version_check {
231
    # Check Wireshark version
232
    WS=$(which wireshark)
233
    WS_VER_PATCH=(1 10) # targetting wireshark 1.10.0
234
    WS_VER=($($WS --version | sed 's/[a-z ]*\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1 \2 \3/'))
235
    if [ "${WS_VER[0]}" -lt "${WS_VER_PATCH[0]}" ] ||
236
       [[ "${WS_VER[0]}" -le "${WS_VER_PATCH[0]}" && "${WS_VER[1]}" -lt "${WS_VER_PATCH[1]}" ]]
237
    then
238
        # pre-1.10.0 wireshark
239
        echo "Setting revision: pre-ws-1.10.0"
240
        WS_DISSECTOR_REV="pre-ws-1.10.0" 
241
    fi
242
}
243

  
230 244
function wireshark {
231 245
    echo "Installing Wireshark dissector..."
232 246

  
......
238 252
        sudo apt-get install -y libwiretap-dev libwireshark-dev
239 253
        cd $BUILD_DIR
240 254
        hg clone https://bitbucket.org/barnstorm/of-dissector
255
        if [[ -z "$WS_DISSECTOR_REV" ]]; then
256
            wireshark_version_check
257
        fi
241 258
        cd of-dissector
242 259
        if [[ -n "$WS_DISSECTOR_REV" ]]; then
243 260
            hg checkout ${WS_DISSECTOR_REV}
244 261
        fi
262
        # Build dissector
245 263
        cd src
246 264
        export WIRESHARK=/usr/include/wireshark
247 265
        scons

Also available in: Unified diff