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

View of /FigCommon/switch_to_release.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (download) (as text) (annotate)
Fri Dec 19 20:56:03 2003 UTC (15 years, 11 months ago) by efrank
Branch: MAIN
Changes since 1.4: +17 -0 lines
add chmod

use FIG;


#
# switch_to_release <release_number>
#
# Change the currently-running release to <release_number>
#
# Check to be sure that $fig_disk/dist/releases/<release_number> exists
# 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
#

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";

#
# FIXME
#
my $arch = "mac";

if (! -d $release_dir)
{
    die "Release directory $release_dir does not exist"
}

#
# Okay, go for it.
#

if (!open(FH, ">$FIG_Config::fig_disk/CURRENT_RELEASE"))
{
    die "Cannot write to $FIG_Config::fig_disk/CURRENT_RELEASE";
}
print FH "$release_number\n";
close(FH);

#
# 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");

#
# Fix up permissions so we can do things as a different user later.
#

chmod(0777, $FIG_Config::fig_disk);
chmod(0777, "$FIG_Config::fig_disk/FIG");
chmod(0777, "$FIG_Config::fig_disk/FIG/bin");
chmod(0777, "$FIG_Config::fig_disk/FIG/CGI");

&FIG::run("chmod ugo+w $FIG_Config::fig_disk");
&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");

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3