1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
#! perl
use strict;
use Config;
#
# Do a perl check for version >= 5.005. See 'gpt-translate-interpreter' should you
# need to alter the invocation path to a valid perl interpreter in the GPT front-end
# programs.
#
if ( ! ( defined eval "require 5.005" ) )
{
die "GPT requires at least Perl version 5.005";
}
my $gpath = $ENV{GPT_LOCATION};
if (!defined($gpath))
{
$gpath = "/usr";
}
if (!defined($gpath))
{
die "GPT_LOCATION or GLOBUS_LOCATION needs to be set before running this script";
}
@INC = ("$gpath/lib/perl", "$gpath/lib/perl/$Config{'archname'}", @INC);
require Grid::GPT::MD5;
my( @files, $digest );
@files = @ARGV;
if ( scalar(@files) == 0 )
{
push(@files, ".");
}
for my $file (@files)
{
$digest = Grid::GPT::MD5->checksum( file => $file );
printf("$digest $file\n");
}
|