summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-03-14 12:49:47 +0000
committerfukachan <fukachan>2003-03-14 12:49:47 +0000
commit3cf8f26ea4efe5120b606b85b3000680a86fa40d (patch)
tree324b06210c09c0cf38cf6756b0f23fc8bbac57fb
parent88cc16315f23339268e1fc6d07ecfd3afd71a13e (diff)
downloadfml8-3cf8f26ea4efe5120b606b85b3000680a86fa40d.tar.gz
fml8-3cf8f26ea4efe5120b606b85b3000680a86fa40d.tar.bz2
fml8-3cf8f26ea4efe5120b606b85b3000680a86fa40d.zip
fmlerror is obsolete.
-rw-r--r--configure.in3
-rw-r--r--fml/etc/install.cf.in3
-rw-r--r--fml/etc/modules4
-rw-r--r--fml/lib/FML/Command/Admin/error.pm120
-rw-r--r--fml/lib/FML/Process/ErrorViewer.pm265
5 files changed, 124 insertions, 271 deletions
diff --git a/configure.in b/configure.in
index 0688afe7..83287726 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
dnl
-dnl $FML: configure.in,v 1.33 2003/03/14 03:44:14 fukachan Exp $
+dnl $FML: configure.in,v 1.34 2003/03/14 06:55:58 fukachan Exp $
dnl
AC_REVISION($Revision$)
@@ -129,7 +129,6 @@ AC_OUTPUT(\
fml/bin/fmlalias \
fml/bin/fmlconf \
fml/bin/fmldoc \
- fml/bin/fmlerror \
fml/bin/fmlhtmlify \
fml/bin/fmlsch \
fml/bin/fmlthread \
diff --git a/fml/etc/install.cf.in b/fml/etc/install.cf.in
index a8e8d94e..88d78fdc 100644
--- a/fml/etc/install.cf.in
+++ b/fml/etc/install.cf.in
@@ -3,7 +3,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: install.cf.in,v 1.7 2003/03/14 03:44:15 fukachan Exp $
+# $FML: install.cf.in,v 1.8 2003/03/14 06:55:59 fukachan Exp $
#
@@ -90,7 +90,6 @@ bin_programs = fml
fmldoc
fmlthread
fmlconf
- fmlerror
makefml
fmlsch
fmlhtmlify
diff --git a/fml/etc/modules b/fml/etc/modules
index 82977ba7..bf47a0e2 100644
--- a/fml/etc/modules
+++ b/fml/etc/modules
@@ -1,5 +1,5 @@
#
-# $FML: modules,v 1.2 2003/03/14 03:44:15 fukachan Exp $
+# $FML: modules,v 1.3 2003/03/14 06:55:59 fukachan Exp $
#
# map between programs and modules (like /etc/name_to_sysnum on solaris ?)
#
@@ -22,7 +22,7 @@ fmladdr FML::Process::Addr
fmlalias FML::Process::Alias
fmlconf FML::Process::ConfViewer
fmldoc FML::Process::DocViewer
-fmlerror FML::Process::ErrorViewer $ml
+fmlerror FML::Process::Obsolete $ml
fmlhtmlify FML::Process::HTMLify $ml
fmlspool FML::Process::Spool $ml
fmlsummary FML::Process::Obsolete $ml
diff --git a/fml/lib/FML/Command/Admin/error.pm b/fml/lib/FML/Command/Admin/error.pm
new file mode 100644
index 00000000..ed4cd679
--- /dev/null
+++ b/fml/lib/FML/Command/Admin/error.pm
@@ -0,0 +1,120 @@
+#-*- perl -*-
+#
+# Copyright (C) 2003 Ken'ichi Fukamachi
+# All rights reserved. This program is free software; you can
+# redistribute it and/or modify it under the same terms as Perl itself.
+#
+# $FML: error.pm,v 1.2 2003/03/14 06:53:22 fukachan Exp $
+#
+
+package FML::Command::Admin::error;
+use strict;
+use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
+use Carp;
+
+
+=head1 NAME
+
+FML::Command::Admin::error - show error status
+
+=head1 SYNOPSIS
+
+See C<FML::Command> for more details.
+
+=head1 DESCRIPTION
+
+change delivery mode from real time to digest.
+
+=head1 METHODS
+
+=head2 C<process($curproc, $command_args)>
+
+=cut
+
+
+# Descriptions: constructor.
+# Arguments: OBJ($self)
+# Side Effects: none
+# Return Value: OBJ
+sub new
+{
+ my ($self) = @_;
+ my ($type) = ref($self) || $self;
+ my $me = {};
+ return bless $me, $type;
+}
+
+
+# Descriptions: need lock or not
+# Arguments: none
+# Side Effects: none
+# Return Value: NUM( 1 or 0)
+sub need_lock { 1;}
+
+
+# Descriptions: change delivery mode from real time to digest.
+# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args)
+# Side Effects: update $recipient_map
+# Return Value: none
+sub process
+{
+ my ($self, $curproc, $command_args) = @_;
+
+ $self->_fmlerror($curproc);
+}
+
+
+# Descriptions: show error messages
+# Arguments: OBJ($curproc)
+# Side Effects: none
+# Return Value: none
+sub _fmlerror
+{
+ my ($self, $curproc) = @_;
+ my $config = $curproc->config();
+
+ use FML::Error;
+ my $obj = new FML::Error $curproc;
+ my $data = $obj->analyze();
+ my $info = $obj->get_data_detail();
+
+ my ($k, $v);
+ while (($k, $v) = each %$info) {
+ if (defined($v) && ref($v) eq 'ARRAY') {
+ my $x = '';
+ for my $y (@$v) {
+ $x .= $y if defined $y;
+ $x .= " ";
+ }
+ print "$k => ( $x)\n";
+ }
+ else {
+ print "$k => $v\n";
+ }
+ }
+}
+
+
+=head1 CODING STYLE
+
+See C<http://www.fml.org/software/FNF/> on fml coding style guide.
+
+=head1 AUTHOR
+
+Ken'ichi Fukamachi
+
+=head1 COPYRIGHT
+
+Copyright (C) 2003 Ken'ichi Fukamachi
+
+All rights reserved. This program is free software; you can
+redistribute it and/or modify it under the same terms as Perl itself.
+
+=head1 HISTORY
+
+FML::Command::Admin::error first appeared in fml8 mailing list driver package.
+See C<http://www.fml.org/> for more details.
+
+=cut
+
+1;
diff --git a/fml/lib/FML/Process/ErrorViewer.pm b/fml/lib/FML/Process/ErrorViewer.pm
deleted file mode 100644
index fbc0fb85..00000000
--- a/fml/lib/FML/Process/ErrorViewer.pm
+++ /dev/null
@@ -1,265 +0,0 @@
-#-*- perl -*-
-#
-# Copyright (C) 2003 Ken'ichi Fukamachi
-# All rights reserved.
-#
-# $FML: ErrorViewer.pm,v 1.1 2003/01/05 02:22:17 fukachan Exp $
-#
-
-package FML::Process::ErrorViewer;
-use strict;
-use Carp;
-use vars qw($debug @ISA @EXPORT @EXPORT_OK);
-use FML::Log qw(Log LogWarn LogError);
-use FML::Process::Kernel;
-@ISA = qw(FML::Process::Kernel);
-
-
-=head1 NAME
-
-FML::Process::ErrorViewer -- show bounce messages status
-
-=head1 SYNOPSIS
-
- use FML::Process::ErrorViewer;
- $curproc = new FML::Process::ErrorViewer;
- ...
- $curproc->run();
- ...
-
-=head1 DESCRIPTION
-
-FML::Process::ErrorViewer provides the main function for C<fmlerror>.
-
-=head1 METHODS
-
-=head2 new($args)
-
-ordinary constructor.
-It make a C<FML::Process::Kernel> object and return it.
-
-=head2 prepare($args)
-
-fix @INC, adjust ml_* and load configuration files.
-
-=head2 verify_request($args)
-
-show help unless @ARGV.
-
-=cut
-
-
-# Descriptions: ordinary constructor
-# Arguments: OBJ($self) HASH_REF($args)
-# Side Effects: none
-# Return Value: FML::Process::ErrorViewer object
-sub new
-{
- my ($self, $args) = @_;
- my $type = ref($self) || $self;
- my $curproc = new FML::Process::Kernel $args;
- return bless $curproc, $type;
-}
-
-
-# Descriptions: adjust ml_* and load configuration files.
-# Arguments: OBJ($curproc) HASH_REF($args)
-# Side Effects: none
-# Return Value: none
-sub prepare
-{
- my ($curproc, $args) = @_;
- my $config = $curproc->{ config };
-
- my $eval = $config->get_hook( 'fmlerror_prepare_start_hook' );
- if ($eval) {
- eval qq{ $eval; };
- print STDERR $@ if $@;
- }
-
- $curproc->resolve_ml_specific_variables( $args );
- $curproc->load_config_files( $args->{ cf_list } );
- $curproc->fix_perl_include_path();
-
- $eval = $config->get_hook( 'fmlerror_prepare_end_hook' );
- if ($eval) {
- eval qq{ $eval; };
- print STDERR $@ if $@;
- }
-}
-
-
-# Descriptions: check @ARGV, call help() if needed
-# Arguments: OBJ($curproc) HASH_REF($args)
-# Side Effects: exit ASAP.
-# longjmp() to help() if appropriate
-# Return Value: none
-sub verify_request
-{
- my ($curproc, $args) = @_;
- my $argv = $curproc->command_line_argv();
- my $config = $curproc->{ config };
-
- my $eval = $config->get_hook( 'fmlerror_verify_request_start_hook' );
- if ($eval) {
- eval qq{ $eval; };
- print STDERR $@ if $@;
- }
-
- if (length(@$argv) == 0 || (not $argv->[0])) {
- $curproc->help();
- exit(0);
- }
-
- $eval = $config->get_hook( 'fmlerror_verify_request_end_hook' );
- if ($eval) {
- eval qq{ $eval; };
- print STDERR $@ if $@;
- }
-}
-
-
-=head2 C<run($args)>
-
-the top level dispatcher for C<fmlconf>.
-
-It kicks off internal function C<_fmlconf($args)> for C<fmlconf>.
-
-NOTE:
-C<$args> is passed from parrent libexec/loader.
-See <FML::Process::Switch()> on C<$args> for more details.
-
-=cut
-
-
-# Descriptions: just a switch, call _fmlconf()
-# Arguments: OBJ($curproc) HASH_REF($args)
-# Side Effects: none
-# Return Value: none
-sub run
-{
- my ($curproc, $args) = @_;
- my $config = $curproc->{ config };
- my $myname = $curproc->myname();
- my $argv = $curproc->command_line_argv();
-
- my $eval = $config->get_hook( 'fmlerror_run_start_hook' );
- if ($eval) {
- eval qq{ $eval; };
- print STDERR $@ if $@;
- }
-
- $curproc->_fmlerror($args);
-
- $eval = $config->get_hook( 'fmlerror_run_end_hook' );
- if ($eval) {
- eval qq{ $eval; };
- print STDERR $@ if $@;
- }
-}
-
-
-=head2 help()
-
-show help.
-
-=cut
-
-
-# Descriptions: show help
-# Arguments: OBJ($curproc) HASH_REF($args)
-# Side Effects: none
-# Return Value: none
-sub help
-{
- my ($curproc, $args) = @_;
- my $name = $curproc->myname();
-
-print <<"_EOF_";
-
-Usage: $name \$ml_name
-
-_EOF_
-}
-
-
-# Descriptions: dummy
-# Arguments: OBJ($curproc) HASH_REF($args)
-# Side Effects: none
-# Return Value: none
-sub finish
-{
- my ($curproc, $args) = @_;
- my $config = $curproc->{ config };
-
- my $eval = $config->get_hook( 'fmlerror_finish_start_hook' );
- if ($eval) {
- eval qq{ $eval; };
- print STDERR $@ if $@;
- }
-
- $eval = $config->get_hook( 'fmlerror_finish_end_hook' );
- if ($eval) {
- eval qq{ $eval; };
- print STDERR $@ if $@;
- }
-}
-
-
-=head2 C<_fmlconf($args)> (INTERNAL USE)
-
-run dump_variables of C<FML::Config>.
-
-=cut
-
-
-# Descriptions: show error messages
-# Arguments: OBJ($curproc) HASH_REF($args)
-# Side Effects: none
-# Return Value: none
-sub _fmlerror
-{
- my ($curproc, $args) = @_;
- my $config = $curproc->config();
-
- use FML::Error;
- my $obj = new FML::Error $curproc;
- my $data = $obj->analyze();
- my $info = $obj->get_data_detail();
-
- my ($k, $v);
- while (($k, $v) = each %$info) {
- if (ref($v) eq 'ARRAY') {
- print "$k => (@$v)\n";
- }
- else {
- print "$k => $v\n";
- }
- }
-}
-
-
-=head1 CODING STYLE
-
-See C<http://www.fml.org/software/FNF/> on fml coding style guide.
-
-=head1 AUTHOR
-
-Ken'ichi Fukamachi
-
-=head1 COPYRIGHT
-
-Copyright (C) 2003 Ken'ichi Fukamachi
-
-All rights reserved. This program is free software; you can
-redistribute it and/or modify it under the same terms as Perl itself.
-
-=head1 HISTORY
-
-FML::Process::ErrorViewer first appeared in fml8 mailing list driver package.
-See C<http://www.fml.org/> for more details.
-
-=cut
-
-
-1;