summaryrefslogtreecommitdiff
path: root/fml/lib/FML
diff options
context:
space:
mode:
authorfukachan <fukachan>2004-01-24 15:37:01 +0000
committerfukachan <fukachan>2004-01-24 15:37:01 +0000
commitfe9857ff40964ba1266a624af191cc66ce703f17 (patch)
tree0a08d7ef3b4793becdd005c0b0088d80e9a441ab /fml/lib/FML
parent5a7295448461b4ce4a49c48f14847b0ca8ea11a4 (diff)
downloadfml8-fe9857ff40964ba1266a624af191cc66ce703f17.tar.gz
fml8-fe9857ff40964ba1266a624af191cc66ce703f17.tar.bz2
fml8-fe9857ff40964ba1266a624af191cc66ce703f17.zip
overhaul: clean up (FNF)
Diffstat (limited to 'fml/lib/FML')
-rw-r--r--fml/lib/FML/Process/Command.pm28
-rw-r--r--fml/lib/FML/Process/Configure.pm22
-rw-r--r--fml/lib/FML/Process/Digest.pm10
-rw-r--r--fml/lib/FML/Process/Distribute.pm43
-rw-r--r--fml/lib/FML/Process/Error.pm7
-rw-r--r--fml/lib/FML/Process/Fake.pm6
-rw-r--r--fml/lib/FML/Process/HTMLify.pm15
-rw-r--r--fml/lib/FML/Process/Utils.pm101
8 files changed, 128 insertions, 104 deletions
diff --git a/fml/lib/FML/Process/Command.pm b/fml/lib/FML/Process/Command.pm
index 133f00ff..8c3b728f 100644
--- a/fml/lib/FML/Process/Command.pm
+++ b/fml/lib/FML/Process/Command.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2000,2001,2002,2003,2004 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Command.pm,v 1.95 2004/01/02 10:23:56 fukachan Exp $
+# $FML: Command.pm,v 1.96 2004/01/02 14:50:33 fukachan Exp $
#
package FML::Process::Command;
@@ -130,7 +130,7 @@ sub verify_request
}
-# Descriptions: filter
+# Descriptions: apply several filters.
# Arguments: OBJ($curproc)
# Side Effects: set flag to ignore this process if it should be filtered.
# Return Value: none
@@ -181,14 +181,14 @@ XXX Each command determines need of lock or not.
=cut
-# Descriptions: call _evaluate_command_lines()
+# Descriptions: call _evaluate_command_lines().
# Arguments: OBJ($curproc) HASH_REF($args)
# Side Effects: none
# Return Value: none
sub run
{
my ($curproc, $args) = @_;
- my $pcb = $curproc->pcb();
+ my $pcb = $curproc->pcb();
my $config = $curproc->config();
my $eval = $config->get_hook( 'command_run_start_hook' );
@@ -202,13 +202,15 @@ sub run
# XXX reject command use irrespective of requests from admins/users.
# XXX rejection of admin use occurs in _evaluate_command_lines()
# XXX not here.
- # XXX possible cases are from "system_special_accounts" or from a not member.
+ # XXX possible cases are from "system_special_accounts" or
+ # XXX from a not member.
else {
# check the error reason by permit_command().
my $reason = $pcb->get("check_restrictions", "deny_reason");
- if (defined($reason) && ($reason eq 'reject_system_special_accounts')) {
+ if (defined($reason) &&
+ ($reason eq 'reject_system_special_accounts')) {
my $s = "deny request from system accounts";
- $curproc->reply_message_nl("error.system_special_accounts", $s);
+ $curproc->reply_message_nl("error.system_special_accounts",$s);
}
else {
$curproc->reply_message_nl("error.not_member",
@@ -242,7 +244,7 @@ show help.
=cut
-# Descriptions: show help
+# Descriptions: show help.
# Arguments: none
# Side Effects: none
# Return Value: none
@@ -433,7 +435,7 @@ sub _get_command_name
}
-# Descriptions: authenticate the currrent process sender as an admin
+# Descriptions: authenticate the currrent process sender as an admin.
# Arguments: OBJ($curproc) HASH_REF($optargs)
# Side Effects: none
# Return Value: NUM(1 or 0)
@@ -643,7 +645,7 @@ sub _get_command_mode
}
-# Descriptions: this command is allowd under the current $mode and $level
+# Descriptions: this command is allowd under the current $mode and $level.
# Arguments: OBJ($curproc)
# STR($mode)
# HASH_REF($status)
@@ -694,7 +696,7 @@ within $command_args to share some data between modules called in it.
=cut
-# Descriptions: build $command_args for FML::Command execution
+# Descriptions: build $command_args for FML::Command execution.
# Arguments: OBJ($curproc) HASH_REF($status) HASH_REF($cominfo)
# Side Effects: none
# Return Value: HASH_REF
@@ -715,7 +717,7 @@ sub _gen_command_args
}
-# Descriptions: remove the superflous string before the actual command
+# Descriptions: remove the superflous string before the actual command.
# Arguments: STR($buf)
# Side Effects: none
# Return Value: STR
@@ -727,7 +729,7 @@ sub __clean_up
}
-# Descriptions: set up error message to inform emergency stop
+# Descriptions: set up error message to inform emergency stop.
# Arguments: OBJ($curproc)
# HASH_REF($status) HASH_REF($cominfo) STR($orig_command)
# Side Effects: update reply messages
diff --git a/fml/lib/FML/Process/Configure.pm b/fml/lib/FML/Process/Configure.pm
index 331bfa49..ed5e9bba 100644
--- a/fml/lib/FML/Process/Configure.pm
+++ b/fml/lib/FML/Process/Configure.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2001,2002,2003,2004 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Configure.pm,v 1.60 2004/01/02 10:23:57 fukachan Exp $
+# $FML: Configure.pm,v 1.61 2004/01/02 14:50:34 fukachan Exp $
#
package FML::Process::Configure;
@@ -52,7 +52,7 @@ show help if needed.
=cut
-# Descriptions: ordinary constructor
+# Descriptions: constructor.
# Arguments: OBJ($self) HASH_REF($args)
# Side Effects: none
# Return Value: OBJ
@@ -142,7 +142,7 @@ sub run
}
-# Descriptions: dummy
+# Descriptions: dummy.
# Arguments: OBJ($curproc) HASH_REF($args)
# Side Effects: none
# Return Value: none
@@ -166,7 +166,7 @@ show help.
=cut
-# Descriptions: show help
+# Descriptions: show help.
# Arguments: none
# Side Effects: none
# Return Value: none
@@ -188,7 +188,7 @@ sub help
}
-# Descriptions: show FYI help
+# Descriptions: show FYI help.
# Arguments: none
# Side Effects: none
# Return Value: none
@@ -213,7 +213,7 @@ _EOF_
}
-# Descriptions: show help usage
+# Descriptions: show help usage.
# Arguments: STR($name)
# Side Effects: none
# Return Value: none
@@ -271,7 +271,7 @@ See <FML::Process::Switch()> on C<$args> for more details.
=cut
-# Descriptions: makefml top level dispacher
+# Descriptions: makefml top level dispacher.
# Arguments: OBJ($curproc) HASH_REF($args)
# Side Effects: load FML::Command::command module and execute it.
# Return Value: none
@@ -284,6 +284,7 @@ sub _makefml
my $argv = $curproc->command_line_argv();
my ($method, $argv_ml_name, @options);
+ # XXX hmm, HARD-CODED but no idea.
if ($myname eq 'makefml') {
($method, $argv_ml_name, @options) = @$argv;
}
@@ -291,7 +292,7 @@ sub _makefml
($argv_ml_name, $method, @options) = @$argv;
}
- # arguments to pass off to each method
+ # build arguments to pass off to each method.
# XXX-TODO: command = [ $method, @options ]; ? (no, used only for message?)
my $command_args = {
command_mode => 'admin',
@@ -300,7 +301,10 @@ sub _makefml
ml_name => $ml_name,
options => \@options,
argv => $argv,
- canon_argv => { # saved for {new,rm}domain commands.
+
+ # save raw argv for {new,rm}domain commands, which need to
+ # interpret $ml_name as ml_domain.
+ canon_argv => {
ml_name => $argv_ml_name,
method => $method,
options => \@options,
diff --git a/fml/lib/FML/Process/Digest.pm b/fml/lib/FML/Process/Digest.pm
index e81f8a16..80ab0f94 100644
--- a/fml/lib/FML/Process/Digest.pm
+++ b/fml/lib/FML/Process/Digest.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2002,2003,2004 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Digest.pm,v 1.13 2004/01/02 02:11:27 fukachan Exp $
+# $FML: Digest.pm,v 1.14 2004/01/02 14:50:34 fukachan Exp $
#
package FML::Process::Digest;
@@ -45,7 +45,7 @@ we bless it as C<FML::Process::Digest> object again.
=cut
-# Descriptions: ordinary constructor.
+# Descriptions: constructor.
# sub class of FML::Process::Kernel
# Arguments: OBJ($self) HASH_REF($args)
# Side Effects: none
@@ -141,7 +141,7 @@ Lastly we unlock the current process.
=cut
-# Descriptions: the main routine, kick off _digest()
+# Descriptions: the main routine, kick off _digest().
# Arguments: OBJ($curproc) HASH_REF($args)
# Side Effects: distribution of articles.
# See _digest() for more details.
@@ -175,7 +175,7 @@ sub run
=cut
-# Descriptions: show help
+# Descriptions: show help.
# Arguments: none
# Side Effects: none
# Return Value: none
@@ -238,7 +238,7 @@ sub _digest
# run digest proceess if article(s) not to send found.
if ($aid > $did) {
$did++; # start = last digest id + 1
- my $range = "$did-$aid";
+ my $range = "$did-$aid";
# XXX-TODO: $range = "100-200" -> $range = [ 100, 101, ... ]; ?
# create multipart of articles as a digest.
diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm
index b51840de..96015c5e 100644
--- a/fml/lib/FML/Process/Distribute.pm
+++ b/fml/lib/FML/Process/Distribute.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2000,2001,2002,2003,2004 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Distribute.pm,v 1.134 2004/01/02 02:11:27 fukachan Exp $
+# $FML: Distribute.pm,v 1.135 2004/01/02 14:50:34 fukachan Exp $
#
package FML::Process::Distribute;
@@ -45,7 +45,7 @@ we bless it as C<FML::Process::Distribute> object again.
=cut
-# Descriptions: ordinary constructor.
+# Descriptions: standard constructor.
# sub class of FML::Process::Kernel
# Arguments: OBJ($self) HASH_REF($args)
# Side Effects: none
@@ -137,7 +137,7 @@ sub verify_request
}
-# Descriptions: filter
+# Descriptions: apply several filters.
# Arguments: OBJ($curproc)
# Side Effects: set flag to ignore this process if it should be filtered.
# Return Value: none
@@ -188,7 +188,7 @@ Lastly we unlock the current process.
=cut
-# Descriptions: the main routine, kick off _distribute()
+# Descriptions: the main routine, kick off _distribute().
# Arguments: OBJ($curproc) HASH_REF($args)
# Side Effects: distribution of articles.
# See _distribute() for more details.
@@ -219,6 +219,8 @@ sub run
else {
my $pcb = $curproc->pcb();
+ # XXX-TODO: hmm, what is use of $pcb ?
+
$curproc->log("deny article submission");
my $rule = $pcb->get("check_restrictions", "deny_reason");
@@ -287,7 +289,7 @@ sub run
=cut
-# Descriptions: show help
+# Descriptions: show help.
# Arguments: none
# Side Effects: none
# Return Value: none
@@ -347,7 +349,7 @@ sub finish
sub _distribute
{
my ($curproc, $args) = @_;
- my $config = $curproc->config();
+ my $config = $curproc->config();
# XXX_LOCK_CHANNEL: article_spool_modify
# exclusive lock for both sequence updating and spool writing
@@ -404,7 +406,7 @@ sub _distribute
}
-# Descriptions: build and return FML::Article object
+# Descriptions: build and return FML::Article object.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: OBJ(FML::Article)
@@ -434,6 +436,7 @@ sub _header_rewrite
my $rules = $config->get_as_array_ref('article_header_rewrite_rules');
my $id = $hrw_args->{ id };
+ RULE:
for my $rule (@$rules) {
$curproc->log("_header_rewrite( $rule )") if $config->yes('debug');
@@ -450,7 +453,7 @@ sub _header_rewrite
}
-# Descriptions: deliver the article
+# Descriptions: deliver the article.
# Arguments: OBJ($curproc)
# Side Effects: mail delivery, logging
# Return Value: none
@@ -482,7 +485,7 @@ sub _deliver_article
# overload $sfp log function pointer.
my $wh = $curproc->open_outgoing_message_channel();
if (defined $wh) {
- $sfp = sub { print $wh @_;};
+ $sfp = sub { print $wh @_;};
$handle = undef; # $wh;
}
@@ -491,9 +494,9 @@ sub _deliver_article
eval q{
use Mail::Delivery;
$service = new Mail::Delivery {
- log_function => $fp,
- smtp_log_function => $sfp,
- smtp_log_handle => $handle,
+ log_function => $fp,
+ smtp_log_function => $sfp,
+ smtp_log_handle => $handle,
};
};
croak($@) if $@;
@@ -521,23 +524,23 @@ sub _deliver_article
}
-# Descriptions: the top level interface to drive thread tracking system
+# Descriptions: the top level interface to drive thread tracking system.
# Arguments: OBJ($curproc)
# Side Effects: update thread information
# Return Value: none
sub _old_thread_check
{
my ($curproc) = @_;
- my $config = $curproc->config();
- my $pcb = $curproc->pcb();
- my $myname = $curproc->myname();
+ my $config = $curproc->config();
+ my $pcb = $curproc->pcb();
+ my $myname = $curproc->myname();
my $ml_name = $config->{ ml_name };
my $thread_db_dir = $config->{ thread_db_dir };
my $spool_dir = $config->{ spool_dir };
my $article_id = $pcb->get('article', 'id');
my $is_rewrite_hdr = $config->yes('use_thread_subject_tag') ? 1 : 0;
- my $ttargs = {
+ my $ttargs = {
myname => $myname,
logfp => \&Log,
fd => \*STDOUT,
@@ -560,7 +563,7 @@ sub _old_thread_check
}
-# Descriptions: the top level interface to drive thread tracking system
+# Descriptions: the top level interface to drive thread tracking system.
# Arguments: OBJ($curproc)
# Side Effects: update thread information
# Return Value: none
@@ -587,7 +590,7 @@ sub _new_thread_check
}
-# Descriptions: the top level interface to drive thread tracking system
+# Descriptions: the top level interface to drive thread tracking system.
# Arguments: OBJ($curproc)
# Side Effects: update thread information
# Return Value: none
@@ -615,7 +618,7 @@ sub _new_thread_check_post
}
-# Descriptions: the top level entry to create HTML article
+# Descriptions: the top level entry to create HTML article.
# Arguments: OBJ($curproc)
# Side Effects: update html database
# Return Value: none
diff --git a/fml/lib/FML/Process/Error.pm b/fml/lib/FML/Process/Error.pm
index cbd01198..22086af4 100644
--- a/fml/lib/FML/Process/Error.pm
+++ b/fml/lib/FML/Process/Error.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2002,2003,2004 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Error.pm,v 1.37 2004/01/02 02:11:27 fukachan Exp $
+# $FML: Error.pm,v 1.38 2004/01/02 14:50:35 fukachan Exp $
#
package FML::Process::Error;
@@ -222,6 +222,7 @@ sub _clean_up_bouncers
};
$curproc->logerror($@) if $@;
+ # XXX-TODO: 3600 customizable.
$curproc->set_event_timeout($channel, time + 3600);
}
else {
@@ -237,7 +238,7 @@ show help.
=cut
-# Descriptions: show help
+# Descriptions: show help.
# Arguments: none
# Side Effects: none
# Return Value: none
@@ -275,9 +276,9 @@ sub finish
my $eval = $config->get_hook( 'error_finish_start_hook' );
if ($eval) { eval qq{ $eval; }; $curproc->logwarn($@) if $@; }
+ # XXX NOT INFORM ANY RESULTS BUT ONLY LOG IT TO AVOID LOOP.
if ($pcb->get("error", "found")) {
$curproc->log("error message found");
- # inform ?
}
else {
$curproc->log("error message not found");
diff --git a/fml/lib/FML/Process/Fake.pm b/fml/lib/FML/Process/Fake.pm
index 38747724..48e77a48 100644
--- a/fml/lib/FML/Process/Fake.pm
+++ b/fml/lib/FML/Process/Fake.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2003,2004 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Fake.pm,v 1.5 2004/01/02 14:50:35 fukachan Exp $
+# $FML: Fake.pm,v 1.6 2004/01/04 03:25:09 fukachan Exp $
#
package FML::Process::Fake;
@@ -53,7 +53,7 @@ lastly, parse incoming message input from \*STDIN channel.
=cut
-# Descriptions: ordinary constructor
+# Descriptions: constructor.
# Arguments: OBJ($self) HASH_REF($args)
# Side Effects: none
# Return Value: OBJ
@@ -165,7 +165,7 @@ show help.
=cut
-# Descriptions: show help
+# Descriptions: show help.
# Arguments: none
# Side Effects: none
# Return Value: none
diff --git a/fml/lib/FML/Process/HTMLify.pm b/fml/lib/FML/Process/HTMLify.pm
index 41f2d681..448c84aa 100644
--- a/fml/lib/FML/Process/HTMLify.pm
+++ b/fml/lib/FML/Process/HTMLify.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2001,2002,2003,2004 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: HTMLify.pm,v 1.32 2004/01/02 10:23:57 fukachan Exp $
+# $FML: HTMLify.pm,v 1.33 2004/01/02 14:50:36 fukachan Exp $
#
package FML::Process::HTMLify;
@@ -23,7 +23,7 @@ my $debug = 0;
=head1 NAME
-FML::Process::HTMLify -- htmlify articles
+FML::Process::HTMLify -- convert articles to html format.
=head1 SYNOPSIS
@@ -46,7 +46,7 @@ adjust ml_*, load configuration files and fix @INC.
=cut
-# Descriptions: standard constructor
+# Descriptions: standard constructor.
# Arguments: OBJ($self) HASH_REF($args)
# Side Effects: inherit FML::Process::Kernel
# Return Value: OBJ
@@ -105,7 +105,7 @@ call &FML::Command::HTMLify::convert().
=cut
-# Descriptions: convert text format article to HTML by Mail::Message::ToHTML
+# Descriptions: convert text format article to HTML by Mail::Message::ToHTML.
# Arguments: OBJ($curproc) HASH_REF($args)
# Side Effects: load modules, create HTML files and directories
# Return Value: none
@@ -115,8 +115,8 @@ sub run
my $config = $curproc->config();
my $argv = $curproc->command_line_argv();
my $options = $curproc->command_line_options();
- my $src_dir = $argv->[0];
- my $dst_dir = $argv->[1];
+ my $src_dir = $argv->[0] || '';
+ my $dst_dir = $argv->[1] || '';
print STDERR "htmlify\n\t$src_dir =>\n\t$dst_dir\n" if $debug;
@@ -129,6 +129,7 @@ sub run
unshift(@INC, $options->{ I });
}
+ # XXX-TODO: no check of $src_dir, $dst_dir, ok?
# main converter
use FML::Command::HTMLify;
&FML::Command::HTMLify::convert($curproc, {
@@ -141,7 +142,7 @@ sub run
}
-# Descriptions: show help
+# Descriptions: show help.
# Arguments: none
# Side Effects: none
# Return Value: none
diff --git a/fml/lib/FML/Process/Utils.pm b/fml/lib/FML/Process/Utils.pm
index 5d451b30..2999f3ea 100644
--- a/fml/lib/FML/Process/Utils.pm
+++ b/fml/lib/FML/Process/Utils.pm
@@ -4,7 +4,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: Utils.pm,v 1.101 2004/01/02 02:10:27 fukachan Exp $
+# $FML: Utils.pm,v 1.102 2004/01/02 14:50:37 fukachan Exp $
#
package FML::Process::Utils;
@@ -45,7 +45,7 @@ return FML::Process::Scheduler object.
=cut
-# Descriptions: return FML::Config object
+# Descriptions: return FML::Config object.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: OBJ
@@ -62,7 +62,7 @@ sub config
}
-# Descriptions: return FML::PCB object
+# Descriptions: return FML::PCB object.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: OBJ
@@ -79,7 +79,7 @@ sub pcb
}
-# Descriptions: return FML::Process::Scheduler object
+# Descriptions: return FML::Process::Scheduler object.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: OBJ
@@ -134,7 +134,7 @@ It is the whole parts of a chain.
=cut
-# Descriptions: return incoming_message header object if could
+# Descriptions: return incoming_message header object if could.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: OBJ
@@ -151,7 +151,7 @@ sub incoming_message_header
}
-# Descriptions: return incoming_message body object if could
+# Descriptions: return incoming_message body object if could.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: OBJ
@@ -168,7 +168,7 @@ sub incoming_message_body
}
-# Descriptions: return incoming_message message object if could
+# Descriptions: return incoming_message message object if could.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: OBJ
@@ -230,7 +230,7 @@ output.
=cut
-# Descriptions: return article header object if could
+# Descriptions: return article header object if could.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: OBJ
@@ -248,7 +248,7 @@ sub article_message_header
}
-# Descriptions: return article body object if could
+# Descriptions: return article body object if could.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: OBJ
@@ -266,7 +266,7 @@ sub article_message_body
}
-# Descriptions: return article message object if could
+# Descriptions: return article message object if could.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: OBJ
@@ -292,6 +292,7 @@ create directory $dir if needed.
=cut
+
#
# XXX-TODO: $curproc->mkdir() is strage.
# XXX-TODO: hmm, we create a new subcleass such as $curproc->util->mkdir() ?
@@ -299,7 +300,8 @@ create directory $dir if needed.
# XXX-TODO: we need FML::Utils class ?
#
-# Descriptions: create directory $dir if needed
+
+# Descriptions: create directory $dir if needed.
# Arguments: OBJ($curproc) STR($dir) STR($mode)
# Side Effects: create directory $dir
# Return Value: NUM(1 or 0)
@@ -314,10 +316,10 @@ sub mkdir
unless (-d $dir) {
if (defined $mode) {
- if ($mode =~ /^\d+$/) { # NUM 0700
+ if ($mode =~ /^\d+$/o) { # NUM 0700
$curproc->_mkpath_num($dir, $mode);
}
- elsif ($mode =~ /mode=(\S+)/) {
+ elsif ($mode =~ /mode=(\S+)/o) {
my $xmode = "directory_${1}_mode";
if (defined $config->{ $xmode }) {
$curproc->_mkpath_str($dir, $config->{ $xmode });
@@ -330,7 +332,7 @@ sub mkdir
$curproc->logerror("mkdir: invalid mode");
}
}
- elsif ($dirmode =~ /^\d+$/) { # STR 0700
+ elsif ($dirmode =~ /^\d+$/o) { # STR 0700
$curproc->_mkpath_str($dir, $dirmode);
}
else {
@@ -342,7 +344,7 @@ sub mkdir
}
-# Descriptions: mkdir with the specified dir mode
+# Descriptions: mkdir with the specified dir mode.
# Arguments: OBJ($curproc) STR($dir) NUM($mode)
# Side Effects: mkdir && chmod
# Return Value: none
@@ -353,7 +355,7 @@ sub _mkpath_num
umask(0);
- if ($mode =~ /^\d+$/) { # NUM 0700
+ if ($mode =~ /^\d+$/o) { # NUM 0700
eval q{ use File::Path;};
mkpath([ $dir ], 0, $mode);
chmod $mode, $dir;
@@ -367,7 +369,7 @@ sub _mkpath_num
}
-# Descriptions: mkdir with the specified dir mode
+# Descriptions: mkdir with the specified dir mode.
# Arguments: OBJ($curproc) STR($dir) STR($mode)
# Side Effects: mkdir && chmod
# Return Value: none
@@ -378,7 +380,7 @@ sub _mkpath_str
umask(0);
- if ($mode =~ /^\d+$/) { # STR 0700
+ if ($mode =~ /^\d+$/o) { # STR 0700
eval qq{
use File::Path;
mkpath([ \$dir ], 0, $mode);
@@ -433,7 +435,7 @@ sub touch
# XXX-TODO: $curproc->cat() is strage.
-# Descriptions: concantenate files to STDOUT
+# Descriptions: concantenate files to STDOUT.
# Arguments: OBJ($curproc) ARRAY_REF($files) HANDLE($out)
# Side Effects: none
# Return Value: none
@@ -448,7 +450,7 @@ sub cat
}
-# Descriptions: cat file to STDOUT
+# Descriptions: cat file to STDOUT.
# Arguments: STR($file) HANDLE($out)
# Side Effects: none
# Return Value: none
@@ -475,7 +477,7 @@ make components in $array unique.
=cut
-# Descriptions: make components in $array unique
+# Descriptions: make components in $array unique.
# Arguments: OBJ($self) ARRAY_REF($array)
# Side Effects: none
# Return Value: ARRAY_REF
@@ -500,10 +502,14 @@ sub unique
=head1 ml_home_dir handling
+=head2 removed_ml_home_dir_path($ml_home_prefix, $ml_name)
+
+return ml_home_dir to be removed.
+
=cut
-# Descriptions:
+# Descriptions: return ml_home_dir to be removed.
# Arguments: OBJ($curproc) STR($ml_home_prefix) STR($ml_name)
# Side Effects: none
# Return Value: STR
@@ -511,6 +517,8 @@ sub removed_ml_home_dir_path
{
my ($curproc, $ml_home_prefix, $ml_name) = @_;
+ # XXX-TODO: name removed_ml_home_dir_path() is good ?
+
use Mail::Message::Date;
my $dobj = new Mail::Message::Date time;
my $date = $dobj->{ YYYYMMDD };
@@ -521,7 +529,7 @@ sub removed_ml_home_dir_path
}
-# Descriptions: find the latest removed $ml_home_dir
+# Descriptions: find the latest removed $ml_home_dir.
# Arguments: OBJ($curproc) STR($ml_home_prefix) STR($ml_name)
# Side Effects: none
# Return Value: STR
@@ -644,7 +652,7 @@ return options, result of getopts() analyze.
=cut
-# Descriptions: return fml version
+# Descriptions: return fml version.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: STR
@@ -657,7 +665,7 @@ sub fml_version
}
-# Descriptions: return fml owner
+# Descriptions: return fml owner.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: STR
@@ -670,7 +678,7 @@ sub fml_owner
}
-# Descriptions: return fml group
+# Descriptions: return fml group.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: STR
@@ -683,7 +691,7 @@ sub fml_group
}
-# Descriptions: return the current process name
+# Descriptions: return the current process name.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: STR
@@ -778,7 +786,7 @@ sub command_line_argv_find
}
-# Descriptions: return options, which is the result by getopts() analyze
+# Descriptions: return options, which is the result by getopts() analyze.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: ARRAY_REF
@@ -857,7 +865,7 @@ not yet implemenetd properly. (?)
=cut
-# Descriptions: return ml_name
+# Descriptions: return ml_name.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: STR
@@ -883,7 +891,7 @@ properly, return the default domain defined in /etc/fml/main.cf.
=cut
-# Descriptions: return my domain
+# Descriptions: return my domain.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: STR
@@ -948,7 +956,7 @@ return executable prefix such as "/usr/local".
=cut
-# Descriptions: return the path for executables
+# Descriptions: return the path where executables exist.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: STR
@@ -969,7 +977,7 @@ return the path where template files used in "newml" method exist.
# Descriptions: return the path where template files used
-# in "newml" method exist
+# in "newml" method exist.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: STR
@@ -1008,7 +1016,7 @@ sub ml_home_prefix
}
-# Descriptions: return $ml ML's home directory
+# Descriptions: return $ml ML's home directory.
# Arguments: OBJ($curproc) STR($ml) STR($domain)
# Side Effects: none
# Return Value: STR
@@ -1135,7 +1143,7 @@ return 1 if config.cf exists. 0 if not.
=cut
-# Descriptions: return $ml ML's config.cf path
+# Descriptions: return $ml ML's config.cf path.
# Arguments: OBJ($curproc) STR($ml) STR($domain)
# Side Effects: none
# Return Value: STR
@@ -1229,6 +1237,7 @@ sub is_cgi_process
my ($curproc) = @_;
my $name = $curproc->myname() || '';
+ # XXX-TODO: HARD CODED
if ($name =~ /\.cgi$/) {
return 1;
}
@@ -1246,6 +1255,7 @@ sub is_under_mta_process
my ($curproc) = @_;
my $name = $curproc->myname() || '';
+ # XXX-TODO: HARD CODED
if ($name eq 'distribute' ||
$name eq 'command' ||
$name eq 'digest' ||
@@ -1324,7 +1334,7 @@ get ARRAY_REF of address list for the specified map.
=cut
-# Descriptions: get address list for the specified map
+# Descriptions: get address list for the specified map.
# Arguments: OBJ($curproc) STR($map)
# Side Effects: none
# Return Value: ARRAY_REF
@@ -1334,6 +1344,9 @@ sub get_address_list
my $config = $curproc->config();
my $list = $config->get_as_array_ref( $map );
+
+ # XXX-TODO: moved to FML::User::Control ?
+
eval q{ use FML::User::Control;};
unless ($@) {
my $obj = new FML::User::Control;
@@ -1422,7 +1435,7 @@ return the current article number (sequence number).
=cut
-# Descriptions: return the current article number (sequence number)
+# Descriptions: return the current article number (sequence number).
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: NUM
@@ -1443,7 +1456,7 @@ sub article_max_id
=cut
-# Descriptions: set print style
+# Descriptions: set print style.
# Arguments: OBJ($curproc) STR($mode)
# Side Effects: none
# Return Value: STR
@@ -1455,7 +1468,7 @@ sub set_print_style
}
-# Descriptions: get print style
+# Descriptions: get print style.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: STR
@@ -1474,7 +1487,7 @@ sub get_print_style
=cut
-# Descriptions: inform default language
+# Descriptions: inform default language.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: STR
@@ -1486,7 +1499,7 @@ sub language_default
}
-# Descriptions: language used in html files
+# Descriptions: language used in html files.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: STR
@@ -1497,7 +1510,7 @@ sub language_of_html_file
}
-# Descriptions: set the current charset
+# Descriptions: set the current charset.
# Arguments: OBJ($curproc) STR($category) STR($charset)
# Side Effects: none
# Return Value: none
@@ -1571,7 +1584,7 @@ The type of return value is ARRAY_REF.
=cut
-# Descriptions: return language candidates requested by sender
+# Descriptions: return language candidates requested by sender.
# Arguments: OBJ($curproc) ARRAY_REF($list)
# Side Effects: none
# Return Value: ARRAY_REF
@@ -1591,7 +1604,7 @@ sub set_accept_language_list
}
-# Descriptions: return language candidates requested by sender
+# Descriptions: return language candidates requested by sender.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: ARRAY_REF
@@ -1623,7 +1636,7 @@ database.
# Return Value: HASH_REF
sub thread_db_args
{
- my ($curproc) = @_;
+ my ($curproc) = @_;
my $config = $curproc->config();
my $ml_name = $config->{ ml_name };
my $html_dir = $config->{ html_archive_dir };