From: kirovs <ki...@us...> - 2007-10-23 20:23:28
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29078 Modified Files: getensembl.pl Log Message: New ftp rep structure, some bugs Index: getensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/getensembl.pl,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** getensembl.pl 14 Sep 2007 18:06:12 -0000 1.8 --- getensembl.pl 23 Oct 2007 20:23:24 -0000 1.9 *************** *** 28,32 **** my @current=@{$currenth->fetchall_arrayref}; foreach my $val (@current) { ! $current{$val->[0]}=$val->[1]; } my $prefix=$ENV{ENS_DATA}; --- 28,34 ---- my @current=@{$currenth->fetchall_arrayref}; foreach my $val (@current) { ! my @dat=split(/_/,$val->[0]); ! my $cn=join('_',@dat[0..2]); ! $current{$cn}=$val->[1]; } my $prefix=$ENV{ENS_DATA}; *************** *** 70,74 **** } } ! $ftp->cwd($lr)||die; print "Retrieving files\n"; --- 72,76 ---- } } ! $ftp->cwd("$lr/mysql")||die; print "Retrieving files\n"; *************** *** 77,89 **** #This is only for the core DB- get foreach my $db (@dbs) { ! my @cl=split(/\s/,$db); ! my $name=pop @cl; ! $ftp->cwd("$name/data/mysql")||die $name; ! my @all=$ftp->dir; ! foreach my $d (@all) { ! if ($#list>-1) { my $req; #Check if this DB is requested foreach my $target (@list) { ! if ($d=~/$target/) { $req++; last; --- 79,86 ---- #This is only for the core DB- get foreach my $db (@dbs) { ! if ($#list>-1) { my $req; #Check if this DB is requested foreach my $target (@list) { ! if ($db=~/$target/) { $req++; last; *************** *** 92,98 **** next unless ($req); } ! ! my @long=split(/\s/,$d); ! my $core=pop @long; #Check if newer my @dat=split(/_/,$core); --- 89,94 ---- next unless ($req); } ! my @cl=split(/\s/,$db); ! my $core=pop @cl; #Check if newer my @dat=split(/_/,$core); *************** *** 100,110 **** my $v2=($#dat<2)? 1:pop @dat; my $version=$v2."_".$v1; ! 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 mkdir($core); chdir($core); my @files=grep (!/total/,$ftp->dir); my $cf=$ftp->pwd; --- 96,114 ---- my $v2=($#dat<2)? 1:pop @dat; my $version=$v2."_".$v1; ! my $dbname=join('_',@dat); ! next unless ($current{$dbname}<$version); next if (-e $core); ! $ftp->cwd($core)||die $@,$core; print "Working on $core\n"; push @cores,$core;#Remember the DB names mkdir($core); chdir($core); + + + #$ftp->cwd($name)||die $name; + my @all=$ftp->dir; + foreach my $d (@all) { + + my @files=grep (!/total/,$ftp->dir); my $cf=$ftp->pwd; *************** *** 118,122 **** 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; } --- 122,126 ---- 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; } |