Update of /cvsroot/cogs/ensupdate
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14538
Modified Files:
getensembl.pl
Log Message:
added mysql connect params, wget alt, bugs
Index: getensembl.pl
===================================================================
RCS file: /cvsroot/cogs/ensupdate/getensembl.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** getensembl.pl 6 Dec 2005 14:58:55 -0000 1.7
--- getensembl.pl 14 Sep 2007 18:06:12 -0000 1.8
***************
*** 7,11 ****
# changes to remote directory <rmtdir>
# puts files in the local directory <locdir>
!
# Load the Net::FTP package
--- 7,12 ----
# changes to remote directory <rmtdir>
# puts files in the local directory <locdir>
! use lib '/perl/newlib/ia64-linux-multi-stdio';
! #use lib '/perl/newlib/ia64-linux-multi-stdio/auto';
# Load the Net::FTP package
***************
*** 18,24 ****
my $host=$ENV{ENS_HOST};
my $sock=$ENV{ENS_SOCK};
$enslogin=$user;
my $sid='ensembl_databases';
! my $cs = "dbi:mysql:$sid:$host;mysql_socket=$sock";
my $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ;
my $currenth=$dbh->prepare("select db_name, version from ens_dbnames where current = 'yes'")||die "Couldn't prepare the select statement\n";
--- 19,26 ----
my $host=$ENV{ENS_HOST};
my $sock=$ENV{ENS_SOCK};
+ my $port=$ENV{ENS_PORT};
$enslogin=$user;
my $sid='ensembl_databases';
! my $cs = "dbi:mysql:$sid:$host;mysql_socket=$sock;port=$port";
my $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ;
my $currenth=$dbh->prepare("select db_name, version from ens_dbnames where current = 'yes'")||die "Couldn't prepare the select statement\n";
***************
*** 77,81 ****
my @cl=split(/\s/,$db);
my $name=pop @cl;
! $ftp->cwd("$name/data/mysql")||die;
my @all=$ftp->dir;
foreach my $d (@all) {
--- 79,83 ----
my @cl=split(/\s/,$db);
my $name=pop @cl;
! $ftp->cwd("$name/data/mysql")||die $name;
my @all=$ftp->dir;
foreach my $d (@all) {
***************
*** 100,104 ****
next unless ($current{$core}<$v1);
next if (-e $core);
! $ftp->cwd("$core")||die;
print "Working on $core\n";
push @cores,$core;#Remember the DB names
--- 102,106 ----
next unless ($current{$core}<$v1);
next if (-e $core);
! $ftp->cwd("$core")||die $@,$core;
print "Working on $core\n";
push @cores,$core;#Remember the DB names
***************
*** 106,109 ****
--- 108,112 ----
chdir($core);
my @files=grep (!/total/,$ftp->dir);
+ my $cf=$ftp->pwd;
foreach my $file (@files) {
my @long=split(/\s+/,$file);
***************
*** 114,118 ****
next if (-e $dfile);
print "Getting $gfile..\n";
! $ftp->get($gfile);
#Gunzip as we go
system ("gunzip $gfile &");
--- 117,124 ----
next if (-e $dfile);
print "Getting $gfile..\n";
! #$ftp->get($gfile);
! my $cloc="ftp:\/\/ftp.ensembl.org/$cf/$gfile";
! print $cloc,"\n";
! unless (system("wget $cloc")==0) { warn "No $cloc"; next; }
#Gunzip as we go
system ("gunzip $gfile &");
***************
*** 120,126 ****
print "Done with $core\n";
chdir("..");
! $ftp->cwd('..');
}
$ftp->cwd("../../..");
}
--- 126,141 ----
print "Done with $core\n";
chdir("..");
! unless ($ftp->pwd) {
! $ftp = Net::FTP->new($host) or
! die "Cannot contact $host\n:$!";
! $ftp->login('anonymous', $enslogin) or
! die "Cannot login ($host)\n:". $ftp->message;
! }
! $ftp->cwd("/$cf")||die "CF: $cf";
! $ftp->cwd("..");
! print 'CW1',$ftp->pwd,"\n";
}
$ftp->cwd("../../..");
+ print 'CW2',$ftp->pwd,"\n";
}
|