[Bio] / FigRelEngTools / build_release Repository:
ViewVC logotype

View of /FigRelEngTools/build_release

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (download) (annotate)
Thu Oct 28 17:53:30 2004 UTC (14 years, 8 months ago) by olson
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
More releng stuff.

#!/usr/bin/perl

use Getopt::Long;
use File::Basename;
use File::Copy;
use strict;

#
# build_release
#
# Builds a (skeleton of) a release directory, meant to be put on an FTP server
# or on a DVD release.
#

my @install_scripts = qw(assemble_disk extract_transferred_data);

#
# Directory containing other tarfiles to be included in release.
#

my $distro_dir = "/Users/olson/FigRelEngTools/ReleaseBase-2004-0730";

my $readme_file;

if (!GetOptions("readme|r=s" => \$readme_file))
{
    usage();
}

if (@ARGV != 1)
{
    usage();
}

sub usage
{
    die "Usage: $0 [--readme readme-file] relase-dir\n";
}

my $release_dir = shift(@ARGV);

if (-d $release_dir)
{
    warn "Release directory $release_dir already exists, overwriting\n";
}
else
{
    mkdir($release_dir, 0777) or die "Cannot mkdir $release_dir: $!\n";
}

my @manifest_files = qw(InstallSEED scripts.tgz);

if (defined($readme_file))
{
    if (! -f $readme_file)
    {
	die "Specified readme file $readme_file not present\n";
    }
    copy($readme_file, "$release_dir/README");
    push(@manifest_files, "README");
}

copy("InstallSEED", "$release_dir/InstallSEED");
chmod(0775, "$release_dir/InstallSEED");

my $tarcmd = "tar czf $release_dir/scripts.tgz @install_scripts";
print "Creating: $tarcmd\n";
(system($tarcmd)  == 0) or die "Tar command \"$tarcmd\" failed: $!\n";

if (-f "$release_dir/checksums")
{
    push(@manifest_files, "checksums");
}

for my $tarfile (glob("$distro_dir/*.tgz"))
{
    my $base = basename($tarfile);
    push(@manifest_files, $base);
    print "Copying $tarfile\n";
    copy($tarfile, $release_dir);
}

(system("cd $release_dir; cksum @manifest_files > MANIFEST") == 0) or die "cksum failed: $!\n";


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3