summaryrefslogtreecommitdiff
path: root/fml
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-07-19 12:58:47 +0000
committerfukachan <fukachan>2003-07-19 12:58:47 +0000
commit9bdbcfee3a4294312970d3a0efbea7d20ac1c8a6 (patch)
tree02c7b2f9eb15c4ee134f6b01efbb35d3a74e4a71 /fml
parenta2a8d46666f91fd4e106f24d610c60ec16a99a30 (diff)
downloadfml8-9bdbcfee3a4294312970d3a0efbea7d20ac1c8a6.tar.gz
fml8-9bdbcfee3a4294312970d3a0efbea7d20ac1c8a6.tar.bz2
fml8-9bdbcfee3a4294312970d3a0efbea7d20ac1c8a6.zip
fixed to co-work with udb well.
Diffstat (limited to 'fml')
-rw-r--r--fml/lib/FML/Command/HTMLify.pm14
-rw-r--r--fml/lib/FML/Process/Distribute.pm13
-rw-r--r--fml/lib/Mail/Message/ToHTML.pm32
3 files changed, 39 insertions, 20 deletions
diff --git a/fml/lib/FML/Command/HTMLify.pm b/fml/lib/FML/Command/HTMLify.pm
index 7ef68c92..34762031 100644
--- a/fml/lib/FML/Command/HTMLify.pm
+++ b/fml/lib/FML/Command/HTMLify.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: HTMLify.pm,v 1.15 2003/01/11 16:05:14 fukachan Exp $
+# $FML: HTMLify.pm,v 1.16 2003/02/16 08:33:09 fukachan Exp $
#
package FML::Command::HTMLify;
@@ -41,6 +41,8 @@ sub convert
{
my ($curproc, $args, $optargs) = @_;
my $config = $curproc->config();
+ my $ml_name = $config->{ ml_name };
+ my $udb_dir = $config->{ udb_base_dir };
my $src_dir = $optargs->{ src_dir };
my $dst_dir = $optargs->{ dst_dir };
my $charset = $curproc->language_of_html_file();
@@ -58,11 +60,17 @@ sub convert
print STDERR " convert\n\t$src_dir =>\n\t$dst_dir\n" if $debug;
+ unless (-d $udb_dir) { $curproc->mkdir($udb_dir);}
+
my $index_order = $config->{ html_archive_index_order_type };
my $htmlifier_args = {
- directory => $dst_dir,
charset => $charset,
- index_order => $index_order,
+
+ output_dir => $dst_dir, # ~fml/public_html/mlarchive/$domain/$ml/
+ db_base_dir => $udb_dir, # /var/spool/ml/@udb@
+ db_name => $ml_name, # elena
+
+ index_order => $index_order, # normal/reverse
};
my ($is_subdir_exists, $subdirs) = _check_subdir_exists($src_dir);
diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm
index e41ff67f..8eec4cec 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 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Distribute.pm,v 1.114 2003/05/13 03:49:55 fukachan Exp $
+# $FML: Distribute.pm,v 1.115 2003/05/13 04:26:48 fukachan Exp $
#
package FML::Process::Distribute;
@@ -562,17 +562,24 @@ sub htmlify
my $ml_name = $config->{ ml_name };
my $spool_dir = $config->{ spool_dir };
my $html_dir = $config->{ html_archive_dir };
+ my $udb_dir = $config->{ udb_base_dir };
my $article = $curproc->_build_article_object($args);
my $article_id = $pcb->get('article', 'id');
my $article_file = $article->filepath($article_id);
my $index_order = $config->{ html_archive_index_order_type };
my $cur_lang = $curproc->language_of_html_file();
+ unless (-d $udb_dir) { $curproc->mkdir($udb_dir);}
+
# XXX-TODO: care for non Japanese.
my $htmlifier_args = {
- directory => $html_dir,
charset => $cur_lang,
- index_order => $index_order,
+
+ output_dir => $html_dir, # ~fml/public_html/mlarchive/$domain/$ml/
+ db_base_dir => $udb_dir, # /var/spool/ml/@udb@
+ db_name => $ml_name, # elena
+
+ index_order => $index_order, # normal/reverse
};
$curproc->set_umask_as_public();
diff --git a/fml/lib/Mail/Message/ToHTML.pm b/fml/lib/Mail/Message/ToHTML.pm
index 05ef7fd8..726da403 100644
--- a/fml/lib/Mail/Message/ToHTML.pm
+++ b/fml/lib/Mail/Message/ToHTML.pm
@@ -4,20 +4,21 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML$
+# $FML: ToHTML.pm,v 1.44 2003/07/19 10:23:35 fukachan Exp $
#
package Mail::Message::ToHTML;
use strict;
use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
use Carp;
+use File::Spec;
my $is_strict_warn = 0;
my $debug = 0;
my $URL =
"<A HREF=\"http://www.fml.org/software/\">Mail::Message::ToHTML</A>";
-my $version = q$FML$;
+my $version = q$FML: ToHTML.pm,v 1.44 2003/07/19 10:23:35 fukachan Exp $;
if ($version =~ /,v\s+([\d\.]+)\s+/) {
$version = "$URL $1";
}
@@ -95,33 +96,36 @@ sub new
my ($type) = ref($self) || $self;
my $me = {};
- $me->{ _html_base_directory } = $args->{ directory };
$me->{ _charset } = $args->{ charset } || 'us-ascii';
- $me->{ _is_attachment } = defined($args->{ attachment }) ? 1 : 0;
+ $me->{ _html_base_directory } = $args->{ output_dir };
$me->{ _db_type } = $args->{ db_type };
$me->{ _db_name } = $args->{ db_name };
$me->{ _db_base_dir } = $args->{ db_base_dir };
+ $me->{ _is_attachment } = defined($args->{ attachment }) ? 1 : 0;
$me->{ _args } = $args;
$me->{ _num_attachment } = 0; # for child process
$me->{ _use_subdir } = 'yes';
$me->{ _subdir_style } = 'yyyymm';
$me->{ _html_id_order } = $args->{ index_order } || 'normal';
- my $db_type = $me->{ _db_type };
- my $db_base = $me->{ _db_base_dir } || croak("specify db_base_dir\n");
- my $db_name = $me->{ _db_name } || croak("specify db_name\n");
- my $_args = {
+ my $db_type = $me->{ _db_type };
+ my $db_base = $me->{ _db_base_dir } || croak("specify db_base_dir\n");
+ my $db_name = $me->{ _db_name } || croak("specify db_name\n");
+ my $db_dir = File::Spec->catfile($db_base, $db_name);
+ unless (-d $db_base) { mkdir($db_base, 0755);}
+ unless (-d $db_dir) { mkdir($db_dir, 0755);}
+ my $_db_args = {
db_module => $db_type,
- db_base_dir => $db_base,
+ db_base_dir => $db_dir,
db_name => $db_name, # mailing list identifier
- # db non UDB
- old_db_base_dir => $args->{ directory },
+ # db_dir for non UDB
+ old_db_base_dir => $args->{ output_dir },
};
# Firstly, prepare db object.
use Mail::Message::DB;
- my $ndb = new Mail::Message::DB $_args;
+ my $ndb = new Mail::Message::DB $_db_args;
$me->{ _ndb } = $ndb;
return bless $me, $type;
@@ -2044,7 +2048,7 @@ try to convert all rfc822 messages to HTML in C<$dir> directory.
sub htmlify_file
{
my ($self, $file, $args) = @_;
- my $dst_dir = $args->{ directory };
+ my $dst_dir = $args->{ output_dir };
unless (-f $file) {
print STDERR "no such file: $file\n" if $debug;
@@ -2109,7 +2113,7 @@ sub htmlify_file
sub htmlify_dir
{
my ($self, $src_dir, $args) = @_;
- my $dst_dir = $args->{ directory };
+ my $dst_dir = $args->{ output_dir };
my $min = 0;
my $max = 0;
my $has_fork = 1; # ok on unix and perl>5.6 on wine32.