Skip to content

Commit

Permalink
v0.9.2
Browse files Browse the repository at this point in the history
Fixed curl https bug, fixed wget recognition bug
  • Loading branch information
Drmirdeep committed Nov 13, 2017
1 parent b18258c commit 90ecf5a
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions install.pl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
$progs{pdf}=0;
$progs{ttf}=0;

my $wget=`which wget`;
my $wget=`wget 2>&1`;
my $curl=`which curl`;

my $dtool='';
Expand Down Expand Up @@ -273,8 +273,12 @@
if($err){
die "\nError:\n\t$bowtie could not be downloaded\n\n\n";
}
}elsif(check("https://sourceforge.net/projects/bowtie-bio/files/bowtie/$bowtie_version/$bowtie")){
$err=system("$dtool https://sourceforge.net/projects/bowtie-bio/files/bowtie/$bowtie_version/$bowtie $dopt");
}elsif(check("https://sourceforge.net/projects/bowtie-bio/files/bowtie/$bowtie_version/$bowtie",$bowtie)){
if(not -f $bowtie){
$err=system("$dtool https://sourceforge.net/projects/bowtie-bio/files/bowtie/$bowtie_version/$bowtie $dopt");
}else{
$err=0;
}
if($err){
die "\nError:\n\t$bowtie could not be downloaded\n\n\n";
}
Expand All @@ -298,7 +302,7 @@

chdir "$install_bin_dir";

buildgood("$dir/essentials/bowtie-$bv/bowtie");
buildgood("$dir/essentials/bowtie-$bv/bowtie","bowtie");

if(not -f "bowtie"){
system("ln -s $dir/essentials/bowtie-$bv/bowtie* .");
Expand All @@ -319,8 +323,12 @@
print STDERR "Downloading Vienna package now\n\n";
my $ptc="https://www.tbi.univie.ac.at/RNA/download/sourcecode/1_8_x/ViennaRNA-1.8.4.tar.gz";
# if(check("http://www.tbi.univie.ac.at/RNA/packages/source/ViennaRNA-1.8.4.tar.gz")){ # address changed
if(check($ptc)){
$err=system("$dtool $ptc $dopt");
if(check($ptc,$dfile)){
if(not -f $dfile){
$err=system("$dtool $ptc $dopt");
}else{
$err=0;
}
if($err){
die "Download of Vienna package not successful\n\n";
}
Expand Down Expand Up @@ -363,7 +371,7 @@
`make 1>> ../install.log 2>> ../install_error.log`;
`make install 1>> ../install.log 2>> ../install_error.log`;

buildgood("$dir/essentials/ViennaRNA-1.8.4/install_dir/bin/RNAfold");
buildgood("$dir/essentials/ViennaRNA-1.8.4/install_dir/bin/RNAfold","RNAfold");

chdir("..");
chdir "$install_bin_dir";
Expand Down Expand Up @@ -490,7 +498,7 @@
`mv Makefile_new Makefile`;

`make 1>>../install.log 2>>../install_error.log`;
buildgood("$dir/essentials/randfold-2.0/randfold");
buildgood("$dir/essentials/randfold-2.0/randfold","randfold");
chdir("..");
}

Expand Down Expand Up @@ -745,7 +753,7 @@ sub checkBIN{


sub check{
my ($url) = @_;
my ($url,$file) = @_;
my $out='';
if($dtool =~ /wget/){
$out=`wget --spider -v $url 2>&1`;
Expand All @@ -754,11 +762,22 @@ sub check{
if($out =~ /NOT/i){
$out='broken';
}

if($url =~ /https/){
`curl $url > $file`;
if(-s "$file" < 1000){
$out='broken';
`rm -f $file`;
}else{
$out=0;
}
}

}else{
die "No download tool found\nplease install wget or curl\n";
}

if($out =~ /broken/){
if($out =~ /broken/i){
return 0;
}else{
return 1;
Expand All @@ -769,6 +788,7 @@ sub check{
sub buildgood{
if(-f $_[0]){
print STDERR "Building of $_[0] successful\n";
$progs{$_[1]}=1;
}else{
die "Building of $_[0] not successful\nPlease have a look at the install.log and install_error.log in
the essentials directory
Expand Down

0 comments on commit 90ecf5a

Please sign in to comment.