#!/usr/bin/env perl
##**************************************************************
##
## Copyright (C) 1990-2011, 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.
##
##**************************************************************

use strict;
use warnings;
use File::Spec;
use File::Basename;

my $dir = dirname($0);
unshift @INC, $dir;
require "TestGlue.pm";

##################################################################
# We will be removing the platform app_input.tar.gz until NMI does
##################################################################
# The reason for this section is unknown.  Todd Miller guessed that
# it is here to save disk space.

TestGlue::dir_listing("..", "..");

my $appinput = File::Spec->catfile("..", "..", "$ENV{NMI_PLATFORM}_app_input.tar.gz");
if(-e $appinput) {
    print "File '$appinput' exists.  Removing it.\n";
    unlink($appinput);
}
else {
    print "File '$appinput' does not exist.\n";
}

##################################################################
# We do not need to hang on to the source tarball
##################################################################

my @binaries = <condor-*.tar.gz>;
print "Remove unwanted binaries:\n\t" . join("\n\t", @binaries) . "\n";
unlink(@binaries);

exit(0);
