Revision 47be38e6 util/install.sh

View differences:

util/install.sh
74 74
# More distribution info
75 75
DIST_LC=`echo $DIST | tr [A-Z] [a-z]` # as lower case
76 76

  
77

  
78
# Determine whether version $1 >= version $2
79
# usage: if version_ge 1.20 1.2.3; then echo "true!"; fi
80
function version_ge {
81
    # sort -V sorts by *version number*
82
    latest=`printf "$1\n$2" | sort -V | tail -1`
83
    # If $1 is latest version, then $1 >= $2
84
    [ "$1" == "$latest" ]
85
}
86

  
87

  
77 88
# Kernel Deb pkg to be removed:
78 89
KERNEL_IMAGE_OLD=linux-image-2.6.26-33-generic
79 90

  
......
196 207
    cd $BUILD_DIR
197 208
}
198 209

  
210

  
199 211
function wireshark {
200 212
    echo "Installing Wireshark"
201 213
    if [ "$DIST" = "Fedora" ]; then
......
204 216
        $install wireshark tshark
205 217
    fi
206 218

  
219
    echo "Checking Wireshark version"
220
    WSVER=`wireshark -v | egrep -o '[0-9\.]+' | head -1`
221
    if version_ge $WSVER 1.12; then
222
        echo "Wireshark version $WSVER >= 1.12 - returning"
223
        return
224
    fi
225

  
207 226
    echo "Cloning LoxiGen and building openflow.lua dissector"
208 227
    cd $BUILD_DIR
209 228
    git clone https://github.com/floodlight/loxigen.git
......
233 252
    OVS_SRC=$BUILD_DIR/openvswitch
234 253
    OVS_TARBALL_LOC=http://openvswitch.org/releases
235 254

  
236
    if [ "$DIST" = "Ubuntu" ] && [ `expr $RELEASE '>=' 12.04` = 1 ]; then
255
    if [ "$DIST" = "Ubuntu" ] && version_ge $RELEASE 12.04; then
237 256
        rm -rf $OVS_SRC
238 257
        mkdir -p $OVS_SRC
239 258
        cd $OVS_SRC
......
382 401
    # Apply patches
383 402
    git checkout -b tutorial-destiny
384 403
    git am $MININET_DIR/mininet/util/nox-patches/*tutorial-port-nox-destiny*.patch
385
    if [ "$DIST" = "Ubuntu" ] && [ `expr $RELEASE '>=' 12.04` = 1 ]; then
404
    if [ "$DIST" = "Ubuntu" ] && version_ge $RELEASE 12.04; then
386 405
        git am $MININET_DIR/mininet/util/nox-patches/*nox-ubuntu12-hacks.patch
387 406
    fi
388 407

  

Also available in: Unified diff