Bio-GMOD

 view release on metacpan or  search on metacpan

GMOD/Admin/Update.pm  view on Meta::CPAN


  my $method = $sync_to . "_version";
  my $version  = $self->$method || 'unknown_version';
  $tmp_path ||= $adaptor->tmp_path;
  my $full_path = "$tmp_path/$version";

  unless (-e "$full_path") {
    $self->logit(-msg => "Creating temporary directory at $full_path");
    my $command = <<END;
mkdir -p $full_path
chmod -R 0775 $full_path
END
;
  my $result = system($command);
    if ($result == 0) {
      $self->logit(-msg => "Successfully created temporary directory");
    } else {
      $self->logit(-msg => "Cannot make temporary directory: $!",
		   -die => 1);
    }
  }

GMOD/Admin/Update/WormBase.pm  view on Meta::CPAN

    $self->logit(-msg => "Unpacking and installing $acedb");
    chdir($acedb_path);
    system("gunzip -c $local_path/$acedb | tar -x --no-same-owner -f -");
    unlink($acedb_path . '/elegans');
    symlink("elegans_$version",'elegans');

    # Adjust permissions
    my $command = <<END;
chown -R acedb $acedb_path/elegans*
chgrp -R acedb $acedb_path/elegans*
chmod 2775 $acedb_path/elegans*
##chown acedb $acedb_path/bin/*
##chgrp acedb $acedb_path/bin/*
END

    $self->test_for_error(system($command),"Fetching and installing acedb for WormBase");
  }
}


sub fetch_elegans_gff {

GMOD/Admin/Update/WormBase.pm  view on Meta::CPAN

# Create the blast directory
mkdir blast
gunzip -c $local_path/$blast | tar -x --no-same-owner -f -
mv blast_$version blast/.
rm -f blast/blast
cd blast/
ln -s blast_$version blast

# Fix permissions as necessary
chgrp -R wormbase /usr/local/wormbase/blat
chmod 2775 /usr/local/wormbase/blat

END

  $self->test_for_error(system($command),"Fetching and installing blast databases for WormBase");
  }
}


sub fetch_briggsae_gff {
  my ($self,@p) = @_;

GMOD/Util/Mirror.pm  view on Meta::CPAN

  my ($lsize,$ltime) = stat($path) ? (stat(_))[7,9] : (0,0);
  if ( defined($rtime) and defined($rsize) 
       and ($ltime >= $rtime) 
       and ($lsize == $rsize) ) {
    $self->warning(-msg => "Getting file $path: not newer than local copy.") if $self->verbose;
    return 1;
  }

  $self->logit(-msg => "Downloading file $path");
  $ftp->get($path) or ($self->warning(-msg=>$ftp->message) and return);
  chmod $mode,$path if $mode;
}

# mirror a directory, recursively
sub get_dir {
  my $self = shift;
  my ($path,$mode) = @_;
  
  my $localpath = $path;
  -d $localpath or mkpath $localpath or carp "mkpath failed: $!" && return;
  chdir $localpath                   or carp "can't chdir to $localpath: $!" && return;
  $mode = 0755 if ($mode == 365); # Kludge-can't mirror non-writable directories
  chmod $mode,'.' if $mode;
  
  my $ftp = $self->ftp;
  
  my $cwd = $ftp->pwd                or carp("can't pwd: ",$ftp->message) && return;
  $ftp->cwd($path)                   or carp("can't cwd: ",$ftp->message) && return;
  
  $self->logit(-msg => "Downloading directory $path") if $self->verbose;

  foreach ($ftp->dir) {
    next unless my ($type,$name,$mode) = $self->parse_listing($_);

bin/gmod_check_versions.PLS  view on Meta::CPAN

  my $hash = shift;
  print "Status      : $hash->{status}\n";
  print "Title       : $hash->{name}\n";
  print "Version     : $hash->{version}\n";
  print "Released    : $hash->{released}\n\n";
}


!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;

bin/gmod_fetch_genes.PLS  view on Meta::CPAN


This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.  See DISCLAIMER.txt for
disclaimers of warranty.

=cut


!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;

bin/gmod_monitor_installation-wormbase.PLS  view on Meta::CPAN


This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.  See DISCLAIMER.txt for
disclaimers of warranty.

=cut


!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;

bin/gmod_monitor_installation.PLS  view on Meta::CPAN


This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.  See DISCLAIMER.txt for
disclaimers of warranty.

=cut


!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;

bin/gmod_standard_urls.PLS  view on Meta::CPAN


This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.  See DISCLAIMER.txt for
disclaimers of warranty.

=cut


!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;

bin/gmod_update_installation-wormbase.PLS  view on Meta::CPAN

Copyright (c) 2004-2005 Cold Spring Harbor Laboratory.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut


!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;

bin/gmod_update_installation.PLS  view on Meta::CPAN


This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.  See DISCLAIMER.txt for
disclaimers of warranty.

=cut


!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;

cgi-bin/defaults.wormbase.PLS  view on Meta::CPAN

CURRENT_RELEASE=/pub/wormbase/elegans-current_release
ARCHIVE_PATH=/usr/local/ftp/pub/wormbase/database_tarballs
ARCHIVE_REPOSITORY=/pub/wormbase/archive
END



exit 0;
!NO!SUBS!
close OUT or die "Can't close $file: $!\n";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;

cgi-bin/version.wormbase.PLS  view on Meta::CPAN

print "<mod_version>\n";
print "<name>WormBase</name>\n";
print "<description>$title</description>\n";
print "<version>$version</version>\n";
print "<release_date>$modtime</release_date>\n";
print "</mod_version>";

exit 0;
!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;

install_util/cgi_install.PLS  view on Meta::CPAN

  next if /~$/;
  next if /\.PLS$/;
  next unless (-f $_);
  next unless /$mod$/i;
  my $install_target = $_;
  $install_target =~ s/\.$mod//i;
  my $installfile = Bio::Root::IO->catfile($cgi_target, $install_target);
  warn "copying $_ to $installfile\n";
  copy($_, $installfile ) or die "unable to copy to $installfile\n";
  my $mode = 0755;
  chmod $mode, $installfile
    or die "unable to make $installfile world executable\n";
}

chdir $origdir or die "couldn't cd to $origdir: $!\n";
!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;

install_util/conf_install.PLS  view on Meta::CPAN

  }

  opendir(my $SOURCE, $source) or die "unable to opendir('$source'): $!";
  while(my $file = readdir($SOURCE)){
    next if $file =~ /\.PMS$/;

    my $sourcefile = Bio::Root::IO->catfile($source,$file);
    my $targetfile = Bio::Root::IO->catfile($target,$file);

    if(-f $sourcefile){
      chmod(0666,$targetfile);
#      copy($sourcefile,$targetfile) or die "unable to write to $targetfile: $!";
      copy_with_substitutions($sourcefile,$targetfile) or die "unable to write to $targetfile: $!";
      print STDERR "    file $sourcefile -> $targetfile\n" if DEBUG;
      chmod(0444,$targetfile);
    } elsif(-d $sourcefile && $recurse){
      next if $file eq '.' or $file eq '..' or $file eq 'CVS';
      print STDERR "directory $sourcefile -> $targetfile\n" if DEBUG;
      installdir(source => $sourcefile, target => $targetfile, recurse => 1);
    }
  }
  closedir($SOURCE);
}

sub copy_with_substitutions {

install_util/conf_install.PLS  view on Meta::CPAN

    s/\$(\w+)/$options{$1}||"\$$1"/eg;
    print OUT;
  }
  close OUT;
  close IN;
}

chdir $origdir or die "couldn't cd to $origdir: $!\n";
!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;

install_util/gbrowse_ppm_install.PLS  view on Meta::CPAN

    s/^\#!.+/$startperl -w/;
    s/^\$CONF_DIR\s*=\s*\'.+/\$CONF_DIR = '$conf';/;
    print OUT $_,"\n";
  }
  close F;
  close OUT;
  rename "$file.new",$file;
}
!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';

install_util/htdocs_install.PLS  view on Meta::CPAN

if (! (-e $ht_target) ) {
    mkpath($ht_target,0,0777) or die "unable to make $ht_target directory\n";
}

my $localhtdocsdir = "htdocs";
opendir HTDOCS, $localhtdocsdir or die "unable to opendir $localhtdocsdir\n";
while (my $file = readdir(HTDOCS) ) {
    my $localfile = Bio::Root::IO->catfile($localhtdocsdir, $file);
    if (-f $localfile) {
        my $installfile = Bio::Root::IO->catfile($ht_target, $file);
	chmod (0666, $installfile);
        copy_with_substitutions($localfile, $installfile)
           or die "unable to copy to $installfile\n";
	chmod (0444, $installfile);
    }
}
closedir HTDOCS; 

my $imagedir  = Bio::Root::IO->catfile($ht_target, "images");
my $buttondir = Bio::Root::IO->catfile($imagedir, "buttons");
if (! (-e $imagedir) ) {
    print "Making $imagedir...\n";
    mkdir($imagedir,0777) or die "unable to make $imagedir\n";
}

install_util/htdocs_install.PLS  view on Meta::CPAN

    print "Making $buttondir...\n";
    mkdir($buttondir,0777) or die "unable to make $buttondir\n";
}

my $localbuttondir = "htdocs/images/buttons";
opendir BUTTONS, $localbuttondir or die "unable to open $localbuttondir\n";
while (my $file = readdir(BUTTONS) ) {
    my $localfile = Bio::Root::IO->catfile($localbuttondir,$file);
    if (-f $localfile) {
        my $installfile = Bio::Root::IO->catfile($buttondir, $file);
	chmod (0666, $installfile);
        copy_with_substitutions($localfile, $installfile) 
            or die "unable to copy to $installfile\n"; 
	chmod (0444, $installfile);
    }
}
closedir BUTTONS;

my $helpdir = Bio::Root::IO->catfile($imagedir, "help");
if (! (-e $helpdir) ) {
    print "Making $helpdir...\n";
    mkdir($helpdir,0777) or die "unable to make $helpdir\n";
}

my $localhelpdir = "htdocs/images/help";
opendir HELP, $localhelpdir or die "unable to open $localhelpdir\n";
while (my $file = readdir(HELP) ) {
    my $localfile = Bio::Root::IO->catfile($localhelpdir, $file);
    if (-f "./htdocs/images/help/$file") {
        my $installfile = Bio::Root::IO->catfile($helpdir, $file);
	chmod (0666, $installfile);
        copy_with_substitutions($localfile, $installfile) 
            or die "unable to copy to $installfile\n";
	chmod (0444, $installfile);
    }
}
closedir HELP;

print "Installing temporary directory...\n";

my $tmpdir = Bio::Root::IO->catfile($ht_target, "tmp");
if (! (-e $tmpdir) ) {
    print "Making $tmpdir...\n";
    mkdir($tmpdir,0777) or die "unable to make $tmpdir\n";
    chmod 0777, $tmpdir or die "unable to make $tmpdir world writable\n";
}

print "Installing documentation...\n";
#this need to be replaced with:
#  a pod2html dohicky (it can create the html in the htdocs dir directly)
#  a wanted subroutine to do File::Find's work
#  also need to modify gbrowse/index.html
for my $localfile ("DISCLAIMER") {
  my $installfile = Bio::Root::IO->catfile($ht_target,basename($localfile));
  chmod (0666, $installfile);
  copy_with_substitutions($localfile,$installfile);
  chmod(0444,$installfile);
}

#installing pod docs
my $docdir = Bio::Root::IO->catfile($ht_target, "docs");
if (! (-e $docdir) ) {
    mkdir($docdir,0777) or die "unable to make $docdir\n";
}
my $poddir = Bio::Root::IO->catfile($docdir, "pod");
if (! (-e $poddir) ) {
    mkdir($poddir,0777) or die "unable to make $poddir\n";

install_util/htdocs_install.PLS  view on Meta::CPAN

copy_tree("./docs/tutorial",$ht_target);

print "Installing sample_data...\n";
copy_tree("./sample_data",$ht_target);

print "Installing contrib...\n";
copy_tree("./contrib",$ht_target);

print "Installing sample data files...\n";
copy_tree("./htdocs/databases","$ht_target");
chmod 0777,glob("$ht_target/databases/*");

print "\n\n#############################################################################\n";
print "GBrowse is now installed.  Read INSTALL for further setup instructions.\n";
print "Go to http://localhost/gbrowse/ for the online tutorial and reference manual.\n";
print "#############################################################################\n";

chdir $origdir or die "couldn't cd to $origdir: $!\n";
exit 0;

sub copy_tree {

install_util/htdocs_install.PLS  view on Meta::CPAN

    binmode OUT;
    my $buffer;
    print OUT $buffer while read(IN,$buffer,5000);
  }
  close OUT;
  close IN;
}

!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;



( run in 0.572 second using v1.01-cache-2.11-cpan-496ff517765 )