From 212bece680111857523f40967bf7c7375762bd3a Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Fri, 5 Dec 2008 19:24:18 +0000 Subject: [PATCH] merged in Lincoln's additions and swapped mirrors 1 and 2 for sourceforge since 1 is failing right now (if that continues, we should look at putting a different server in). --- bin/gbrowse_netinstall.pl | 52 +++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/bin/gbrowse_netinstall.pl b/bin/gbrowse_netinstall.pl index ba8cc2353..8cd85d0f0 100755 --- a/bin/gbrowse_netinstall.pl +++ b/bin/gbrowse_netinstall.pl @@ -1,4 +1,3 @@ -# #/usr/bin/perl =head1 NAME @@ -14,7 +13,7 @@ =head1 SYNOPSIS -h|--help Show this message -d|--dev Use the developement version of both GBrowse and bioperl from CVS - --bioperl_dev Use the development version of BioPerl from CVS + --bioperl_dev Use the development version of BioPerl from SVN --gbrowse_dev Use the development version of GBrowse from CVS --build_param_str= Use this string to set Makefile.PL parameters such as CONF or PREFIX for GBrowse @@ -64,7 +63,7 @@ =head1 DESCRIPTION use constant NMAKE => 'http://download.microsoft.com/download/vc15/patch/1.52/w95/en-us/nmake15.exe'; my ( $show_help, $get_from_cvs, $build_param_string, $working_dir, - $get_gbrowse_cvs, $get_bioperl_cvs, $is_cygwin, $windows, + $get_gbrowse_cvs, $get_bioperl_svn, $is_cygwin, $windows, $binaries, $make, $tmpdir, $wincvs, $gbrowse_path,$bioperl_path, $skip_start, $install_param_string, $skip_bioperl); @@ -74,7 +73,7 @@ BEGIN 'h|help' => \$show_help, # Show help and exit 'd|dev' => \$get_from_cvs, # Use the dev cvs 'build_param_str=s' => \$build_param_string, # Build parameters - 'bioperl_dev' => \$get_bioperl_cvs, + 'bioperl_dev' => \$get_bioperl_svn, 'gbrowse_dev' => \$get_gbrowse_cvs, 'wincvs' => \$wincvs, 'gbrowse_path=s' => \$gbrowse_path, @@ -161,7 +160,7 @@ BEGIN $is_cygwin = 1 if ( $^O eq 'cygwin' ); if ($get_from_cvs) { - $get_bioperl_cvs = $get_gbrowse_cvs = 1; + $get_bioperl_svn = $get_gbrowse_cvs = 1; } if ($windows and !$wincvs and $get_gbrowse_cvs ) { @@ -172,12 +171,12 @@ BEGIN $build_param_string ||=""; $install_param_string ||=""; -use constant BIOPERL_VERSION => 'bioperl-1.5.2_102'; -use constant BIOPERL_REQUIRES => '1.005002'; # sorry for the redundancy +use constant BIOPERL_VERSION => 'bioperl-1.5.2_103'; +use constant BIOPERL_REQUIRES => '1.005003'; # sorry for the redundancy use constant BIOPERL_LIVE_URL => 'http://bioperl.org/DIST/nightly_builds/'; use constant GBROWSE_DEFAULT => '1.69'; -use constant SOURCEFORGE_MIRROR1 => 'http://superb-west.dl.sourceforge.net/sourceforge/gmod/'; -use constant SOURCEFORGE_MIRROR2 => 'http://easynews.dl.sourceforge.net/sourceforge/gmod/'; +use constant SOURCEFORGE_MIRROR2 => 'http://superb-west.dl.sourceforge.net/sourceforge/gmod/'; +use constant SOURCEFORGE_MIRROR1 => 'http://easynews.dl.sourceforge.net/sourceforge/gmod/'; use constant SOURCEFORGE_GBROWSE => 'http://sourceforge.net/project/showfiles.php?group_id=27707&package_id=34513'; use constant BIOPERL => 'http://bioperl.org/DIST/'.BIOPERL_VERSION.'.tar.gz'; @@ -224,17 +223,24 @@ BEGIN CPAN::Shell->install('Statistics::Descriptive'); unless ($skip_bioperl) { - $get_bioperl_cvs = 1; + $get_bioperl_svn = 1; print STDERR "\n\nForce getting a BioPerl nightly build; the most recent release is too old\n"; my $version = BIOPERL_REQUIRES; - if (!(eval "use Bio::Perl $version; 1") or $get_bioperl_cvs or $bioperl_path) { + if (!(eval "use Bio::Perl $version; 1") or $get_bioperl_svn or $bioperl_path) { print STDERR "\n*** Installing BioPerl ***\n"; - if ($windows and !$get_bioperl_cvs and !$bioperl_path) { + if ($windows and !$get_bioperl_svn and !$bioperl_path) { my $bioperl_index = find_bioperl_ppm(); system("ppm install --force $bioperl_index"); } else { - CPAN::Shell->install('Module::Build'); - do_install(BIOPERL,'bioperl.tgz',BIOPERL_VERSION,'Build',$get_bioperl_cvs,'',$bioperl_path); + # recent versions of Module::Build fail to install without force! + CPAN::Shell->force('Module::Build') unless eval "require Module::Build; 1"; + do_install(BIOPERL, + 'bioperl.tgz', + BIOPERL_VERSION, + 'Build', + $get_bioperl_svn ? 'svn' : '', + '', + $bioperl_path); } } else { @@ -246,7 +252,14 @@ BEGIN my $latest_version = find_gbrowse_latest(); my $gbrowse = SOURCEFORGE_MIRROR1.$latest_version.'.tar.gz'; -eval {do_install($gbrowse,'gbrowse.tgz',$latest_version,'make',$get_gbrowse_cvs,$build_param_string,$gbrowse_path,$install_param_string)}; +eval {do_install($gbrowse, + 'gbrowse.tgz', + $latest_version, + 'make', + $get_gbrowse_cvs ? 'cvs' : '', + $build_param_string, + $gbrowse_path, + $install_param_string)}; if ($@ =~ /Could not download/) { print STDERR "Could not download: server down? Trying a different server...\n"; $gbrowse = SOURCEFORGE_MIRROR2.$latest_version.'.tar.gz'; @@ -263,6 +276,7 @@ sub do_install { my ($download,$local_name,$distribution,$method, $from_cvs,$build_param_string,$file_path,$install_param_string) = @_; + $install_param_string ||= ''; chdir $tmpdir; do_get_distro($download,$local_name,$distribution,$from_cvs,$file_path); @@ -282,7 +296,7 @@ sub do_install { } sub do_get_distro { - my ($download,$local_name,$distribution,$from_cvs,$file_path) = @_; + my ($download,$local_name,$distribution,$distribution_method,$file_path) = @_; if ($file_path) { chdir $working_dir; @@ -301,18 +315,18 @@ sub do_get_distro { chdir $tmpdir; extract_tarball($local_name,$distribution); } - elsif ($from_cvs) { + elsif ($distribution_method) { my $distribution_dir; if ($local_name =~ /gbrowse/) { $distribution_dir = 'Generic-Genome-Browser'; print STDERR "\n\nPlease press return when prompted for a password.\n"; unless ( (system( - 'cvs -d:pserver:anonymous@gmod.cvs.sourceforge.net:/cvsroot/gmod login')==0 + '$distribution_method -d:pserver:anonymous@gmod.cvs.sourceforge.net:/cvsroot/gmod login')==0 or $is_cygwin) && (system( - 'cvs -z3 -d:pserver:anonymous@gmod.cvs.sourceforge.net:/cvsroot/gmod co -kb -P -r stable Generic-Genome-Browser') == 0 + '$distribution_method -z3 -d:pserver:anonymous@gmod.cvs.sourceforge.net:/cvsroot/gmod co -kb -P -r stable Generic-Genome-Browser') == 0 or $is_cygwin) ) {