[Bio] / FigKernelScripts / expand_transferred_chunks.pl Repository:
ViewVC logotype

View of /FigKernelScripts/expand_transferred_chunks.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (download) (as text) (annotate)
Mon Feb 2 17:11:44 2004 UTC (16 years, 5 months ago) by overbeek
Branch: MAIN
CVS Tags: merge-trunktag-bobdev_news-2, Root-bobdev_news, merge-bobdev_news-1, caBIG-dataload-0, merge-trunktag-bobdev_news-1, merge-bodev_news-3, efrank-preMakefileToStandardMk, caBIG-00-00-00, merge-bobdev_news-2, merge-trunktag-bodev_news-3
Branch point for: Branch-bobdev_news
Changes since 1.2: +1 -1 lines
fix pattern in expand_transferred_chunks

use FIG;

$usage = "usage: expand_transferred_chunks ChunksDir";

($chunksD = shift @ARGV)
    || die $usage;

$err = 0;
$files = "";
foreach $_ (`cat $chunksD/checksums`)
{
    if ($_ =~ /^(\d+)\s+(\d+)\s+.*?(\d+)$/)
    {
        $check_sum = $1;
        $sz = $2;
        $file = $3;
        print STDERR "checking $file\n";
    }
    if (-s "$chunksD/$file")
    {
        @tmp = `cksum $chunksD/$file`;
        if ($tmp[0] !~ /^$check_sum\s+$sz\s/)
        {
            $err++;
            print STDERR $_,$tmp[0],"\n\n";
        }
        else
        {
            $files .= " $chunksD/$file";
        }
    }
    else
    {
        $err++;
        print STDERR "missing $file\n";
    }
}

if ($err)
{
    print STDERR "errors detected; expansion terminated\n";
}
else
{
    system "cat $files | tar xzf -";
}


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3