#!/usr/bin/env perl
##**************************************************************
##
## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
## University of Wisconsin-Madison, WI.
## 
## Licensed under the Apache License, Version 2.0 (the "License"); you
## may not use this file except in compliance with the License.  You may
## obtain a copy of the License at
## 
##    http://www.apache.org/licenses/LICENSE-2.0
## 
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
##**************************************************************


######################################################################
# $Id: pre_all,v 1.4 2007-11-08 22:53:46 nleroy Exp $
# Submit-side NMI build system infrastructure to setup source
# input for test jobs before the platform-specific stuff is called.
# All we have to do is untar the common/results.tar.gz file so that
# when the NMI infrastructure copies everything into each platform-
# specific directory, "results.tar.gz" doesn't get clobbered.
# We assume we're born inside the "common" directory...
######################################################################

use Getopt::Long;

# autoflush our STDOUT
$| = 1;

# Set up environment file for talking to tests on remote execute node
setupTestEnvFile();

print "All steps completed successfully\n";
exit 0;

sub setupTestEnvFile
{
    ######################################################################
    # set up environment and create env file for test tasks
    ######################################################################

    print "Setting up environtment file 'setup_test_env' for other scripts\n";
    open( ENVSETUP, ">test_task_env" ) ||
    die "cannot open test_task_env for writing\n";

    print ENVSETUP "GCBTARGET=nmi-s006.cs.wisc.edu\n";
    print ENVSETUP "export GCBTARGET\n";
    close(ENVSETUP);
}


