| 1 | #!/import/bw/tools/local/perl-5.8.0/bin/perl |
| 2 | use lib qw(/import/bw/tools/local/perl-5.8.0/lib/site_perl/5.8.0); |
| 3 | #!/usr/local/bin/perl |
| 4 | ##---------------------------------------------------------------------------## |
| 5 | ## File: |
| 6 | ## $Id: mha-dbedit,v 1.6 2002/05/03 04:12:17 ehood Exp $ |
| 7 | ## Author: |
| 8 | ## Earl Hood mhonarc@mhonarc.org |
| 9 | ## Description: |
| 10 | ## Program to modify database w/o editing archive files. |
| 11 | ##---------------------------------------------------------------------------## |
| 12 | ## MHonArc -- Internet mail-to-HTML converter |
| 13 | ## Copyright (C) 1998-1999 Earl Hood, mhonarc@mhonarc.org |
| 14 | ## |
| 15 | ## This program is free software; you can redistribute it and/or modify |
| 16 | ## it under the terms of the GNU General Public License as published by |
| 17 | ## the Free Software Foundation; either version 2 of the License, or |
| 18 | ## (at your option) any later version. |
| 19 | ## |
| 20 | ## This program is distributed in the hope that it will be useful, |
| 21 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 23 | ## GNU General Public License for more details. |
| 24 | ## |
| 25 | ## You should have received a copy of the GNU General Public License |
| 26 | ## along with this program; if not, write to the Free Software |
| 27 | ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 28 | ## 02111-1307, USA |
| 29 | ##---------------------------------------------------------------------------## |
| 30 | |
| 31 | package mha_dbedit; |
| 32 | |
| 33 | ##---------------------------------------------------------------------------## |
| 34 | ## Main routine ## |
| 35 | ##---------------------------------------------------------------------------## |
| 36 | |
| 37 | MAIN: { |
| 38 | unshift(@INC, 'lib'); # Should I leave this line in? |
| 39 | |
| 40 | ## Initialize MHonArc |
| 41 | require 'mhamain.pl' || die qq/ERROR: Unable to require "mhamain.pl"\n/; |
| 42 | mhonarc::initialize(); |
| 43 | |
| 44 | ## Open archive |
| 45 | unshift(@ARGV, '-readdb', '-lock'); |
| 46 | if (!mhonarc::open_archive()) { |
| 47 | die "ERROR: Unable to open archive\n"; } |
| 48 | |
| 49 | ## Write database |
| 50 | print STDOUT "\nWriting database ...\n" unless $mhonarc::QUIET; |
| 51 | my $status = mhonarc::output_db($mhonarc::DBPathName); |
| 52 | mhonarc::close_archive(); |
| 53 | exit($status ? 0 : 1); |
| 54 | } |
| 55 | |
| 56 | ##---------------------------------------------------------------------------## |
| 57 | 1; |
| 58 | |
| 59 | __END__ |
| 60 | |
| 61 | =head1 NAME |
| 62 | |
| 63 | mha-dbedit - make database edits to a MHonArc archive |
| 64 | |
| 65 | =head1 SYNOPSIS |
| 66 | |
| 67 | S<B<mha-dbedit> [I<options>]> |
| 68 | |
| 69 | =head1 DESCRIPTION |
| 70 | |
| 71 | B<mha-dbedit> is a utility program that is part of the B<MHonArc> |
| 72 | software package. The program allows archive database edits to be |
| 73 | made without causing HTML pages to be touched. |
| 74 | |
| 75 | The documentation for B<MHonArc> is distributed in HTML format. |
| 76 | Due to its size and organization, it is not suited for manpage |
| 77 | format. Consult your system administrator for where the documentation |
| 78 | has been installed, or see L<"AVAILABILITY"> on where you can |
| 79 | access the documentation on the web. |
| 80 | |
| 81 | =head1 EXAMPLE |
| 82 | |
| 83 | Typical usage: |
| 84 | |
| 85 | shell> mha-dbedit -rcfile res.mrc -outdir /path/to/archive |
| 86 | |
| 87 | =head1 AVAILABILITY |
| 88 | |
| 89 | E<lt>I<http://www.mhonarc.org/>E<gt> |
| 90 | |
| 91 | =head1 AUTHOR |
| 92 | |
| 93 | Earl Hood, mhonarc@mhonarc.org |
| 94 | |
| 95 | =cut |
| 96 | |