[Bio] / FigRelEngTools / assemble_disk Repository:
ViewVC logotype

View of /FigRelEngTools/assemble_disk

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (annotate)
Mon Feb 16 17:24:31 2004 UTC (15 years, 2 months ago) by olson
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +17 -0 lines
fixes for relative pathnames given to assemble_Disk

#!/usr/bin/perl

use strict;

use File::Copy;
use File::Basename;

#
# Assemble a new FIGdisk. This version expects arguments
#
#   env-file code-file blastmat-file
#
# Each of these is a tarfile. env-file extracts to a directory called "env".
# code-file is named code-<version>.tgz. It extracts to a directory <version>.
# blastmat-file extracts to a directory BLASTMAT.
#
# We're going to assume each of these exists, as we're being invoked from
# a script that has already checked the manifest.
#

if (@ARGV != 3)
{
    print STDERR "Usage: $0 env-file code-file blastmat-file\n";
    exit;
}

my($env_file, $code_file, $blastmat_file) = @ARGV;

$env_file = File::Spec->rel2abs($env_file);
$code_file = File::Spec->rel2abs($code_file);
$blastmat_file = File::Spec->rel2abs($blastmat_file);

if (! -f $env_file)
{
    die "Environment file $env_file not found\n";
}
if (! -f $code_file)
{
    die "Code file $code_file not found\n";
}
if (! -f $blastmat_file)
{
    die "Blastmat file $blastmat_file not found\n";
}

my $top = `pwd`;
chop $top;

#
# Determine the code release name. 
#

my $code_version;
{
    my $base = basename($code_file);
    if ($base =~ /code-(.*).tgz/)
    {
	$code_version = $1;
    }
    else
    {
	die "Invalid code release filename $code_file\n";
    }
}

print "Unpacking environment from $env_file\n";
(system("tar zxf $env_file") == 0) or die "Extract of environment from $env_file failed: $!\n";

print "Unpacking BLASTMAT from $blastmat_file\n";
(system("tar zxf $blastmat_file") == 0) or die "Extract of BLASTMAT from $blastmat_file failed: $!\n";

open(F, ">DEFAULT_RELEASE");
print F "$code_version\n";
close(F);

mkdir("FIG");
mkdir("FIG/Tmp");
chmod(0777, "FIG/Tmp");

mkdir("dist");
mkdir("dist/releases");

print "Unpacking code release $code_version\n";

(system("cd dist/releases; tar zxf $code_file") == 0) or die "Extract of code from $code_file failed: $!\n";

copy("dist/releases/$code_version/FigCommon/configure", "configure");
chmod(0755, "configure");

copy("dist/releases/$code_version/ReleaseTools/Makefile.top", "dist/releases/$code_version/Makefile");

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3