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

Diff of /FigCommon/switch_to_release.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5, Fri Dec 19 20:56:03 2003 UTC revision 1.11, Mon Dec 5 19:10:06 2005 UTC
# Line 1  Line 1 
1    #
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    
 use FIG;  
18    
19    use FIG;
20    
21  #  #
22  # switch_to_release <release_number>  # switch_to_release <release_number>
# Line 8  Line 24 
24  # Change the currently-running release to <release_number>  # Change the currently-running release to <release_number>
25  #  #
26  # Check to be sure that $fig_disk/dist/releases/<release_number> exists  # Check to be sure that $fig_disk/dist/releases/<release_number> exists
27    #
28  # Update $fig_disk/CURRENT_RELEASE with the new release number.  # Update $fig_disk/CURRENT_RELEASE with the new release number.
 # Swing the symlinks $fig_disk/FIG/bin and $fig_disk/FIG/CGI to the right place  
29  #  #
30    # Swing the symlinks $fig_disk/FIG/bin and $fig_disk/FIG/CGI to the right place
 if (@ARGV != 1)  
 {  
     die "Usage: switch_to_release release-number";  
 }  
   
 my $release_number = $ARGV[0];  
   
 my $release_dir = "$FIG_Config::fig_disk/dist/releases/$release_number";  
   
31  #  #
32  # FIXME  # Create the symlink $fig_disk/dist/releases/current to point to <release_number>
33  #  #
34  my $arch = "mac";  # Create a symlink $fig_disk/dist/releases/last to point to the pre-switch release.
   
 if (! -d $release_dir)  
 {  
     die "Release directory $release_dir does not exist"  
 }  
   
35  #  #
36  # Okay, go for it.  # Expand the environment-specific tool headers from $fig_disk/config/base_tool_hdr
37    # to include the release-specific directories. Place the output in
38    # dist/releases/<release_number>/<arch>.
39  #  #
40    
41  if (!open(FH, ">$FIG_Config::fig_disk/CURRENT_RELEASE"))  require FigCommon::SwitchRelease;
42    
43    if (@ARGV != 1)
44  {  {
45      die "Cannot write to $FIG_Config::fig_disk/CURRENT_RELEASE";      die "Usage: switch_to_release release-number";
46  }  }
 print FH "$release_number\n";  
 close(FH);  
47    
48  #  my $release_number = $ARGV[0];
 # Symlinks.  
 #  
   
 unlink("$FIG_Config::fig_disk/FIG/bin");  
 symlink("../dist/releases/$release_number/bin/$arch", "$FIG_Config::fig_disk/FIG/bin");  
 unlink("$FIG_Config::fig_disk/FIG/CGI");  
 symlink("../dist/releases/$release_number/CGI", "$FIG_Config::fig_disk/FIG/CGI");  
   
 &FIG::run("cd $release_dir; make clean; make");  
49    
50  #  #
51  # Fix up permissions so we can do things as a different user later.  # We assume the architecture name is keept in $RTARCH in the environment.
52  #  #
53    my $arch = $ENV{RTARCH};
54    
55  chmod(0777, $FIG_Config::fig_disk);  FigCommon::SwitchRelease::switch_to_release($FIG_Config::fig_disk, $arch, $release_number);
 chmod(0777, "$FIG_Config::fig_disk/FIG");  
 chmod(0777, "$FIG_Config::fig_disk/FIG/bin");  
 chmod(0777, "$FIG_Config::fig_disk/FIG/CGI");  
56    
57  &FIG::run("chmod ugo+w $FIG_Config::fig_disk");  exit 0;
 &FIG::run("chmod ugo+w $FIG_Config::fig_disk/CURRENT_RELEASE");  
 &FIG::run("chmod ugo+w $FIG_Config::fig_disk/FIG");  
 &FIG::run("chmod ugo+w $FIG_Config::fig_disk/FIG/bin");  
 &FIG::run("chmod ugo+w $FIG_Config::fig_disk/FIG/CGI");  
 &FIG::run("chmod ugo+w $FIG_Config::fig_disk/dist/releases");  
 &FIG::run("chmod  -R ugo+w $release_dir");  

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.11

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3