#! /bin/bash

upxroot=./upx-src
upxurl=https://github.com/upx/upx.git

git clone $upxurl $upxroot

if [ "$?" != "0" ]
then
pushd $upxroot
    G_RESULT=`LANG=en_US.UTF8 git pull | grep "Already up to date"`
    git submodule update --init
popd
    if [ "$G_RESULT" != "" ]
    then
    echo $G_RESULT
    exit
    fi
else
pushd $upxroot
    git submodule update --init
popd
fi

echo "Update upx Ok :)"