Changeset 23975

Show
Ignore:
Timestamp:
29.04.2011 17:18:33 (8 years ago)
Author:
ak19
Message:

Removed repetition in previously committed code to make it tidier and easier to maintain.

Files:
1 modified

Legend:

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

    r23973 r23975  
    141141 
    142142function configure-web { 
    143     if test ! -e "gs2-server.app/Contents/document.wflow" ; then 
    144     sed "s@\*\*GSDLHOME\*\*@$GSDLHOME@g" "gs2-server.app/Contents/document.wflow.in" > "gs2-server.app/Contents/document.wflow" 
    145     fi 
    146     if test ! -e "gli.app/Contents/document.wflow" ; then 
    147     sed "s@\*\*GSDLHOME\*\*@$GSDLHOME@g" "gli.app/Contents/document.wflow.in" > "gli.app/Contents/document.wflow" 
    148     fi 
    149     if test ! -e "client-gli.app/Contents/document.wflow" ; then 
    150     sed "s@\*\*GSDLHOME\*\*@$GSDLHOME@g" "client-gli.app/Contents/document.wflow.in" > "client-gli.app/Contents/document.wflow" 
    151     fi 
    152     if test ! -e "gems.app/Contents/document.wflow" ; then 
    153     sed "s@\*\*GSDLHOME\*\*@$GSDLHOME@g" "gems.app/Contents/document.wflow.in" > "gems.app/Contents/document.wflow" 
    154     fi 
     143    for one_file in gs2-server.app gli.app client-gli.app gems.app ; do      
     144    if test ! -e "$one_file/Contents/document.wflow" ; then 
     145        sed "s@\*\*GSDLHOME\*\*@$GSDLHOME@g" "$one_file/Contents/document.wflow.in" > "$one_file/Contents/document.wflow" 
     146    fi 
     147    done ; 
    155148 
    156149    configure-cgi 
     
    170163    sed "s^@gsdl2home@^$GSDLHOME^g" "$log4jprop.in" > "$log4jprop" 
    171164    
    172     rm -f "gs2-server.app/Contents/document.wflow" 
    173     rm -f "gli.app/Contents/document.wflow" 
    174     rm -f "client-gli.app/Contents/document.wflow" 
    175     rm -f "gems.app/Contents/document.wflow" 
     165    for one_file in gs2-server.app gli.app client-gli.app gems.app ; do  
     166    if test -e "$one_file/Contents/document.wflow" ; then 
     167        rm -f "$one_file/Contents/document.wflow" 
     168    fi 
     169    done ; 
    176170 
    177171    configure-web $1