if [ $(whoami) != "root" ]; then echo "You must run this script as root" echo "Type devel-su password is rootme" exit 1 fi if [ ! -f traffic.patch ]; then echo "Error: I can't find maps.patch" echo "Have you placed it in this current directory?" echo "Quitting with nothing done." exit 1 fi if [ ! -f /etc/apt/sources.list.d/sdk.list ]; then echo "Adding new SDK repos" echo "deb http://harmattan-dev.nokia.com/ harmattan/sdk free non-free" >> /etc/apt/sources.list.d/sdk.list else echo "> SDK repos. already set up" fi if [ ! -f /usr/bin/patch ]; then echo "Installing patch" apt-get install patch else echo "> Found patch utility" fi if [ ! -d /usr/lib/drive-qml-original ]; then echo "> Backing up original files before proceeding" cp -r /usr/lib/drive-qml /usr/lib/drive-qml-original fi echo "Test running patch" patch --dry-run -p0 -i traffic.patch 2>/dev/null if [ $? != "0" ]; then echo ">> Error. Maybe you have previously made changes to the files?" else echo "Patching files" patch -p0 -i traffic.patch fi