[Bio] / FigRelEngTools / create-code-disk Repository:
ViewVC logotype

View of /FigRelEngTools/create-code-disk

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.2 - (download) (annotate)
Tue May 3 15:58:25 2005 UTC (14 years, 2 months ago) by olson
Branch: MAIN
Changes since 1.1: +4 -0 lines


use strict;
use File::Temp qw/ tempfile tempdir /;
use File::Basename;
use File::Spec::Functions 'rel2abs';
use File::Copy;

# Create a code disk.

my $mkisofs = "/tmp/foo/bin/mkisofs";
$mkisofs = "/Users/olson/EnvBuild/install-2004-1014/mac/bin/mkisofs";
my $iso_preparer = 'Robert Olson olson@mcs.anl.gov';
my $iso_app = "SEED";
my $iso_publisher = "The SEED Project";

if (@ARGV != 6)
    die "Usage: $0 blastmat-path compiled-code-path lw-code-path script-dir readme-file iso-file\n";

my($blastmat, $ccode, $lw_code, $script_dir, $readme_file, $iso_file) = @ARGV;

-f $blastmat or die "Blastmat $blastmat does not exist\n";
-f $ccode or die "Compiled code $ccode does not exist\n";
-f $lw_code or die "LW code $lw_code does not exist\n";
-d $script_dir or die "Script dir $script_dir does not exist\n";
-f $readme_file or die "Readme file $readme_file does not exist\n";

$iso_file = rel2abs($iso_file);

# Check for the scripts we need.

(-f "$script_dir/install-seed" and -f "$script_dir/install-seed.pl") or
    die "Install-seed scripts missing from $script_dir\n";

# We create a working directory in /tmp into which we place symlinks to the
# various tarfiles and scripts, and into which we copy the lw code snapshot.

my $dir = tempdir(CLEANUP => 1);

my @files;

for my $f ($blastmat, $ccode, $lw_code)
    my $a = rel2abs($f);
    my $b = basename($a);
    push(@files, $b);
    symlink($a, "$dir/$b") or die "symlink failed: $!\n";

for my $f ("$script_dir/install-seed", 
    my $b = basename($f);
    push(@files, $b);
    copy($f, "$dir/$b");
    chmod(0775, "$dir/$b");

copy($readme_file, "$dir/README");
push(@files, "README");

system("ls -l $dir\n");

my $cmd = qq($mkisofs -A '$iso_app' -preparer '$iso_preparer' -publisher '$iso_publisher' -f -J -R -V SeedCode -o $iso_file @files);

print "$cmd\n";
system("cd $dir; $cmd");

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3