53 lines
1.1 KiB
Perl
53 lines
1.1 KiB
Perl
|
#!/usr/bin/perl -w
|
||
|
use strict;
|
||
|
|
||
|
my $newFileName;
|
||
|
my $line;
|
||
|
|
||
|
my $sourceFile = shift;
|
||
|
my $menuName = shift;
|
||
|
|
||
|
print("mv -f ./$sourceFile.* /usr/local/biotools/db/\n");
|
||
|
print("cp -f ./$sourceFile /usr/local/biotools/db/\n");
|
||
|
|
||
|
|
||
|
|
||
|
print system("mv -f ./$sourceFile.* /usr/local/biotools/db/");
|
||
|
# or die ("cannot copy files\n");
|
||
|
print system("cp -f ./$sourceFile /usr/local/biotools/db/") ;
|
||
|
#or die ("cannot copy file\n");
|
||
|
|
||
|
|
||
|
open(MENUFILE, "/usr/local/biotools/GDE/CORE/.GDEmenus")
|
||
|
or die "cannot open menu file, sorry\n";
|
||
|
$newFileName = "/usr/local/biotools/GDE/CORE/.GDEmenusNew";
|
||
|
open(NEWFILE, ">$newFileName");
|
||
|
READLOOP:
|
||
|
while (<MENUFILE>){
|
||
|
print NEWFILE;
|
||
|
if (/^arg:BLASTDBPROT/){
|
||
|
print "FOUND\n";
|
||
|
while (<MENUFILE>){
|
||
|
print NEWFILE;
|
||
|
if (/^argchoice:/){
|
||
|
print NEWFILE "argchoice:$menuName:/usr/local/biotools/db/$sourceFile\n";
|
||
|
last READLOOP;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
while (<MENUFILE>){
|
||
|
print NEWFILE;
|
||
|
}
|
||
|
close(NEWFILE);
|
||
|
close(MENUFILE);
|
||
|
print "new file: $newFileName\n";
|
||
|
system("cp $newFileName /usr/local/biotools/GDE/CORE/.GDEmenus")
|
||
|
or die "cannot replace old menu file\n";
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|