From: lpsolit%gmail.com <> Date: Mon, 3 Jul 2006 15:53:24 +0000 (+0000) Subject: Bug 328186: checksetup.pl should display the version of Bugzilla - Patch by Rémi... X-Git-Tag: bugzilla-2.23.2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d317ca092cec05ad9dcdd3815d74bedbd9f3412;p=thirdparty%2Fbugzilla.git Bug 328186: checksetup.pl should display the version of Bugzilla - Patch by Rémi Zara r=mkanat a=justdave --- diff --git a/Bugzilla/Config.pm b/Bugzilla/Config.pm index a1c4b1f255..0e0c9d4e26 100644 --- a/Bugzilla/Config.pm +++ b/Bugzilla/Config.pm @@ -52,9 +52,6 @@ our @parampanels = (); ); Exporter::export_ok_tags('admin', 'db', 'localconfig', 'params'); -# Bugzilla version -$Bugzilla::Config::VERSION = "2.23.1+"; - use vars qw(@param_list); # Data::Dumper is required as needed, below. The problem is that then when diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm index 416a878496..9fe648d013 100644 --- a/Bugzilla/Config/Common.pm +++ b/Bugzilla/Config/Common.pm @@ -299,7 +299,7 @@ sub check_mail_delivery_method { sub check_notification { my $option = shift; 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') { return "You are currently running a development snapshot, and so your " . "installation is not based on a branch. If you want to be notified " . diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm index 0eeb9be664..af1357a992 100644 --- a/Bugzilla/Constants.pm +++ b/Bugzilla/Constants.pm @@ -33,6 +33,8 @@ use strict; use base qw(Exporter); @Bugzilla::Constants::EXPORT = qw( + BUGZILLA_VERSION + bz_locations CONTROLMAPNA CONTROLMAPSHOWN @@ -109,6 +111,10 @@ use base qw(Exporter); @Bugzilla::Constants::EXPORT_OK = qw(contenttypes); # CONSTANTS +# +# Bugzilla version +use constant BUGZILLA_VERSION => "2.23.1+"; + # # ControlMap constants for group_control_map. # membercontol:othercontrol => meaning diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 59cf02dc47..2a6cb901d7 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -795,9 +795,6 @@ sub create { 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()); diff --git a/Bugzilla/Update.pm b/Bugzilla/Update.pm index 1aef2bf177..31cb2cac06 100644 --- a/Bugzilla/Update.pm +++ b/Bugzilla/Update.pm @@ -76,7 +76,7 @@ sub get_notifications { # On which branch is the current installation running? my @current_version = - ($Bugzilla::Config::VERSION =~ m/^(\d+)\.(\d+)(?:(rc|\.)(\d+))?\+?$/); + (BUGZILLA_VERSION =~ m/^(\d+)\.(\d+)(?:(rc|\.)(\d+))?\+?$/); my @release; if (Bugzilla->params->{'upgrade_notification'} eq 'development_snapshot') { diff --git a/checksetup.pl b/checksetup.pl index 349ac0b461..cde3716417 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -161,6 +161,7 @@ sub help_page { my $programname = $0; $programname =~ s#^\./##; 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 " [--no-templates]\n"; print "\n"; @@ -197,6 +198,12 @@ if ($ARGV[0] && ($ARGV[0] !~ /^-/)) { $silent = !grep(/^--no-silent$/, @ARGV) && !grep(/^--verbose$/, @ARGV); } +########################################################################### +# Display version information +########################################################################### + +printf "\n*** This is Bugzilla " . BUGZILLA_VERSION . " on perl %vd ***\n", $^V unless $silent; + ########################################################################### # Check required module ########################################################################### diff --git a/contrib/merge-users.pl b/contrib/merge-users.pl index c8537c661f..540b22fb95 100644 --- a/contrib/merge-users.pl +++ b/contrib/merge-users.pl @@ -47,6 +47,7 @@ merge-users.pl - Merge two user accounts. use lib qw(.); use Bugzilla; +use Bugzilla::Constants; use Bugzilla::Config qw(:DEFAULT); use Bugzilla::Util; @@ -62,7 +63,7 @@ pod2usage(0) if $help; # 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]/) { print "OK, you are using Bugzilla $current_version\n" } diff --git a/importxml.pl b/importxml.pl index 995238be14..059adb4378 100755 --- a/importxml.pl +++ b/importxml.pl @@ -305,11 +305,11 @@ sub init() { my $urlbase = $root->{'att'}->{'urlbase'}; my $xmlversion = $root->{'att'}->{'version'}; - if ($xmlversion ne $Bugzilla::Config::VERSION) { + if ($xmlversion ne BUGZILLA_VERSION) { my $log = "Possible version conflict!\n"; $log .= " XML was exported from Bugzilla version $xmlversion\n"; $log .= " But this installation uses "; - $log .= $Bugzilla::Config::VERSION . "\n"; + $log .= BUGZILLA_VERSION . "\n"; Debug($log, OK_LEVEL); push(@logs, $log); } diff --git a/template/en/default/bug/show.xml.tmpl b/template/en/default/bug/show.xml.tmpl index 1e35d8f363..a941ebc62c 100644 --- a/template/en/default/bug/show.xml.tmpl +++ b/template/en/default/bug/show.xml.tmpl @@ -24,7 +24,7 @@ - - [% VERSION FILTER html %] + [% constants.BUGZILLA_VERSION FILTER html %] [% Param('maintainer') FILTER html %] diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index eee3b89637..14043a9bfd 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -350,7 +350,7 @@ ], 'bug/show.xml.tmpl' => [ - 'VERSION', + 'constants.BUGZILLA_VERSION', 'a.id', 'field', ], diff --git a/template/en/default/index.html.tmpl b/template/en/default/index.html.tmpl index 053c03b92e..9e11e4af0f 100644 --- a/template/en/default/index.html.tmpl +++ b/template/en/default/index.html.tmpl @@ -32,7 +32,7 @@ [% PROCESS global/header.html.tmpl title = "$terms.Bugzilla Main Page" h1 = "Main Page" - h3 = "version $VERSION" + h3 = "version $constants.BUGZILLA_VERSION" style_urls = [ 'skins/standard/index.css' ] onload = 'document.forms[\'f\'].quicksearch.focus();' %] diff --git a/template/en/default/list/list.ics.tmpl b/template/en/default/list/list.ics.tmpl index 6246cf7551..f857d30b60 100644 --- a/template/en/default/list/list.ics.tmpl +++ b/template/en/default/list/list.ics.tmpl @@ -54,7 +54,7 @@ END:VTODO END:VCALENDAR [% BLOCK ics_prodid %] - [% "-//Mozilla/Bugzilla $VERSION//EN" FILTER ics('PRODID') %] + [% "-//Mozilla/Bugzilla $constants.BUGZILLA_VERSION//EN" FILTER ics('PRODID') %] [% END %] [% BLOCK ics_uid %]