Skip to content

Commit

Permalink
Merge pull request #390 from ens-lgil/feature/install_with_version_flag
Browse files Browse the repository at this point in the history
Fix the installation script when an older version of VEP is specified…
  • Loading branch information
ens-lgil committed Feb 15, 2019
2 parents f9c3163 + b410925 commit fbe31be
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
25 changes: 20 additions & 5 deletions INSTALL.pl
Expand Up @@ -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";
Expand All @@ -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): ";
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/Constants.pm
Expand Up @@ -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
Expand Down

0 comments on commit fbe31be

Please sign in to comment.