From b4109258853e409ba35d86769b229e2d2dbfd834 Mon Sep 17 00:00:00 2001 From: Laurent Gil Date: Fri, 15 Feb 2019 10:57:45 +0000 Subject: [PATCH] Fix the installation script when an older version of VEP is specified with the flag '--VERSION' --- INSTALL.pl | 25 ++++++++++++++++++++----- modules/Bio/EnsEMBL/VEP/Constants.pm | 2 +- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/INSTALL.pl b/INSTALL.pl index 03c2a2995..4a3005d25 100755 --- a/INSTALL.pl +++ b/INSTALL.pl @@ -320,10 +320,18 @@ () my $current_branch = $CURRENT_VERSION_DATA->{'ensembl-vep'}->{release}; + # Check if the $API_VERSION has been set by the "--VERSION" flag + my $api_branch = $API_VERSION; + $api_branch =~ s/release\///; + my $message; + # branch provided by the "--VERSION" flag + if ($api_branch != $current_branch) { + $message = "The 'VERSION' installation flag is going to be deprecated in release 96 (Spring 2019).\n"; + } # don't have latest - if($current_branch < $default_branch_number) { + elsif($current_branch < $default_branch_number) { $message = "Version check reports a newer release of $module is available ". "(installed: $current_branch, available: $default_branch_number)\n"; @@ -347,12 +355,19 @@ () # user has git, suggest they use that instead if(`which git` && -d $RealBin.'/.git') { - print "You may use git to update $module by exiting this installer and running:\n\n"; + my $branch; + if ($api_branch != $current_branch) { + $branch = looks_like_number($API_VERSION) ? 'release/'.$API_VERSION : $API_VERSION; + } + elsif ($current_branch ne $default_branch_number) { + $branch = $default_branch; + } + print "We recommend using git to update '$module', by exiting this installer and running:\n\n"; print "git pull\n"; - print "git checkout $default_branch\n" if $current_branch ne $default_branch_number; + print "git checkout $branch\n" if $branch; } else { - print "You should exit this installer and re-download $module if you wish to update\n"; + print "You should exit this installer and re-download '$module' if you wish to update\n"; } print "\nDo you wish to exit so you can get updates (y) or continue (n): "; @@ -708,7 +723,7 @@ sub get_vep_sub_version { my $release = shift || $API_VERSION; my $sub_file = "$RealBin/$$\.$VEP_MODULE_NAME.sub"; - my $release_url_string = looks_like_number($API_VERSION) ? 'release/'.$API_VERSION : $API_VERSION; + my $release_url_string = looks_like_number($release) ? 'release/'.$release : $release; download_to_file( sprintf( diff --git a/modules/Bio/EnsEMBL/VEP/Constants.pm b/modules/Bio/EnsEMBL/VEP/Constants.pm index 3aedf47f0..199a37dea 100644 --- a/modules/Bio/EnsEMBL/VEP/Constants.pm +++ b/modules/Bio/EnsEMBL/VEP/Constants.pm @@ -53,7 +53,7 @@ use warnings; use base qw(Exporter); our $VEP_VERSION = 95; -our $VEP_SUB_VERSION = 1; +our $VEP_SUB_VERSION = 2; our @EXPORT_OK = qw( @FLAG_FIELDS