Commit 3d317ca0 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 328186: checksetup.pl should display the version of Bugzilla - Patch by Rémi…

Bug 328186: checksetup.pl should display the version of Bugzilla - Patch by Rémi Zara <remi_zara@mac.com> r=mkanat a=justdave
parent 1e087ef9
...@@ -52,9 +52,6 @@ our @parampanels = (); ...@@ -52,9 +52,6 @@ our @parampanels = ();
); );
Exporter::export_ok_tags('admin', 'db', 'localconfig', 'params'); Exporter::export_ok_tags('admin', 'db', 'localconfig', 'params');
# Bugzilla version
$Bugzilla::Config::VERSION = "2.23.1+";
use vars qw(@param_list); use vars qw(@param_list);
# Data::Dumper is required as needed, below. The problem is that then when # Data::Dumper is required as needed, below. The problem is that then when
......
...@@ -299,7 +299,7 @@ sub check_mail_delivery_method { ...@@ -299,7 +299,7 @@ sub check_mail_delivery_method {
sub check_notification { sub check_notification {
my $option = shift; my $option = shift;
my @current_version = my @current_version =
($Bugzilla::Config::VERSION =~ m/^(\d+)\.(\d+)(?:(rc|\.)(\d+))?\+?$/); (BUGZILLA_VERSION =~ m/^(\d+)\.(\d+)(?:(rc|\.)(\d+))?\+?$/);
if ($current_version[1] % 2 && $option eq 'stable_branch_release') { if ($current_version[1] % 2 && $option eq 'stable_branch_release') {
return "You are currently running a development snapshot, and so your " . return "You are currently running a development snapshot, and so your " .
"installation is not based on a branch. If you want to be notified " . "installation is not based on a branch. If you want to be notified " .
......
...@@ -33,6 +33,8 @@ use strict; ...@@ -33,6 +33,8 @@ use strict;
use base qw(Exporter); use base qw(Exporter);
@Bugzilla::Constants::EXPORT = qw( @Bugzilla::Constants::EXPORT = qw(
BUGZILLA_VERSION
bz_locations bz_locations
CONTROLMAPNA CONTROLMAPNA
CONTROLMAPSHOWN CONTROLMAPSHOWN
...@@ -110,6 +112,10 @@ use base qw(Exporter); ...@@ -110,6 +112,10 @@ use base qw(Exporter);
# CONSTANTS # CONSTANTS
# #
# Bugzilla version
use constant BUGZILLA_VERSION => "2.23.1+";
#
# ControlMap constants for group_control_map. # ControlMap constants for group_control_map.
# membercontol:othercontrol => meaning # membercontol:othercontrol => meaning
# Na:Na => Bugs in this product may not be restricted to this # Na:Na => Bugs in this product may not be restricted to this
......
...@@ -795,9 +795,6 @@ sub create { ...@@ -795,9 +795,6 @@ sub create {
Bugzilla::BugMail::Send($id, $mailrecipients); Bugzilla::BugMail::Send($id, $mailrecipients);
}, },
# Bugzilla version
# This could be made a ref, or even a CONSTANT with TT2.08
'VERSION' => $Bugzilla::Config::VERSION ,
}, },
}) || die("Template creation failed: " . $class->error()); }) || die("Template creation failed: " . $class->error());
......
...@@ -76,7 +76,7 @@ sub get_notifications { ...@@ -76,7 +76,7 @@ sub get_notifications {
# On which branch is the current installation running? # On which branch is the current installation running?
my @current_version = my @current_version =
($Bugzilla::Config::VERSION =~ m/^(\d+)\.(\d+)(?:(rc|\.)(\d+))?\+?$/); (BUGZILLA_VERSION =~ m/^(\d+)\.(\d+)(?:(rc|\.)(\d+))?\+?$/);
my @release; my @release;
if (Bugzilla->params->{'upgrade_notification'} eq 'development_snapshot') { if (Bugzilla->params->{'upgrade_notification'} eq 'development_snapshot') {
......
...@@ -161,6 +161,7 @@ sub help_page { ...@@ -161,6 +161,7 @@ sub help_page {
my $programname = $0; my $programname = $0;
$programname =~ s#^\./##; $programname =~ s#^\./##;
print "$programname - checks your setup and updates your Bugzilla installation\n"; print "$programname - checks your setup and updates your Bugzilla installation\n";
printf "Version: " . BUGZILLA_VERSION . " on perl %vd\n", $^V;
print "\nUsage: $programname [SCRIPT [--verbose]] [--check-modules|--help]\n"; print "\nUsage: $programname [SCRIPT [--verbose]] [--check-modules|--help]\n";
print " [--no-templates]\n"; print " [--no-templates]\n";
print "\n"; print "\n";
...@@ -198,6 +199,12 @@ if ($ARGV[0] && ($ARGV[0] !~ /^-/)) { ...@@ -198,6 +199,12 @@ if ($ARGV[0] && ($ARGV[0] !~ /^-/)) {
} }
########################################################################### ###########################################################################
# Display version information
###########################################################################
printf "\n*** This is Bugzilla " . BUGZILLA_VERSION . " on perl %vd ***\n", $^V unless $silent;
###########################################################################
# Check required module # Check required module
########################################################################### ###########################################################################
......
...@@ -47,6 +47,7 @@ merge-users.pl - Merge two user accounts. ...@@ -47,6 +47,7 @@ merge-users.pl - Merge two user accounts.
use lib qw(.); use lib qw(.);
use Bugzilla; use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT); use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Util; use Bugzilla::Util;
...@@ -62,7 +63,7 @@ pod2usage(0) if $help; ...@@ -62,7 +63,7 @@ pod2usage(0) if $help;
# We require Bugzilla 2.20 or higher (including 2.22+). # We require Bugzilla 2.20 or higher (including 2.22+).
my $current_version = $Bugzilla::Config::VERSION; my $current_version = BUGZILLA_VERSION;
if ($current_version =~ /^2\.2[0123]/) { if ($current_version =~ /^2\.2[0123]/) {
print "OK, you are using Bugzilla $current_version\n" print "OK, you are using Bugzilla $current_version\n"
} }
......
...@@ -305,11 +305,11 @@ sub init() { ...@@ -305,11 +305,11 @@ sub init() {
my $urlbase = $root->{'att'}->{'urlbase'}; my $urlbase = $root->{'att'}->{'urlbase'};
my $xmlversion = $root->{'att'}->{'version'}; my $xmlversion = $root->{'att'}->{'version'};
if ($xmlversion ne $Bugzilla::Config::VERSION) { if ($xmlversion ne BUGZILLA_VERSION) {
my $log = "Possible version conflict!\n"; my $log = "Possible version conflict!\n";
$log .= " XML was exported from Bugzilla version $xmlversion\n"; $log .= " XML was exported from Bugzilla version $xmlversion\n";
$log .= " But this installation uses "; $log .= " But this installation uses ";
$log .= $Bugzilla::Config::VERSION . "\n"; $log .= BUGZILLA_VERSION . "\n";
Debug($log, OK_LEVEL); Debug($log, OK_LEVEL);
push(@logs, $log); push(@logs, $log);
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<?xml version="1.0" [% IF Param('utf8') %]encoding="UTF-8" [% END %]standalone="yes" ?> <?xml version="1.0" [% IF Param('utf8') %]encoding="UTF-8" [% END %]standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "[% Param('urlbase') %]bugzilla.dtd"> <!DOCTYPE bugzilla SYSTEM "[% Param('urlbase') %]bugzilla.dtd">
<bugzilla version="[% VERSION %]" <bugzilla version="[% constants.BUGZILLA_VERSION %]"
urlbase="[% Param('urlbase') %]" urlbase="[% Param('urlbase') %]"
maintainer="[% Param('maintainer') FILTER xml %]" maintainer="[% Param('maintainer') FILTER xml %]"
[% IF user.id %] [% IF user.id %]
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
// the global bugzilla url // the global bugzilla url
var installation = { var installation = {
base_url : '[% Param('urlbase') FILTER js %]', base_url : '[% Param('urlbase') FILTER js %]',
install_version : '[% VERSION FILTER js %]', install_version : '[% constants.BUGZILLA_VERSION FILTER js %]',
maintainer : '[% Param('maintainer') FILTER js %]' maintainer : '[% Param('maintainer') FILTER js %]'
}; };
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
xmlns:bz="http://www.bugzilla.org/rdf#"> xmlns:bz="http://www.bugzilla.org/rdf#">
<bz:installation rdf:about="[% Param('urlbase') FILTER html %]"> <bz:installation rdf:about="[% Param('urlbase') FILTER html %]">
<bz:install_version>[% VERSION FILTER html %]</bz:install_version> <bz:install_version>[% constants.BUGZILLA_VERSION FILTER html %]</bz:install_version>
<bz:maintainer>[% Param('maintainer') FILTER html %]</bz:maintainer> <bz:maintainer>[% Param('maintainer') FILTER html %]</bz:maintainer>
<bz:status> <bz:status>
......
...@@ -350,7 +350,7 @@ ...@@ -350,7 +350,7 @@
], ],
'bug/show.xml.tmpl' => [ 'bug/show.xml.tmpl' => [
'VERSION', 'constants.BUGZILLA_VERSION',
'a.id', 'a.id',
'field', 'field',
], ],
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = "$terms.Bugzilla Main Page" title = "$terms.Bugzilla Main Page"
h1 = "Main Page" h1 = "Main Page"
h3 = "version $VERSION" h3 = "version $constants.BUGZILLA_VERSION"
style_urls = [ 'skins/standard/index.css' ] style_urls = [ 'skins/standard/index.css' ]
onload = 'document.forms[\'f\'].quicksearch.focus();' onload = 'document.forms[\'f\'].quicksearch.focus();'
%] %]
......
...@@ -54,7 +54,7 @@ END:VTODO ...@@ -54,7 +54,7 @@ END:VTODO
END:VCALENDAR END:VCALENDAR
[% BLOCK ics_prodid %] [% BLOCK ics_prodid %]
[% "-//Mozilla/Bugzilla $VERSION//EN" FILTER ics('PRODID') %] [% "-//Mozilla/Bugzilla $constants.BUGZILLA_VERSION//EN" FILTER ics('PRODID') %]
[% END %] [% END %]
[% BLOCK ics_uid %] [% BLOCK ics_uid %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment