Changeset 32004 for main

Show
Ignore:
Timestamp:
28.09.2017 18:35:51 (2 years ago)
Author:
ak19
Message:

Additional changes to previous commit of makegs2.sh, to allow passing in the optional parameters in any order

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/makegs2.sh

    r32003 r32004  
    11#!/bin/bash 
    22 
    3 # run as: ./makegs2.sh 
    4 # or ./makegs2.sh gnome-lib to compile GS2 using gnome-lib  
    5 # which checks out gnome-lib src from svn if needed and if possible 
     3# run as: ./makegs2.sh [gnome-lib] [imagemagick] 
     4# If gnome-lib passed in, will compile GS2 using gnome-lib  
     5# which checks out gnome-lib src from svn if possible and if needed (if no ext/gnome-lib-minimal) 
     6# If you pass in imagemagick, it will grab the appropriate linux/darwin binary, untar 
     7# this and put its OS subfolder renamed as imagemagick into the bin/os folder. 
    68 
    7 docheckout=$1 
    8 getimagick=$2 
     9getgnomelib= 
     10getimagick= 
     11 
     12# https://stackoverflow.com/questions/20449680/unix-boolean-operators-a-o 
     13if [[ "x$1" == "xgnome-lib" ]]; then  
     14    getgnomelib=$1 
     15elif [[ "x$1" == "ximagemagick" ]]; then  
     16    getimagick=$1 
     17fi 
     18 
     19if [[ "x$2" == "xgnome-lib" ]]; then  
     20    getgnomelib=$2 
     21elif [[ "x$2" == "ximagemagick" ]]; then  
     22    getimagick=$2 
     23fi 
     24 
     25if [ "x$getgnomelib" != "x" ]; then 
     26    echo "Will be getting gnomelib" 
     27fi 
     28if [ "x$getimagick" != "x" ]; then 
     29    echo "Will be getting imagemagick" 
     30fi 
     31 
     32if [[ "x$getgnomelib" == "x" && "x$getimagick" == "x" ]]; then 
     33    echo "No recognised args provided" 
     34fi 
     35 
    936gsdlhome=`pwd` 
    1037echo "**** GSDLHOME: $gsdlhome" 
     
    1946# Compile by chaining the commands with && so it stops at that stage after an error 
    2047cd $gsdlhome 
    21 if [ "x$docheckout" = "xgnome-lib" ]; then 
     48if [ "x$getgnomelib" = "xgnome-lib" ]; then 
    2249    ./configure --enable-gnome-lib-ext --enable-apache-httpd \ 
    2350    && make \ 
     
    3461    # 5. Message to warn user that the env of this x-term uses gnome-lib  
    3562    # and GUIs may not work from this console 
    36     if [ "x$docheckout" = "xgnome-lib" ]; then 
     63    if [ "x$getgnomelib" = "xgnome-lib" ]; then 
    3764    echo "*** The environment for this console has been set to compile Greenstone with gnome-lib." 
    3865    echo "*** As a result, graphical applications may not work well."