ensembl-hive  2.5
Version.pm
Go to the documentation of this file.
1 =pod
2 
3 =head1 NAME
4 
6 
7 =head1 SYNOPSIS
8 
10 
11 =head1 DESCRIPTION
12 
13  Version number of the Hive code.
14 
15 =head1 LICENSE
16 
17  Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
18  Copyright [2016-2022] EMBL-European Bioinformatics Institute
19 
20  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
21  You may obtain a copy of the License at
22 
23  http://www.apache.org/licenses/LICENSE-2.0
24 
25  Unless required by applicable law or agreed to in writing, software distributed under the License
26  is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27  See the License for the specific language governing permissions and limitations under the License.
28 
29 =head1 CONTACT
30 
31  Please subscribe to the Hive mailing list: http://listserver.ebi.ac.uk/mailman/listinfo/ehive-users to discuss Hive-related questions or to be notified of our updates
32 
33 =cut
34 
35 
36 package Bio::EnsEMBL::Hive::Version;
37 
38 use strict;
39 use warnings;
40 
45 
46 use Exporter 'import';
47 our @EXPORT_OK = qw(get_code_version report_versions);
48 
49 
50 our $VERSION = '2.5';
51 
52 sub get_code_version {
53 
54  return $VERSION;
55 }
56 
57 
58 sub report_versions {
59  print "CodeVersion\t".get_code_version()."\n";
60  print "CompatibleHiveDatabaseSchemaVersion\t".Bio::EnsEMBL::Hive::DBSQL::SqlSchemaAdaptor->get_code_sql_schema_version()."\n";
61 
62  print "MeadowInterfaceVersion\t".Bio::EnsEMBL::Hive::Meadow->get_meadow_major_version()."\n";
63  my $meadow_class_path = Bio::EnsEMBL::Hive::Valley->meadow_class_path;
64  foreach my $meadow_class (sort @{ Bio::EnsEMBL::Hive::Valley->loaded_meadow_drivers }) {
65  $meadow_class=~/^${meadow_class_path}::(.+)$/;
66  my $meadow_driver = $1;
67  my $meadow_version = $meadow_class->get_meadow_version;
68  my $compatible = $meadow_class->check_version_compatibility;
69  my $status = $compatible
70  ? ( $meadow_class->name
71  ? 'available'
72  : 'unavailable'
73  )
74  : 'incompatible';
75  print '',join("\t", 'Meadow::'.$meadow_driver, $meadow_version, $status)."\n";
76  }
77 
78  print "GuestLanguageInterfaceVersion\t".Bio::EnsEMBL::Hive::GuestProcess->get_protocol_version()."\n";
79  my $registered_wrappers = Bio::EnsEMBL::Hive::GuestProcess->_get_all_registered_wrappers;
80  foreach my $language (sort keys %$registered_wrappers) {
81  my $wrapper_path = $registered_wrappers->{$language};
82  my $status = 'unavailable';
83  my $language_version;
84  if (-s $wrapper_path and -x $wrapper_path) {
85  $language_version = `$wrapper_path version 2> /dev/null`;
86  chomp $language_version;
87  $status = Bio::EnsEMBL::Hive::GuestProcess->check_version_compatibility($language_version) ? 'available' : 'incompatible';
88  }
89  print join("\t", "GuestLanguage[$language]", $language_version || 'N/A', $status)."\n";
90  }
91 }
92 
93 
94 1;