Index: /main/trunk/gs-release-builder/create-gs2-caveat-linux64.sh
===================================================================
--- /main/trunk/gs-release-builder/create-gs2-caveat-linux64.sh	(revision 36212)
+++ /main/trunk/gs-release-builder/create-gs2-caveat-linux64.sh	(revision 36212)
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+# This must be run in lsb environment
+
+echo `date`
+
+
+if [ "x$1" != "xwrap" ]; then
+    echo "RUNNING GS2 CAVEAT at " `date` > out.txt
+    env >> out.txt
+    cd /gs-release-builder/envi/bin
+    ./envi gs2-caveat-x64 $*
+else
+
+# REDO the WRAP step, in case it failed
+# - prepend release-kits/bin to PATH (and also have access to svn)
+#source ./setup-env.sh
+# - go to the release folder and run the steps for the wrap stage:
+#cd /home/sjm84/snapshots/gs2-caveat-x64/from-*
+#rk2 create-installer
+#rk2 wrap
+# go back and run the upload step
+#cd /
+##cd -
+#./run-gs2-caveat.sh upload
+
+
+# $1 = "wrap"
+# On the 32 bit linux, the wrapping stage sometimes 
+# fails when calculating sizeof during wrapping
+# Everything until then has usually worked, so we just
+# re-try wrapping to make the nightly binaries go through
+
+    cd /gs-release-builder
+    source ./setup-env.sh
+
+    export PATH=/gs-release-builder/release-kits/bin/:$PATH
+
+    # the star at the end does tab-completion
+    cd /gs-release-builder/snapshots/gs2-caveat-x64/from*
+    
+    # store a copy of the original build log
+    mv rk2.out rk2orig.out
+
+    #rk2 create-installer
+    rk2 wrap
+
+    # concatenate current log to the original build log, overwriting any previous rk2.out
+    # http://stackoverflow.com/questions/2150614/bash-shell-scripting-combining-txt-into-one-file
+    mv rk2.out rk2wrap.out
+    cat rk*.out > rk2.out
+    rm rk2wrap.out
+    rm rk2orig.out
+
+    # generate the files for upload 
+    cd /gs-release-builder/envi/bin
+    ./envi gs2-caveat-x64 upload
+
+    # back to lsb root
+    cd /
+fi
Index: /main/trunk/gs-release-builder/create-gs3-caveat-linux64.sh
===================================================================
--- /main/trunk/gs-release-builder/create-gs3-caveat-linux64.sh	(revision 36212)
+++ /main/trunk/gs-release-builder/create-gs3-caveat-linux64.sh	(revision 36212)
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+
+if [ "x$1" != "xwrap" ]; then
+    echo "RUNNING GS3 CAVEAT at " `date` > out.txt
+    env >> out.txt
+    # this doesn't work as envi wipes out the environment
+    #cd /greenstone/release-kits
+    #source ./rk-setup.bash
+    cd /gs-release-builder/envi/bin
+    ./envi.pl gs3-caveat-x64 $*
+
+else
+# $1 = "wrap"
+# On the 32 bit linux, the wrapping stage sometimes 
+# fails when calculating sizeof during wrapping
+# Everything until then has usually worked, so we just
+# re-try wrapping to make the nightly binaries go through
+
+    cd /gs-release-builder
+    source ./setup-env.sh
+
+    export PATH=/gs-release-builder/release-kits/bin/:$PATH
+
+    # the star at the end does tab-completion
+    cd /gs-release-builder/snapshots/gs3-caveat-x64/from*
+    
+    # store a copy of the original build log
+    mv rk3.out rk3orig.out
+
+    #rk3 create-installer
+    rk3 wrap
+
+    # concatenate current log to the original build log, overwriting any previous rk3.out
+    # http://stackoverflow.com/questions/2150614/bash-shell-scripting-combining-txt-into-one-file
+    mv rk3.out rk3wrap.out
+    cat rk*.out > rk3.out
+    rm rk3wrap.out
+    rm rk3orig.out
+
+    # upload the newly wrapped binary and the log
+    cd /gs-release-builder/envi/bin
+    ./envi gs3-caveat-x64 upload
+
+    # back to lsb root
+    cd /
+fi
Index: /main/trunk/gs-release-builder/envi/bin/envi.bat
===================================================================
--- /main/trunk/gs-release-builder/envi/bin/envi.bat	(revision 36212)
+++ /main/trunk/gs-release-builder/envi/bin/envi.bat	(revision 36212)
@@ -0,0 +1,4 @@
+@echo off
+pushd "%~dp0"
+envi.pl %1 %2 %3 %4 %5 %6 %7 %8 %9
+popd
Index: /main/trunk/gs-release-builder/envi/bin/envi.pl
===================================================================
--- /main/trunk/gs-release-builder/envi/bin/envi.pl	(revision 36212)
+++ /main/trunk/gs-release-builder/envi/bin/envi.pl	(revision 36212)
@@ -0,0 +1,125 @@
+#!/usr/bin/perl -w
+
+use strict;
+use File::Spec::Functions qw(rel2abs);
+use File::Basename;
+use Getopt::Long;
+
+#unset the environment
+BEGIN {
+	if ( $^O eq "MSWin32" && exists $ENV{'HOMEDRIVE'} && exists $ENV{'HOMEPATH'} ) {
+		$ENV{'HOME'} = $ENV{'HOMEDRIVE'} . $ENV{'HOMEPATH'};
+	} elsif ( $^O eq "MSWin32" ) {
+		$ENV{'HOME'} = "";
+	} else {
+		foreach my $key (keys %ENV) {
+			#if ( $^O eq "MSWin32" && $key !~ "^(HOME|USERNAME|USERPROFILE|COMMONPROGRAMFILES|APPDATA|PROGRAMFILES|LOCALAPPDATA|HOMEPATH|USERDOMAIN|PROGRAMDATA|SYSTEMDRIVE|SYSTEMROOT|WINDIR|VS71COMNTOOLS|NUMBER_OF_PROCESSORS|OS|PATHEXT|PROCESSOR_ARCHITECTURE|PROCESSOR_LEVEL|PROCESSOR_REVISION|TEMP|TMP|PATH)\$" ) {
+			#	delete($ENV{$key});
+			#} elsif ( $key !~ "^(USER|HOME)\$" ) {
+			if ( $key !~ "^(USER|HOME)\$" ) {
+				delete($ENV{$key});
+			}
+		}
+	}
+}
+
+#options and arguments
+our $envi_verbose = 2; # set to 0 for no verboseness
+my $action = "";
+
+#figure out envi home
+$ENV{'ENVI_HOME'}=dirname(dirname(rel2abs($0)));
+
+#import utility functions
+do "$ENV{'ENVI_HOME'}/lib/util.pl";
+
+#parse options
+Getopt::Long::Configure('require_order'); #don't read options after the first argument
+GetOptions (
+	'v|verbose' => \$envi_verbose
+	);
+
+#parse arguments
+if ( @ARGV > 0 ) {
+	$action = $ARGV[0];
+	shift(@ARGV);
+}
+
+#show options / arguments
+envi_message( "verbose:    '$envi_verbose'" );
+envi_message( "action:     $action");
+
+#set the environment
+if ( -f "$ENV{'ENVI_HOME'}/etc/environment.pl" ) {
+	envi_message( "Sourcing system environment" );
+	do "$ENV{'ENVI_HOME'}/etc/environment.pl";
+}
+
+if ( -f "$ENV{'HOME'}/.envi/environment.pl" ) {
+	envi_message( "Sourcing user environment");
+	do "$ENV{'HOME'}/.envi/environment.pl";
+}
+
+#if no argument given, run default
+if ( "$action" eq "" ) {
+	print "------------------------------------------------------------\n";
+	print "EnvI Version 1.0\n";
+	print "Installed at: $ENV{'ENVI_HOME'}\n";
+	print "Run 'envi tasks' for a list of tasks\n";
+	print "Run 'envi TASKNAME' to run task with task with name TASKNAME\n";
+	print "------------------------------------------------------------\n";
+
+#if 'tasks' given as argument, show all available tasks
+} elsif ( "$action" eq "tasks" ) {
+	list_tasks();
+
+#if 'playlists' given as argument, show all available playlists
+} elsif ( "$action" eq "playlists" ) {
+	list_playlists();
+
+#if 'home' given as argument, show envi home
+} elsif ( "$action" eq "home" ) {
+	print "$ENV{'ENVI_HOME'}\n";
+
+#if 'env' given as argument, show or use the envi environment
+} elsif ( "$action" eq "env" ) {
+	
+	# - run something in the envi environment
+	if ( exists $ARGV[0] ) {
+		my $command = $ARGV[0] . " ";
+		shift(@ARGV);
+		for my $a ( @ARGV ) {
+			$command .= " \"$a\"";
+		}
+		system( $command );
+
+	# - show task environment
+	} else {
+		foreach my $key (keys %ENV) {
+			print "$key=$ENV{$key}\n";
+		}
+	}
+
+#if default specified explicitly, run it
+} elsif ( "$action" eq "default" ) {
+	run_default_tasks();
+
+#if other argument given, run the specified task or playlist
+} else {
+
+	#if an existent playlist was specified, run it
+	if ( playlist_exists($action) ) {
+		run_playlist($action);
+
+	#if an existent task was specified, run it
+	} elsif ( task_exists($action) ) {
+		run_task( $action );
+	
+	#otherwise, report no such task
+	} else {
+		print "no such task, playlist or option as '$action'\n"
+	}
+
+}
+
+
Index: /main/trunk/gs-release-builder/envi/etc/environment.pl
===================================================================
--- /main/trunk/gs-release-builder/envi/etc/environment.pl	(revision 36212)
+++ /main/trunk/gs-release-builder/envi/etc/environment.pl	(revision 36212)
@@ -0,0 +1,6 @@
+$ENV{'ANT_HOME'} = "/gs-release-builder/packages/apache-ant-1.9.4";
+$ENV{'PATH'} = "/gs-release-builder/packages/subversion/linux/bin:$ENV{'ANT_HOME'}/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin";
+$ENV{'LANG'} = "en_NZ.UTF-8";
+$ENV{'SHELL'} = "bin/bash";
+$ENV{'TERM'} = "xterm";
+$ENV{'LC_ALL'} = "C";
Index: /main/trunk/gs-release-builder/envi/lib/rt.pl
===================================================================
--- /main/trunk/gs-release-builder/envi/lib/rt.pl	(revision 36212)
+++ /main/trunk/gs-release-builder/envi/lib/rt.pl	(revision 36212)
@@ -0,0 +1,67 @@
+if ( ! exists $ENV{'ENVI_HOME'} || ! exists $ARGV[0] ) {
+	die "please run 'envi', not 'rt.pl'\n";
+}
+
+do "$ENV{'ENVI_HOME'}/lib/util.pl";
+
+my $task = $ARGV[0]; shift(@ARGV);
+my $task_executable = task_location($task) . "/task.pl";
+my $task_options = task_location($task) . "/options.txt";
+
+#set task home and name for the benefit of the task
+$ENV{'TASK_HOME'} = task_location($task);
+$ENV{'TASK_NAME'} = $task;
+
+#setup the task environment
+if ( -f system_task_environment_script($task) ) {
+	envi_message( "getting $task system env");
+	my $v = system_task_environment_script($task);
+	do $v;
+}
+if ( -f user_task_environment_script($task) ) {
+	envi_message( "getting $task user env");
+	my $v = user_task_environment_script($task);
+	do $v;
+}
+
+#do what they asked:
+if ( $ARGV[0] eq "env" ) {
+
+	shift(@ARGV);
+	
+	# - run something in the task environment
+	if ( exists $ARGV[0] ) {
+		my $command = $ARGV[0] . " ";
+		shift(@ARGV);
+		for my $a ( @ARGV ) {
+			$command .= " \"$a\"";
+		}
+		system( $command );
+
+	# - show task environment
+	} else {
+		foreach my $key (keys %ENV) {
+			print "$key=$ENV{$key}\n";
+		}
+	}
+
+# - show task options
+} elsif ( $ARGV[0] eq "options" ) {
+	if ( -f "$task_options" ) {
+	    open( FILE, "< $task_options" ) or die "Can't open $filename : $!";
+	    while( <FILE> ) {
+	        print;
+    	}
+	    close FILE;
+	}
+
+# - run the task
+} else {
+	my $command = "perl \"$task_executable\"";
+	for my $a ( @ARGV ) {
+		$command .= " \"$a\"";
+	}
+
+	envi_message( "task command: $command" );
+	system( $command );
+}
Index: /main/trunk/gs-release-builder/envi/lib/source.bash
===================================================================
--- /main/trunk/gs-release-builder/envi/lib/source.bash	(revision 36212)
+++ /main/trunk/gs-release-builder/envi/lib/source.bash	(revision 36212)
@@ -0,0 +1,6 @@
+#!/bin/bash
+if [ -f $1 ]; then
+	source $1 &> /dev/null
+	echo '-- ENVIRONMENT "'$2'" --'
+	env
+fi
Index: /main/trunk/gs-release-builder/envi/lib/source.bat
===================================================================
--- /main/trunk/gs-release-builder/envi/lib/source.bat	(revision 36212)
+++ /main/trunk/gs-release-builder/envi/lib/source.bat	(revision 36212)
@@ -0,0 +1,6 @@
+@echo off
+if exist %1 (
+        call %1 > nul 2>&1
+        echo -- ENVIRONMENT %2 --
+        set
+)
Index: /main/trunk/gs-release-builder/envi/lib/util.pl
===================================================================
--- /main/trunk/gs-release-builder/envi/lib/util.pl	(revision 36212)
+++ /main/trunk/gs-release-builder/envi/lib/util.pl	(revision 36212)
@@ -0,0 +1,239 @@
+use File::Basename;
+
+#envi messages
+sub envi_message {
+	my($message) = @_;
+	if ( $envi_verbose ) {
+		print "envi message: $message\n";
+	}
+}
+
+#TASK FUNCTIONS
+sub task_location {
+
+	if ( !exists $_[0] ) { return ""; }
+
+	local $task = $_[0];
+
+	local @locations = ( "$ENV{'HOME'}/.envi/tasks", "$ENV{'ENVI_HOME'}/etc/tasks" );
+	foreach (@locations) {
+		#try for basic task with one name
+		if ( -f "$_/$task/task.pl" ) {
+			return "$_/$task";
+		#try for link to another task
+		} elsif ( -f "$_/$task" ) {
+			open (TASKFILE, "$_/$task");
+			$line = <TASKFILE>;
+			chomp $line;
+			close (TASKFILE);
+			if ( $line =~ "alias-for:(.*)" ) {
+				return task_location($1);
+			}
+		#try for a built-in official task alias
+		} else {
+			@taskdirs = glob "$_/*";
+			foreach $dir ( @taskdirs ) {
+				if ( -f "$dir/aliases.txt" ) {
+					open (ALIASES, "$dir/aliases.txt");
+					while ( $line = <ALIASES> ) {
+						chomp $line;
+						if ( $line eq $task ) {
+							my $resolved = basename($dir);
+							return task_location($resolved);
+						}
+					}
+				}
+			}
+		}
+		
+	}
+
+}
+
+sub task_exists {
+	if ( ! exists $_[0] || !task_location($_[0]) ) {
+		return 0;
+	}
+	return 1;
+}
+
+sub task_canonical_name {
+	if ( ! exists $_[0] || !task_location($_[0]) ) {
+		return;
+	}
+	return basename(task_location($_[0]));
+}
+
+sub run_task {
+	if ( ! exists $_[0] || !task_exists($_[0])) {
+		return;
+	}
+
+	local $task = $_[0];
+
+	#let rt.pl take over from here, so a new environment context created for the
+	#run of the task, which will be destroyed when rt.pl exits
+	local $command = "perl \"$ENV{'ENVI_HOME'}/lib/rt.pl\" \"$task\"";
+	for my $a ( @ARGV ) {
+		$command .= " \"$a\"";
+	}
+
+	#envi_message( "rt.pl command: $command" );
+	system( $command );
+
+}
+
+sub user_task_environment_script {
+	if ( ! exists $_[0] || !task_location($_[0]) ) { return ""; }
+	return "$ENV{'HOME'}/.envi/tasks/" . task_canonical_name($_[0]) . "/environment.pl";
+}
+
+sub system_task_environment_script {
+	if ( ! exists $_[0] || !task_location($_[0]) ) { return ""; }
+	return "$ENV{'ENVI_HOME'}/etc/tasks/" . task_canonical_name($_[0]) . "/environment.pl";
+}
+
+sub list_tasks() {
+	
+	find_tasks( "$ENV{'HOME'}/.envi/tasks/*" );
+	find_tasks( "$ENV{'ENVI_HOME'}/etc/tasks/*" );
+}
+
+
+#PLAYLIST FUNCTIONS
+sub playlist_location {
+
+	if ( !exists $_[0] ) { return ""; }
+
+	local $playlist = $_[0];
+	local $v = "";
+
+	if ( -f ($v = "$ENV{'HOME'}/.envi/playlists/$playlist") ) {
+		return $v;
+	}
+
+	if ( -f ($v = "$ENV{'ENVI_HOME'}/etc/playlists/$playlist") ) {
+		return $v;
+	}
+
+	return "";
+}
+
+sub playlist_exists {
+	if ( ! exists $_[0] || !playlist_location($_[0]) ) {
+		return 0;
+	}
+	return 1;
+}
+
+sub run_playlist {
+	if ( ! exists $_[0] || !playlist_exists($_[0])) {
+		return;
+	}
+
+	local $playlist = $_[0];
+	local $playlist_loc = playlist_location($playlist);
+
+	#parse arguments
+	local $ls=0;
+	for my $arg ( @ARGV ) {
+		#list tasks
+		if ( $arg =~ "ls|tasks" ) {
+			$ls=1;
+		} else {
+			die "Invalid argument: $arg\n";
+		}
+		shift(@ARGV);
+	}
+
+	local $task_cmd = "";
+	open( FILE, "< $playlist_loc" ) or die "can't open $playlist_loc : $!";
+	while( $task_cmd = <FILE> ) {
+		chomp($task_cmd);
+		if ( $task_cmd ne "" && substr($task_cmd,0,1) ne "#" ) {
+			#show the task command
+			if ( $ls ) {
+				print "$task_cmd\n";
+				#run the task
+	        	} else {
+				envi_message("Running '$task_cmd'");
+				system( "$ENV{'ENVI_HOME'}/bin/envi.pl $task_cmd" );
+			}
+		}
+	}
+}
+
+sub list_playlists {
+	local_names( "$ENV{'HOME'}/.envi/playlists/*" );
+	local_names( "$ENV{'ENVI_HOME'}/etc/playlists/*" );
+}
+
+sub local_names {
+	if ( ! exists $_[0] ) { return; }
+	@files = <$_[0]>;
+	foreach $file (@files) {
+		print basename($file) . "\n";
+	}
+}
+
+sub find_tasks {
+	if ( ! exists $_[0] ) { return; }
+	@dirs = <$_[0]>;
+	foreach $dir (@dirs) {
+		#try task with aliases
+		if ( -f "$dir/aliases.txt" ) {
+			open (ALIASES, "$dir/aliases.txt");
+			while ( $line = <ALIASES> ) {
+				chomp $line;
+				print "$line\n";
+			}
+		#task without aliases
+		} else {
+			print basename($dir) . "\n";
+		}
+	}
+}
+
+sub source_script {
+	#TODO: allow multiline environment variables
+	if ( ! exists $_[0] || ! exists $_[1] ) { return; }
+	if ( ! -f "$_[1]" ) { return; }
+	my $rnd = rand();
+	my $cmd = undef;
+	if ( $^O eq "MSWin32" ) {
+		my $subcommand = '"' . $ENV{'ENVI_HOME'} . '\\lib\\source.' . $_[0] . '" "' . $_[1] . '" "' . $rnd . '"';
+		if ( $ENV{'ENVI_HOME'} =~ " " || $_[1] =~ " " ) {
+			$cmd = 'cmd.exe /v:on /c ' . $subcommand;
+		} else {
+			$cmd = 'cmd.exe /v:on /c "' . $subcommand . '"';
+		}
+	} else {
+		$cmd = '"' . $ENV{'ENVI_HOME'} . '/lib/source.' . $_[0] . '" "' . $_[1] . '" "' . $rnd . '"';
+	}
+	open(SRC, "$cmd|") or die("Couldn't run command $cmd: $!\n");
+	my $reading = 0;
+	while ( my $line=<SRC> ) {
+		chomp($line);
+		if ( $reading ) {
+			my ($name, $value) = split(/=/,$line,2);
+			if ( $name !~ /^\_/ ) {
+				$ENV{$name} = $value;
+			}
+		} elsif ( $line eq "-- ENVIRONMENT \"$rnd\" --" ) {
+			$reading = 1;
+		}
+	}
+	close(SRC);
+}
+
+sub source_bash_script {
+	if ( ! exists $_[0] ) { return; }
+	source_script("bash","$_[0]");
+}
+
+sub source_batch_script {
+	if ( ! exists $_[0] ) { return; }
+	source_script("bat","$_[0]");
+}
+
+
Index: /main/trunk/gs-release-builder/envi/setup.bat
===================================================================
--- /main/trunk/gs-release-builder/envi/setup.bat	(revision 36212)
+++ /main/trunk/gs-release-builder/envi/setup.bat	(revision 36212)
@@ -0,0 +1,14 @@
+@echo off
+
+if defined ENVI_HOME goto already
+
+pushd "%~dp0"
+set ENVI_HOME=%CD%
+set PATH=%ENVI_HOME%\bin;%PATH%
+popd
+goto end
+
+:already
+echo EnvI environment already set up
+
+:end
Index: /main/trunk/gs-release-builder/envi/setup.sh
===================================================================
--- /main/trunk/gs-release-builder/envi/setup.sh	(revision 36212)
+++ /main/trunk/gs-release-builder/envi/setup.sh	(revision 36212)
@@ -0,0 +1,51 @@
+if [ "`uname -sr|sed s/\\\\..*//`" == "Darwin 8" ]; then
+	if [ "$1" == "" ]; then
+		echo "Under MacOS Tiger and earlier you must source setup.sh like this:"
+		echo "source /path/to/envi/setup.sh /path/to/envi"
+		return
+	fi
+	home="$1"
+else
+	home="`dirname ${BASH_SOURCE[0]}`"
+fi
+
+export PATH="`$home/bin/envi home`/bin:$PATH"
+
+function envi_complete {
+	local cur prev words first_arg second_arg
+
+	COMPREPLY=()
+
+	cur="${COMP_WORDS[COMP_CWORD]}"
+	prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+	#figure out if the first (real) arg has been given
+	for (( i = 1 ; i < ${#COMP_WORDS[@]}-1 ; i++ )); do
+		word=${COMP_WORDS[$i]}
+		if [[ ${word} != -* ]] ; then
+			if [ "$first_arg" == "" ]; then
+				first_arg=$word
+			elif [ "$second_arg" == "" ]; then
+				second_arg=$word
+			else
+				break
+			fi
+		fi
+	done
+
+	#complete first arg
+	if [ "$first_arg" == "" ]; then
+		completes="`envi playlists` `envi tasks` home tasks playlists env"
+	#complete second arg
+	#elif [ "$first_arg" != "" ] && [ "$second_arg" == "" ]; then
+	#	completes="`envi $first_arg options` env options"
+	#cant help complete third arg
+	else
+		completes=""
+	fi
+
+	COMPREPLY=( $(compgen -W "${completes}" -- ${cur}))
+	return 0
+}
+complete -F envi_complete envi
+
Index: /main/trunk/gs-release-builder/setup-env.sh
===================================================================
--- /main/trunk/gs-release-builder/setup-env.sh	(revision 36212)
+++ /main/trunk/gs-release-builder/setup-env.sh	(revision 36212)
@@ -0,0 +1,34 @@
+HOME_DIR=/gs-release-builder
+PKG_DIR=$HOME_DIR/packages
+#JAVA
+export JAVA_HOME=$PKG_DIR/jdk1.8.0_301
+echo Setting JAVA_HOME to $JAVA_HOME
+export PATH=$JAVA_HOME/bin:$PATH
+echo Adding $JAVA_HOME/bin to PATH
+export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/jli:$LD_LIBRARY_PATH
+echo Adding $JAVA_HOME/jre/lib/amd64/jli to LD_LIBRARY_PATH
+
+
+#ANT
+export ANT_HOME=$PKG_DIR/apache-ant-1.9.4
+echo Setting ANT_HOME to $ANT_HOME
+export PATH=$ANT_HOME/bin:$PATH
+echo Adding $ANT_HOME/bin to PATH
+
+#PYTHON - 2.7+ needed to compile gnome-lib's glib-2.54.x
+export PATH=$PKG_DIR/python2.7/bin:$PATH
+echo Adding $PKG_DIR/python2.7/bin to PATH
+
+#SVN
+export PATH=$PKG_DIR/subversion/linux/bin:$PATH
+export LD_LIBRARY_PATH=$PKG_DIR/subversion/linux/lib:$LD_LIBRARY_PATH
+echo Adding $PKG_DIR/subversion/linux/bin to PATH and setting LD_LIB_PATH
+
+# random binaries
+export PATH=$PKG_DIR/bin:$PATH
+echo Adding $PKG_DIR/bin to PATH
+
+#RELEASE-KITS
+export PATH=$HOME_DIR/release-kits/bin:$PATH
+echo Adding $HOME_DIR/release-kits/bin to PATH
+export LC_ALL=C
Index: /main/trunk/gs-release-builder/upload-files-to-www-internal.sh
===================================================================
--- /main/trunk/gs-release-builder/upload-files-to-www-internal.sh	(revision 36212)
+++ /main/trunk/gs-release-builder/upload-files-to-www-internal.sh	(revision 36212)
@@ -0,0 +1,57 @@
+#!/bin/bash                                                                     
+
+echo "This script ($0)"
+echo "   needs to be run from outside the lsb environment (but sudo as root)"
+echo "Doing /bin/mount --bind /proc /opt/lsb-buildenv-x86_64/proc is okay"
+echo "   but don't do /usr/sbin/chroot /opt/lsb-buildenv-x86_64 in the terminal\
+ this is run from"
+echo "   (and don't do the chroot step in the cron file either)."
+
+source ./setup-env.sh
+
+cd snapshots/
+echo "Looking for uploads in snapshots folder/"
+
+# possible values for list of dirs below (edit for your build system):
+# gs2-caveat
+#gs2-caveat-x64
+#gs2-stable
+#gs2-stable-x64
+#gs3-caveat
+#gs3-caveat-x64
+#gs3-stable
+#gs3-stable-x64
+#gs2-src-caveat
+#gs2-src-stable
+#gs3-src-caveat
+#gs3-src-stable
+#gs2-cd-caveat
+#gs2-cd-stable
+#dec-caveat
+#dec-stable
+
+# edit this list to reflect which builds the current system is in charge of
+for RK in gs3-caveat-x64 gs2-caveat-x64 gs2-stable
+do
+    if [ -d $RK ]
+    then
+	# the star does tab-completion
+	for DIR in $RK/from*/uploads
+	do
+	    if [ -d $DIR ]
+	    then
+		echo "*** Found uploads folder $DIR"
+		pushd $DIR
+		echo "Running: tar -c * | ssh -i ~/.ssh/upload-caveat-ed25519 nzdl-gsorg@www-internal.greenstone.org"
+		#tar -c * | ssh -J kjdon@linux-labs.cms.waikato.ac.nz -T -i ~/.ssh/upload-caveat-ed25519 nzdl-gsorg@www-internal.greenstone.org      # the old way using a jump host                                                                                                                        
+		tar -c * | ssh -i ~/.ssh/upload-caveat-ed25519 nzdl-gsorg@www-internal.greenstone.org
+	     
+		popd
+	    fi
+	done
+    else
+	echo "***  no upload found for $RK" 
+		
+    fi
+done
+		
