diff options
| author | fukachan <fukachan> | 2002-04-21 13:52:02 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-04-21 13:52:02 +0000 |
| commit | 7eec3483c2cbe8aa98f92c36d278edadf5f98f07 (patch) | |
| tree | 3752fc73b0057ac553e5cc3a485869c425ce0039 | |
| parent | 4b1f96c5c926e3de44cf75541d4a162a2f18f25f (diff) | |
| download | fml8-7eec3483c2cbe8aa98f92c36d278edadf5f98f07.tar.gz fml8-7eec3483c2cbe8aa98f92c36d278edadf5f98f07.tar.bz2 fml8-7eec3483c2cbe8aa98f92c36d278edadf5f98f07.zip | |
install .htaccess only for the first time
| -rw-r--r-- | fml/lib/FML/Command/Admin/newml.pm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fml/lib/FML/Command/Admin/newml.pm b/fml/lib/FML/Command/Admin/newml.pm index 711aeba5..781e44cf 100644 --- a/fml/lib/FML/Command/Admin/newml.pm +++ b/fml/lib/FML/Command/Admin/newml.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: newml.pm,v 1.23 2002/04/10 09:51:25 fukachan Exp $ +# $FML: newml.pm,v 1.24 2002/04/10 09:57:23 fukachan Exp $ # package FML::Command::Admin::newml; @@ -226,20 +226,26 @@ sub _setup_cgi_interface eval q{ use File::Utils qw(mkdirhier);}; croak($@) if $@; + my (%is_dir_exists) = (); my $cgi_base_dir = $config->{ cgi_base_dir }; my $admin_cgi_dir = $config->{ admin_cgi_base_dir }; my $ml_admin_cgi_dir = $config->{ ml_admin_cgi_base_dir }; - for my $dir ($admin_cgi_dir, $ml_admin_cgi_dir) { + for my $dir ($cgi_base_dir, $admin_cgi_dir, $ml_admin_cgi_dir) { unless (-d $dir) { print STDERR "creating $dir\n"; + $is_dir_exists{ $dir } = 0; mkdirhier( $dir, $config->{ default_dir_mode } || 0755 ); } + else { + $is_dir_exists{ $dir } = 1; + } } # # 2. disable CGI access by creating a dummy .htaccess - # - { + # install .htaccess only for the first time. + # + unless ( $is_dir_exists{ $cgi_base_dir } ) { use File::Spec; my $src = File::Spec->catfile($template_dir, 'dot_htaccess'); my $dst = File::Spec->catfile($cgi_base_dir, '.htaccess'); |
