From 47ee48a70f9abe53bc5e934f6e83c997b350dc6b Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Thu, 14 Sep 2006 10:12:22 +0000 Subject: Bug 277502: Re-organize checksetup.pl to be understood more easily (make it a short series of subroutines) Patch By Max Kanat-Alexander (module owner) a=justdave --- Bugzilla/Install.pm | 3 +- Bugzilla/Install/Requirements.pm | 17 + checksetup.pl | 511 +++++++++++++------------- template/en/default/global/messages.html.tmpl | 6 + 4 files changed, 289 insertions(+), 248 deletions(-) diff --git a/Bugzilla/Install.pm b/Bugzilla/Install.pm index 1a910f8e0..c50abea95 100644 --- a/Bugzilla/Install.pm +++ b/Bugzilla/Install.pm @@ -375,7 +375,8 @@ sub get_text { my $message; $template->process('global/message.txt.tmpl', $vars, \$message) || ThrowTemplateError($template->error()); - $message =~ s/^\s+//gm; + # Remove the indenting that exists in messages.html.tmpl. + $message =~ s/^ //gm; return $message; } diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm index ea3d81eb9..fbe153b25 100644 --- a/Bugzilla/Install/Requirements.pm +++ b/Bugzilla/Install/Requirements.pm @@ -25,6 +25,8 @@ package Bugzilla::Install::Requirements; use strict; +use POSIX (); + use base qw(Exporter); our @EXPORT = qw( REQUIRED_MODULES @@ -33,6 +35,7 @@ our @EXPORT = qw( check_requirements check_graphviz + display_version_and_os have_vers vers_cmp install_command @@ -392,6 +395,20 @@ sub check_graphviz { return $return; } +sub display_version_and_os { + # Display version information + printf "\n* This is Bugzilla " . BUGZILLA_VERSION . " on perl %vd\n", + $^V; + my @os_details = POSIX::uname; + # 0 is the name of the OS, 2 is the major version, + my $os_name = $os_details[0] . ' ' . $os_details[2]; + if (ON_WINDOWS) { + require Win32; + $os_name = Win32::GetOSName(); + } + # 3 is the minor version. + print "* Running on $os_name $os_details[3]\n" +} # This was originally clipped from the libnet Makefile.PL, adapted here to # use the below vers_cmp routine for accurate version checking. diff --git a/checksetup.pl b/checksetup.pl index 4a92e1ea1..d38fb5441 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -36,201 +36,7 @@ # A. Karl Kornel # Marc Schumann -=head1 NAME - -checksetup.pl - A do-it-all upgrade and installation script for Bugzilla. - -=head1 SYNOPSIS - - ./checksetup.pl [--help|--check-modules] - ./checksetup.pl [SCRIPT [--verbose]] [--no-templates|-t] - ./checksetup.pl --make-admin=user@domain.com - -=head1 OPTIONS - -=over - -=item F