summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Command
diff options
context:
space:
mode:
authorfukachan <fukachan>2005-08-23 09:32:58 +0000
committerfukachan <fukachan>2005-08-23 09:32:58 +0000
commit56734202363f4b7f27ef8cc5247356b42d456b1c (patch)
tree6d36298c66d6a4e27a66e53b5967959246efc4b1 /fml/lib/FML/Command
parentee51163fe16e064abb3e60855b633e432561f30e (diff)
downloadfml8-56734202363f4b7f27ef8cc5247356b42d456b1c.tar.gz
fml8-56734202363f4b7f27ef8cc5247356b42d456b1c.tar.bz2
fml8-56734202363f4b7f27ef8cc5247356b42d456b1c.zip
implement reviveml command to revive a removed ML
Diffstat (limited to 'fml/lib/FML/Command')
-rw-r--r--fml/lib/FML/Command/Admin/reviveml.pm98
1 files changed, 98 insertions, 0 deletions
diff --git a/fml/lib/FML/Command/Admin/reviveml.pm b/fml/lib/FML/Command/Admin/reviveml.pm
new file mode 100644
index 00000000..d899050e
--- /dev/null
+++ b/fml/lib/FML/Command/Admin/reviveml.pm
@@ -0,0 +1,98 @@
+#-*- perl -*-
+#
+# Copyright (C) 2005 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$
+#
+
+package FML::Command::Admin::reviveml;
+use strict;
+use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
+use Carp;
+
+use FML::Command::Admin::newml;
+@ISA = qw(FML::Command::Admin::newml);
+
+
+=head1 NAME
+
+FML::Command::Admin::reviveml - set up a new mailing list.
+
+=head1 SYNOPSIS
+
+ use FML::Command::Admin::reviveml;
+ $obj = new FML::Command::Admin::reviveml;
+ $obj->reviveml($curproc, $command_args);
+
+See C<FML::Command> for more details.
+
+=head1 DESCRIPTION
+
+set up a new mailing list.
+create mailing list directory,
+install config.cf, include, include-ctl et. al.
+
+=head1 METHODS
+
+=head2 process($curproc, $command_args)
+
+=cut
+
+
+# Descriptions: set up a new mailing list.
+# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args)
+# Side Effects: create mailing list directory,
+# install config.cf, include, include-ctl et. al.
+# Return Value: none
+sub process
+{
+ my ($self, $curproc, $command_args) = @_;
+ my $ml_name = $curproc->ml_name();
+ my $ml_domain = $curproc->ml_domain();
+
+ my $ml_home_dir = $curproc->ml_home_dir($ml_name, $ml_domain);
+ my $ml_home_dir_prev =
+ $curproc->ml_home_dir_find_latest_removed_path($ml_name, $ml_domain);
+
+ $curproc->logdebug("ml_name=$ml_name ml_domain=$ml_domain");
+ $curproc->logdebug("dir=$ml_home_dir_prev -> $ml_home_dir");
+
+ if (-d $ml_home_dir_prev && ! -d $ml_home_dir) {
+ rename($ml_home_dir_prev, $ml_home_dir);
+ }
+
+ if (!-d $ml_home_dir_prev && -d $ml_home_dir) {
+ $curproc->log("revived ml_home_dir from $ml_home_dir_prev");
+ }
+
+ $self->SUPER::set_force_mode($curproc, $command_args);
+ $self->SUPER::process($curproc, $command_args);
+}
+
+
+=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) 2005 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::reviveml first appeared in fml8 mailing list driver package.
+See C<http://www.fml.org/> for more details.
+
+=cut
+
+
+1;