Ignore:
Timestamp:
08/26/13 20:54:43 (7 years ago)
Author:
ak19
Message:

Updated the script to handle generating model collections for Greenstone 3 as well and tested it by using it build the GS3 model cols previously built on Windows and commit them. Also some corrections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/nightly-tasks/diffcol/trunk/gen-model-colls.sh

    r28133 r28148  
    124124    # section "Exclude multiple files and directories at the same time" (can also use a file to blacklist folders/files)
    125125
     126    # for GS3 we have a custom ignore file
     127#    if [ "x$GSDL3SRCHOME" != "x" ]; then
     128#   mkdir model-collect/$collection
     129#   svn add --force model-collect/$collection
     130#   svn propset -R svn:ignore -F model-collect/.customignore model-collect/$collection
     131#
     132#   if [ "x$commit_message" == "x" ]; then
     133#       commit_message="Adding new model collections 1/2: new empty collection dir with svn-ignore set."
     134#   fi
     135#   if [ "$debug_mode" -eq "0" ]; then
     136#       svn commit -m "AUTOCOMMIT by gen-model-colls.sh script. Message: $commit_message" model-collect/$collection
     137#   fi
     138#    fi
     139
     140
    126141    # need slash on end of src dir collect/$collection/ !
    127     rsync -r --exclude=.svn/ --exclude=log/ --exclude=cache/ --exclude=earliestDatestamp collect/$collection/ model-collect/$collection
     142    rsync -r --exclude=.svn/ --exclude=log/ --exclude=cache/ --exclude=earliestDatestamp --exclude=fail.log --exclude=collectionConfig.bak collect/$collection/ model-collect/$collection
    128143
    129144#    find collect/$collection -name ".svn" -type d -exec rm -rf {} \;
     
    381396   
    382397    collection=$(get_col_basename $collection)
    383    
    384     import.pl -removeold $collection
    385     buildcol.pl -removeold $collection
     398
     399    # GS2 or GS3 building
     400    if [ "x$GSDL3SRCHOME" == "x" ]; then
     401    import.pl -removeold $collection;
     402    buildcol.pl -removeold $collection;
     403    else
     404    import.pl -site localsite -removeold $collection
     405    buildcol.pl -site localsite -removeold $collection
     406    fi
     407
    386408    rm -rf collect/$collection/index
    387409    mv collect/$collection/building collect/$collection/index
     
    490512
    491513
    492 # Set up the Greenstone environment, this is mainly for building,
    493 # but also for locating a Greenstone installation folder, in case this script doesn't live in one
    494 # Test for GS3 home env then for GS2 home and if found, cd into the
    495 # GS2/GS3 home location and run setup,
    496 # else try to find setup.bash/gs3-setup.bash in the current location and
    497 # run it.
     514# Set up the Greenstone environment, this is mainly for building, but also for locating a
     515# Greenstone installation folder, in case this script doesn't live in one.
     516# Then cd into the collect folder's parent for the Greenstone installation.
     517# Test for GS3 home env then for GS2 home and if found, cd into the GS2/GS3 home location and
     518# run setup, else try to find setup.bash/gs3-setup.bash in the current location and run it.
    498519# Else print a warning message saying that GSDLHOME is not set.
    499 if [ "$GSDLHOME" != "" ]; then
     520if [ "$GSDL3SRCHOME" != "" ]; then
     521    echo "cd-ing into Greenstone 3 home directory: $GSDL3SRCHOME"
     522    cd "$GSDL3SRCHOME/web/sites/localsite"
     523elif [ "$GSDLHOME" != "" ]; then
    500524    echo "cd-ing into Greenstone home directory: $GSDLHOME"
    501525    cd "$GSDLHOME"
    502526else
    503     if [ -e setup.bash ]; then
     527    if [ -e gs3-setup.sh ]; then
     528    source ./gs3-setup.sh
     529    cd "$GSDL3SRCHOME/web/sites/localsite"
     530    elif [ -e setup.bash ]; then
    504531    source ./setup.bash
    505532    else
    506     echo "No GSDLHOME set and no setup script found in current folder."
    507     echo "Please source the setup script in a Greenstone installation. Exiting."
     533    echo "No Greenstone Home set and no setup script found in current folder."
     534    echo "You need to source the setup script in a Greenstone installation. Exiting."
    508535    exit -1
    509536    fi
     
    530557fi
    531558
    532 # Need pdfbox for the PDFBox tutorial
    533 if [ ! -e ext/pdf-box ]; then
    534     cd ext
    535     if [ ! -e ext/pdf-box-java.tar.gz ]; then
     559# Need the pdfbox extension for the PDFBox tutorial
     560# The PDFBox ext has to be placed in the *GSDLHOME*/ext,
     561# also in GS3's case where GSDLHOME is GS3/gs2build/ext
     562# Go into ext and at end popd to get back into the collect folder's parent for the GS installation
     563if [ ! -e "$GSDLHOME/ext/pdf-box" ]; then
     564    pushd "$GSDLHOME/ext"
     565    if [ ! -e "$GSDLHOME/ext/pdf-box-java.tar.gz" ]; then
    536566    wget http://trac.greenstone.org/export/head/gs2-extensions/pdf-box/trunk/pdf-box-java.tar.gz
    537     tar -xvzf pdf-box-java.tar.gz
    538     fi
    539     cd ..
     567    fi
     568    tar -xvzf pdf-box-java.tar.gz
     569    popd
    540570fi
    541571
     
    560590    fi
    561591else
    562     svn co http://svn.greenstone.org/other-projects/nightly-tasks/diffcol/trunk/model-collect
     592    if [ "$GSDL3SRCHOME" != "" ]; then
     593    svn co http://svn.greenstone.org/other-projects/nightly-tasks/diffcol/trunk/gs3-model-collect model-collect
     594    else
     595    svn co http://svn.greenstone.org/other-projects/nightly-tasks/diffcol/trunk/model-collect
     596    fi
    563597fi
    564598
Note: See TracChangeset for help on using the changeset viewer.