#!/usr/bin/env perl
#
# this script contains a hard-coded list of legal
# endings for the files which are in the calibDB /tcal area
#
# crated by Michele Zamparelli
# ESO VLT
# October 2001
#
@allow= qw ( prg rri akd ehr bdd dpr pdd rrd fits tfits GENERIC PAF dat idf );

foreach $x (@allow) { 
#    print $x."\n";
}
die "/tcal is not a link to a directory" unless  ( -d "/tcal" && -l "/tcal") ;

@files = `find /tcal -follow -type f 2> /dev/null`;

foreach $suffix (@allow) {
    @files = grep (!/\.$suffix$/ ,@files);
}
if ( $#files != -1) { 
    print "The following files must be removed from /tcal, or the\nupdatecalibDb will fail:\n\n";
    print @files;
    print "\nPlease use only standard update procedures for the calibDb.\n";
    exit -1;
}

@links = `find /tcal -follow -type l 2> /dev/null`;
if ( $#links != -1) { 
    print "The following links must be removed from /tcal, or the\nupdatecalibDb will fail:\n\n";
    print @links;
    print "\nPlease use only standard update procedures for the calibDb.\n";
    exit -1;
}

    
