about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-09-10 23:06:21 +0100
committerJames Booth <boothj5@gmail.com>2012-09-10 23:06:21 +0100
commitc0f53cc1b4c50e40f22b90c6ea8c77b02e534a41 (patch)
tree15282b8ef18c2b0fa98fad48fba16e68629681ad
parent6b1b035d9239930558667a63692d36dfaf15bb07 (diff)
parent5df7d0cff194c5255f2ffa69aea48ebf7afc2a4d (diff)
downloadprofani-tty-c0f53cc1b4c50e40f22b90c6ea8c77b02e534a41.tar.gz
Merge branch 'master' into development
-rwxr-xr-xupgrade.sh72
1 files changed, 59 insertions, 13 deletions
diff --git a/upgrade.sh b/upgrade.sh
index 230dec64..e2ed3d3b 100755
--- a/upgrade.sh
+++ b/upgrade.sh
@@ -1,14 +1,60 @@
 #!/bin/sh
-echo
-echo Profanity installer... upgrading Profanity
-echo
-./bootstrap.sh
-./configure
-make clean
-make
-sudo make install
-echo
-echo Profanity installer... upgrade complete!
-echo
-echo Type \'profanity\' to run.
-echo
+
+linux_upgrade()
+{
+    echo
+    echo Profanity installer... upgrading Profanity
+    echo
+    ./bootstrap.sh
+    ./configure
+    make clean
+    make
+    sudo make install
+    echo
+    echo Profanity installer... upgrade complete!
+    echo
+    echo Type \'profanity\' to run.
+    echo
+}
+
+cygwin_upgrade()
+{
+    echo
+    echo Profanity installer... upgrading Profanity
+    echo
+    export LIBRARY_PATH=/usr/local/lib
+    ./bootstrap.sh
+    ./configure
+    make clean
+    make
+    make install
+    echo
+    echo Profanity installer... upgrade complete!
+    echo
+    echo Type \'profanity\' to run.
+    echo
+}
+
+OS=`uname -s`
+SYSTEM=unknown
+
+if [ "${OS}" = "Linux" ]; then
+    SYSTEM=linux
+else
+    echo $OS | grep -i cygwin
+    if [ "$?" -eq 0 ]; then
+        SYSTEM=cygwin
+    fi
+fi
+
+case "$SYSTEM" in
+unknown)    echo The upgrade script will not work on this OS.
+            echo Try a manual upgrade instead.
+            exit
+            ;;
+linux)      linux_upgrade
+            ;;
+cygwin)     cygwin_upgrade
+            ;;
+esac
+