Added proper POD documentation to utility scripts using POD::Usage.

This commit is contained in:
Ernesto Hernández-Novich 2008-06-06 22:08:59 +00:00
parent 3a59968376
commit 4555e8ca8e
15 changed files with 1202 additions and 604 deletions

View file

@ -19,6 +19,7 @@ use strict;
use DBI;
use File::Path;
use Getopt::Long;
use Pod::Usage;
use WebGUI::Config;
use WebGUI::Session;
use WebGUI::Utility;
@ -49,63 +50,8 @@ GetOptions(
'skipbackup'=>\$skipBackup
);
if ($help){
print <<STOP;
Usage: perl $0 --doit
Options:
--backupDir The folder where backups should be
created. Defaults to '$backupDir'.
--doit This flag is required. You MUST include this
flag in your command line or the upgrade
will not run.
--help Display this help message and exit.
--history Displays the upgrade history for each of
your sites. Note that running with this
flag will NOT run the upgrade.
--mysql The path to your mysql client executable.
Defaults to '$mysql'.
--mysqldump The path to your mysqldump executable.
Defaults to '$mysqldump'.
--override This utility is designed to be run as
a privileged user on Linux style systems.
If you wish to run this utility without
being the super user, then use this flag,
but note that it may not work as
intended.
--quiet Disable output unless there's an error.
--skipBackup Backups will not be performed during the
upgrade.
--skipDelete The upgrade normally deletes WebGUI's cache
and temporary files as part of the upgrade.
This is mainly important during big upgrades,
but can make the upgrade go very slowly.
Using this option skips the deletion of these
files.
--skipMaintenance
The upgrade normally puts up a maintenance
page on all the sites while running, but this
option will skip that step.
STOP
exit;
}
pod2usage( verbose => 2 ) if $help;
pod2usage() unless $doit;
unless ($doit) {
print <<STOP;
@ -405,4 +351,116 @@ sub _parseDSN {
return $hash;
}
__END__
=head1 NAME
upgrade - Upgrade WebGUI database to the latest revision.
=head1 SYNOPSIS
upgrade --doit
[--backupDir path]
[--history]
[--mysql pathname]
[--mysqldump pathname]
[--override]
[--skipBackup]
[--skipDelete]
[--skipMaintenance]
[--quiet]
upgrade --help
=head1 DESCRIPTION
This WebGUI utility script is able to upgrade B<any> WebGUI database
from 7.3.22 upward to the currently installed version. The WebGUI
software distribution includes a set of upgrade scripts that
perform the necessary database changes (schema and data) to bring
the database up-to-date in order to match the currently installed
WebGUI libraries and programs.
This utility is designed to be run as a superuser on Linux systems,
since it needs to be able to access several system directories
and change ownership of files. If you want to run this utility without
superuser privileges, use the C<--override> option described below.
=head1 WARNING
There are B<NO> guarantees of any kind provided with this software.
This utility has been tested rigorously, and has performed without
error or consequences in our labs, and on our production servers
for many years. However, there is no substitute for a good backup
of your software and data before performing any kind of upgrade.
B<BEFORE YOU UPGRADE> you should definitely read docs/gotcha.txt to
find out what things you should know about that will affect your
upgrade.
=over
=item C<--doit>
You B<MUST> include this flag in the command line or the script
will refuse to run. This is to force you to read this documentation
at least once and be sure that you B<REALLY> want to perform the
upgrade.
=item C<--backupDir path>
Specify a path where database backups should be created during the
upgrade procedure. If left unspecified, it defaults to C</var/backups>.
=item C<--history>
Displays the upgrade history for each of your sites. Running with this
flag will B<NOT> perform the upgrade.
=item C<--mysql pathname>
The full pathname to your mysql client executable. If left unspecified,
it defaults to C</usr/bin/mysql>.
=item C<--mysqldump pathname>
The full pathname to your mysqldump executable. If left unspecified,
it defaults to C</usr/bin/mysqldump>.
=item C<--override>
This flag will allow you to run this utility without being the super user,
but note that it may not work as intended.
=item C<--skipBackup>
Use this if you B<DO NOT> want database backups to be performed
during the upgrade procedure.
=item C<--skipDelete>
The upgrade procedure normally deletes WebGUI's cache and temporary files
created as part of the upgrade. This cleanup is very important during
large upgrades, but can make the procedure quite slow. This option
skips the deletion of these files.
=item C<--skipMaintenance>
The upgrade procedure normally puts up a simple maintenance page on all
the sites while running, but this option will skip that step.
=item C<--quiet>
Disable all output unless there's an error.
=item C<--help>
Shows this documentation, then exits.
=back
=head1 AUTHOR
Copyright 2001-2008 Plain Black Corporation.
=cut