[Bio] / FigCommon / tool_hdr.pl Repository:
ViewVC logotype

Annotation of /FigCommon/tool_hdr.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : olson 1.1 #
2 : olson 1.3 # 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 :     #
19 : olson 1.1 # Create a new fig script.
20 :     #
21 :    
22 :     open(FH, "<$FIG_Config::fig_disk/config/fig-user-env.sh");
23 :     while (<FH>)
24 :     {
25 :     chomp;
26 :     if (/^RTARCH=\"(.*)\"/)
27 :     {
28 :     $arch = $1;
29 :     last;
30 :     }
31 :     }
32 :    
33 :     if (!$arch)
34 :     {
35 :     die "Couldn't determine FIG architecture name\n";
36 :     }
37 :    
38 :     $file = "$FIG_Config::fig_disk/dist/releases/current/$arch/tool_hdr";
39 :    
40 :     open(FH, "<$file") or die "Cannot open tool_hdr file $file: $!\n";
41 :    
42 :     if (@ARGV == 0)
43 :     {
44 :     while (<FH>)
45 :     {
46 :     print;
47 :     }
48 :     close(FH);
49 :     }
50 :     else
51 :     {
52 :     $out = $ARGV[0];
53 : olson 1.2
54 :     if (-f $out)
55 :     {
56 :     #
57 :     # Better would be to replace the existing tool_hdr, if present,
58 :     # with the right thing. But not yet.
59 :     #
60 :    
61 :     die "Output file $out already exists, not overwriting.\n";
62 :     }
63 :    
64 :    
65 : olson 1.1 open(OUT, ">$out") or die "Cannot open output $out: $!\n";
66 :     while (<FH>)
67 :     {
68 :     print OUT $_;
69 :     }
70 :     close(FH);
71 :     close(OUT);
72 :     system("chmod +x $out");
73 :     }
74 :    
75 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3