From 3479ad89c68f8538096c55920e75983c69ba72b0 Mon Sep 17 00:00:00 2001 From: Albert Yi Date: Tue, 11 Oct 2016 17:45:58 -0700 Subject: [PATCH] readd postgresql-contrib package; add conditional check for postgresql version before compiling test_parser extension #2707 --- INSTALL.debian | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/INSTALL.debian b/INSTALL.debian index de894cf50..22faf48d7 100644 --- a/INSTALL.debian +++ b/INSTALL.debian @@ -7,6 +7,14 @@ if [[ "$(whoami)" != "root" ]] ; then exit 1 fi +verlte() { + [ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] +} + +verlt() { + [ "$1" = "$2" ] && return 1 || verlte $1 $2 +} + echo "* DANBOORU INSTALLATION SCRIPT" echo "*" echo "* This script will install all the necessary packages to run Danbooru on a " @@ -26,7 +34,7 @@ export GITHUB_INSTALL_SCRIPTS=https://raw.githubusercontent.com/r888888888/danbo # Install packages echo "* Installing packages..." apt-get update -apt-get -y install build-essential automake libssl-dev libxml2-dev libxslt-dev ncurses-dev sudo libreadline-dev flex bison ragel memcached libmemcached-dev git curl libcurl4-openssl-dev imagemagick libmagickcore-dev libmagickwand-dev sendmail-bin sendmail postgresql libpq-dev postgresql-server-dev-all nginx ssh +apt-get -y install build-essential automake libssl-dev libxml2-dev libxslt-dev ncurses-dev sudo libreadline-dev flex bison ragel memcached libmemcached-dev git curl libcurl4-openssl-dev imagemagick libmagickcore-dev libmagickwand-dev sendmail-bin sendmail postgresql postgresql-contrib libpq-dev postgresql-server-dev-all nginx ssh coreutils if [ $? -ne 0 ]; then echo "* Error installing packages; aborting" @@ -40,9 +48,12 @@ usermod -G danbooru,sudo danbooru # Set up Postgres export PG_VERSION=`pg_config --version | egrep -o '[0-9]{1,}\.[0-9]{1,}'` -git clone https://github.com/r888888888/test_parser.git /tmp/test_parser -cd /tmp/test_parser -make install +if verlte 9.5 $PG_VERSION ; then + # only do this on postgres 9.5 and above + git clone https://github.com/r888888888/test_parser.git /tmp/test_parser + cd /tmp/test_parser + make install +fi # Install rbenv echo "* Installing rbenv..."