From f8d28b4b7c4be63f7de42d9e371aaf72f6c5f823 Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Sat, 18 Jul 2015 11:47:48 +0000 Subject: [PATCH] Don't break setup when no sudo --- script/setup | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/script/setup b/script/setup index 2621773..7522866 100755 --- a/script/setup +++ b/script/setup @@ -2,30 +2,32 @@ set -e -sudo apt-get install -y autoconf libtool pkg-config +if sudo apt-get install -y autoconf libtool pkg-config; then + if [ ! -e /usr/local/lib/libtsm.a ]; then + echo "libtsm missing, compiling from source..." + DIR=$(mktemp -d -t tsmXXXXXX) + cd $DIR + git clone git://people.freedesktop.org/~dvdhrm/libtsm . + git checkout libtsm-3 + test -f ./configure || NOCONFIGURE=1 ./autogen.sh + ./configure --prefix=/usr/local + make + sudo make install + sudo ldconfig + cd - + fi -if [ ! -e /usr/local/lib/libtsm.a ]; then - echo "libtsm missing, compiling from source..." - DIR=$(mktemp -d -t tsmXXXXXX) - cd $DIR - git clone git://people.freedesktop.org/~dvdhrm/libtsm . - git checkout libtsm-3 - test -f ./configure || NOCONFIGURE=1 ./autogen.sh - ./configure --prefix=/usr/local - make - sudo make install - sudo ldconfig - cd - + if [ -e /usr/local/lib/libtsm.a ]; then + cd src && make && cd - + fi +else + echo "warning: sudo failed, not compiling libtsm and terminal binary" fi if [ ! -e config/database.yml ]; then cp config/database.yml.example config/database.yml fi -if [ -e /usr/local/lib/libtsm.a ]; then - cd src && make && cd - -fi - rm -f log/* bundle install bundle exec rake db:setup