[Bio] / FigKernelPackages / P2Pupdate.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/P2Pupdate.pm

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

revision 1.1, Mon Dec 1 16:54:26 2003 UTC revision 1.2, Fri Dec 19 17:19:58 2003 UTC
# Line 145  Line 145 
145    
146      &force_absolute($fig_disk);      &force_absolute($fig_disk);
147      &force_absolute($file);      &force_absolute($file);
148      &FIG::run("rm -f $fig_disk/FIG/bin/ToolTemplates/*~ $fig_disk/FIG/CGI/ToolTemplates/*~");      my @tmp = `cat $fig_disk/CURRENT_RELEASE`;
149      &FIG::run("cd $fig_disk; tar czf $file README env fig-user-env.sh install bin lib man src FIG/VERSION FIG/Packages FIG/bin/ToolTemplates FIG/CGI/ToolTemplates FIG/bin/Makefile  FIG/CGI/Makefile FIG/CGI/Html");      my $current_release = $tmp[0];
150        chop $current_release;
151    
152        &FIG::run("cd $fig_disk/dist/releases; tar czf $file $current_release");
153  }  }
154    
155  sub force_absolute {  sub force_absolute {
# Line 154  Line 157 
157    
158      if (substr($file,0,1) ne "/")      if (substr($file,0,1) ne "/")
159      {      {
160          print STDERR "Please use absolute file names (i.e., /Users/fig/... or /home/fig/...)\n";          print "Error: Please use absolute file names (i.e., /Users/fig/... or /home/fig/...)\n";
161          confess "You need to fix $file before proceeding";          exit;
162      }      }
163  }  }
164    
# Line 223  Line 226 
226    
227      &force_absolute($fig_disk);      &force_absolute($fig_disk);
228      &force_absolute($file);      &force_absolute($file);
229      &FIG::run("rm -f $fig_disk/FIG/bin/ToolTemplates/*~ $fig_disk/FIG/CGI/ToolTemplates/*~");      my @tmp = `cat $fig_disk/CURRENT_RELEASE`;
230      &FIG::run("cd $fig_disk; tar czf $file FIG/VERSION FIG/Packages FIG/bin/ToolTemplates FIG/CGI/ToolTemplates FIG/bin/Makefile  FIG/CGI/Makefile FIG/CGI/Html");      my $current_release = $tmp[0];
231        chop $current_release;
232    
233        &FIG::run("cd $fig_disk/dist/releases; tar czf $file $current_release");
234  }  }
235    
236  =pod  =pod
# Line 249  Line 255 
255      &force_absolute($fig_base);      &force_absolute($fig_base);
256      &force_absolute($package);      &force_absolute($package);
257    
258      if (getcwd() !~ /FIGdisk$/) { $_ = getcwd(); print die "Sorry, you must run this while in a directory ending in FIGdisk; you are in $_" }      if (! mkdir("$fig_disk/Tmp$$",0777))
259        {
260      (! -d "$fig_disk/BackupCode") || &FIG::run("rm -rf $fig_disk/BackupCode");          print "Error: could not make $fig_disk/Tmp$$\n";
261      mkdir("$fig_disk/BackupCode",0777) || die "Could not make the BackupCode directory";          exit;
262        }
263    
264      my $version = &what_code_do_I_have($fig_base);      &FIG::run("cd $fig_disk/Tmp$$; tar xzf $package");
265      &FIG::run("cd $fig_base; mv VERSION Packages bin CGI $fig_disk/BackupCode");      if (! opendir(TMP,"$fig_disk/Tmp$$"))
266      print STDERR "made backups\n";      {
267            print "Error: could not open $fig_disk/Tmp$$\n";
268            exit;
269        }
270    
271      &FIG::run("cd $fig_disk; tar xzf $package");      my @rels = grep { $_ !~ /^\./ } readdir(TMP);
272      print STDERR "untarred new code\n";      closedir(TMP);
273        if (@rels != 1)
274        {
275            print "Error: Bad code package: $package\n";
276            exit;
277        }
278    
279      &fix_config("$fig_base/Packages/FIG_Config.pm","$fig_disk/BackupCode/Packages/FIG_Config.pm");      my $new_release = $rels[0];
280      &fix_config("$fig_base/Packages/FIG_Config.py","$fig_disk/BackupCode/Packages/FIG_Config.py");      if (-d "$fig_disk/dist/releases/$new_release")
281      &FIG::run("cd $fig_base/bin; touch ToolTemplates/*/*; make all");      {
282      &FIG::run("cd $fig_base/CGI; touch ToolTemplates/*/*; make all");          print "Error: $new_release already exists; we are doing nothing\n";
283      print STDERR "installed new bin and CGI\n";          exit;
284        }
285    
286      &FIG::run("bring_system_up_to_date $version");  #    &FIG::run("mv $fig_disk/Tmp$$/$new_release $fig_disk/dist/releases");
287    #    &FIG::run("rm -rf $fig_disk/Tmp$$");
288        &FIG::run("switch_to_release $new_release");
289  }  }
290    
291    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3