Index: /other-projects/nightly-tasks/diffcol/trunk/gen-model-colls.sh
===================================================================
--- /other-projects/nightly-tasks/diffcol/trunk/gen-model-colls.sh	(revision 28147)
+++ /other-projects/nightly-tasks/diffcol/trunk/gen-model-colls.sh	(revision 28148)
@@ -124,6 +124,21 @@
     # section "Exclude multiple files and directories at the same time" (can also use a file to blacklist folders/files)
 
+    # for GS3 we have a custom ignore file
+#    if [ "x$GSDL3SRCHOME" != "x" ]; then
+#	mkdir model-collect/$collection
+#	svn add --force model-collect/$collection
+#	svn propset -R svn:ignore -F model-collect/.customignore model-collect/$collection
+#
+#	if [ "x$commit_message" == "x" ]; then
+#	    commit_message="Adding new model collections 1/2: new empty collection dir with svn-ignore set."
+#	fi
+#	if [ "$debug_mode" -eq "0" ]; then
+#	    svn commit -m "AUTOCOMMIT by gen-model-colls.sh script. Message: $commit_message" model-collect/$collection
+#	fi
+#    fi
+
+
     # need slash on end of src dir collect/$collection/ !
-    rsync -r --exclude=.svn/ --exclude=log/ --exclude=cache/ --exclude=earliestDatestamp collect/$collection/ model-collect/$collection
+    rsync -r --exclude=.svn/ --exclude=log/ --exclude=cache/ --exclude=earliestDatestamp --exclude=fail.log --exclude=collectionConfig.bak collect/$collection/ model-collect/$collection
 
 #    find collect/$collection -name ".svn" -type d -exec rm -rf {} \;
@@ -381,7 +396,14 @@
    
     collection=$(get_col_basename $collection)
-    
-    import.pl -removeold $collection
-    buildcol.pl -removeold $collection
+
+    # GS2 or GS3 building
+    if [ "x$GSDL3SRCHOME" == "x" ]; then
+	import.pl -removeold $collection;
+	buildcol.pl -removeold $collection;
+    else
+	import.pl -site localsite -removeold $collection
+	buildcol.pl -site localsite -removeold $collection
+    fi
+
     rm -rf collect/$collection/index
     mv collect/$collection/building collect/$collection/index
@@ -490,20 +512,25 @@
 
 
-# Set up the Greenstone environment, this is mainly for building, 
-# but also for locating a Greenstone installation folder, in case this script doesn't live in one
-# Test for GS3 home env then for GS2 home and if found, cd into the 
-# GS2/GS3 home location and run setup, 
-# else try to find setup.bash/gs3-setup.bash in the current location and 
-# run it.
+# Set up the Greenstone environment, this is mainly for building, but also for locating a 
+# Greenstone installation folder, in case this script doesn't live in one.
+# Then cd into the collect folder's parent for the Greenstone installation.
+# Test for GS3 home env then for GS2 home and if found, cd into the GS2/GS3 home location and
+# run setup, else try to find setup.bash/gs3-setup.bash in the current location and run it.
 # Else print a warning message saying that GSDLHOME is not set.
-if [ "$GSDLHOME" != "" ]; then
+if [ "$GSDL3SRCHOME" != "" ]; then
+    echo "cd-ing into Greenstone 3 home directory: $GSDL3SRCHOME"
+    cd "$GSDL3SRCHOME/web/sites/localsite"
+elif [ "$GSDLHOME" != "" ]; then
     echo "cd-ing into Greenstone home directory: $GSDLHOME"
     cd "$GSDLHOME"
 else
-    if [ -e setup.bash ]; then
+    if [ -e gs3-setup.sh ]; then
+	source ./gs3-setup.sh
+	cd "$GSDL3SRCHOME/web/sites/localsite"
+    elif [ -e setup.bash ]; then
 	source ./setup.bash
     else
-	echo "No GSDLHOME set and no setup script found in current folder." 
-	echo "Please source the setup script in a Greenstone installation. Exiting."
+	echo "No Greenstone Home set and no setup script found in current folder." 
+	echo "You need to source the setup script in a Greenstone installation. Exiting."
 	exit -1
     fi
@@ -530,12 +557,15 @@
 fi
 
-# Need pdfbox for the PDFBox tutorial
-if [ ! -e ext/pdf-box ]; then
-    cd ext
-    if [ ! -e ext/pdf-box-java.tar.gz ]; then
+# Need the pdfbox extension for the PDFBox tutorial
+# The PDFBox ext has to be placed in the *GSDLHOME*/ext, 
+# also in GS3's case where GSDLHOME is GS3/gs2build/ext
+# Go into ext and at end popd to get back into the collect folder's parent for the GS installation
+if [ ! -e "$GSDLHOME/ext/pdf-box" ]; then
+    pushd "$GSDLHOME/ext"
+    if [ ! -e "$GSDLHOME/ext/pdf-box-java.tar.gz" ]; then
 	wget http://trac.greenstone.org/export/head/gs2-extensions/pdf-box/trunk/pdf-box-java.tar.gz
-	tar -xvzf pdf-box-java.tar.gz
-    fi
-    cd ..
+    fi
+    tar -xvzf pdf-box-java.tar.gz
+    popd
 fi
 
@@ -560,5 +590,9 @@
     fi
 else
-    svn co http://svn.greenstone.org/other-projects/nightly-tasks/diffcol/trunk/model-collect
+    if [ "$GSDL3SRCHOME" != "" ]; then
+	svn co http://svn.greenstone.org/other-projects/nightly-tasks/diffcol/trunk/gs3-model-collect model-collect
+    else
+	svn co http://svn.greenstone.org/other-projects/nightly-tasks/diffcol/trunk/model-collect
+    fi
 fi
 
