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

Annotation of /FigKernelScripts/expand_transferred_chunks.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (view) (download) (as text)

1 : olson 1.4 #
2 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
3 :     # for Interpretations of Genomes. All Rights Reserved.
4 :     #
5 :     # This file is part of the SEED Toolkit.
6 :     #
7 :     # The SEED Toolkit is free software. You can redistribute
8 :     # it and/or modify it under the terms of the SEED Toolkit
9 :     # Public License.
10 :     #
11 :     # You should have received a copy of the SEED Toolkit Public License
12 :     # along with this program; if not write to the University of Chicago
13 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
14 :     # Genomes at veronika@thefig.info or download a copy from
15 :     # http://www.theseed.org/LICENSE.TXT.
16 :     #
17 :    
18 : overbeek 1.1 use FIG;
19 :    
20 :     $usage = "usage: expand_transferred_chunks ChunksDir";
21 :    
22 :     ($chunksD = shift @ARGV)
23 :     || die $usage;
24 :    
25 :     $err = 0;
26 :     $files = "";
27 :     foreach $_ (`cat $chunksD/checksums`)
28 :     {
29 : overbeek 1.3 if ($_ =~ /^(\d+)\s+(\d+)\s+.*?(\d+)$/)
30 : overbeek 1.1 {
31 :     $check_sum = $1;
32 :     $sz = $2;
33 :     $file = $3;
34 :     print STDERR "checking $file\n";
35 :     }
36 :     if (-s "$chunksD/$file")
37 :     {
38 :     @tmp = `cksum $chunksD/$file`;
39 :     if ($tmp[0] !~ /^$check_sum\s+$sz\s/)
40 :     {
41 :     $err++;
42 :     print STDERR $_,$tmp[0],"\n\n";
43 :     }
44 :     else
45 :     {
46 :     $files .= " $chunksD/$file";
47 :     }
48 :     }
49 :     else
50 :     {
51 :     $err++;
52 :     print STDERR "missing $file\n";
53 :     }
54 :     }
55 :    
56 :     if ($err)
57 :     {
58 :     print STDERR "errors detected; expansion terminated\n";
59 :     }
60 :     else
61 :     {
62 :     system "cat $files | tar xzf -";
63 :     }
64 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3