From: kirovs <ki...@us...> - 2005-12-06 14:59:03
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15486 Modified Files: getensembl.pl Log Message: release system in place Index: getensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/getensembl.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** getensembl.pl 5 Dec 2005 17:57:10 -0000 1.6 --- getensembl.pl 6 Dec 2005 14:58:55 -0000 1.7 *************** *** 14,18 **** #Check for current version ! my $user=$ENV{ENS_USER}; my $pass=$ENV{ENS_PASS}; my $host=$ENV{ENS_HOST}; --- 14,18 ---- #Check for current version ! my $user=$ENV{ENS_ADMIN}; my $pass=$ENV{ENS_PASS}; my $host=$ENV{ENS_HOST}; *************** *** 54,93 **** $ftp->cwd($rmtdir) or die "Cannot change directory ($rmtdir)\n:".$ftp->message; ! my @files=grep(/-/&&!/README/i&&!/Current/i&&!/\-2$/,$ftp->dir); #Hope there are not going to be any more db-2 entries in the future ! ! my @names; ! foreach my $row (@files) { ! my @dat=split(/\s/,$row); ! my $name=pop @dat; ! if (($name=~/-/) && (!grep(/\b$name\b/,@exclusion_list))){ ! push @names,$name; ! } ! } ! #Get only the most recent version ! my %dbs; ! foreach my $name (@names) { my @dat=split(/-/,$name); my $version=pop @dat; ! my $dbname=join("-",@dat); ! if ($dbs{$dbname} <$version) { ! $dbs{$dbname}=$version; ! } ! } ! my @dbs; ! foreach my $key (keys %dbs) { ! push @dbs, $key."-".$dbs{$key}; } print "Retrieving files\n"; ! my @cores; #This is only for the core DB- get foreach my $db (@dbs) { ! $ftp->cwd("$db/data/mysql/"); ! ! my @all=$ftp->dir; foreach my $d (@all) { - next unless ($d=~/current/i);#Only data dirs if ($#list>-1) { my $req; #Check if this DB is requested --- 54,83 ---- $ftp->cwd($rmtdir) or die "Cannot change directory ($rmtdir)\n:".$ftp->message; ! my @files=grep(/^d.*\srelease/,$ftp->dir); #Use new release system ! #Get only the most recent release ! my ($lv,$lr); ! foreach my $rel (@files) { ! my @all=split(/\s/,$rel); ! my $name=pop @all; my @dat=split(/-/,$name); my $version=pop @dat; ! if ($version>$lv) { ! $lv=$version; ! $lr=$name; ! } } + $ftp->cwd($lr)||die; print "Retrieving files\n"; ! my @dbs=$ftp->dir; my @cores; #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; ! my @all=$ftp->dir; foreach my $d (@all) { if ($#list>-1) { my $req; #Check if this DB is requested *************** *** 108,114 **** my $v2=($#dat<2)? 1:pop @dat; my $version=$v2."_".$v1; ! next unless ($current{$core}<$version); next if (-e $core); ! $ftp->cwd("$core/data/mysql")||die; print "Working on $core\n"; push @cores,$core;#Remember the DB names --- 98,104 ---- my $v2=($#dat<2)? 1:pop @dat; my $version=$v2."_".$v1; ! 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 *************** *** 135,139 **** } ! open (DBS, ">dbs" )||die"Cannot write the database data\n"; foreach my $db (@cores) { print DBS $db,"\n"; --- 125,129 ---- } ! open (DBS, ">dbs" )||die "Cannot write the database data\n"; foreach my $db (@cores) { print DBS $db,"\n"; |