summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-08-22 03:07:59 +0000
committerfukachan <fukachan>2001-08-22 03:07:59 +0000
commit3c2ac05aa975bf9df8212e2a9e0dc49299fe4a74 (patch)
tree9708f245bc3296778615cc6e6b01081af8391870
parent10f0cdb58372123f5986cd7646e1d23c306199bb (diff)
downloadfml8-3c2ac05aa975bf9df8212e2a9e0dc49299fe4a74.tar.gz
fml8-3c2ac05aa975bf9df8212e2a9e0dc49299fe4a74.tar.bz2
fml8-3c2ac05aa975bf9df8212e2a9e0dc49299fe4a74.zip
modified to use File::Spec
-rw-r--r--fml/lib/FML/Article.pm6
-rw-r--r--fml/lib/FML/Command/newml.pm8
-rw-r--r--fml/lib/FML/Process/CGI.pm6
-rw-r--r--fml/lib/FML/Ticket/Model/minimal_states.pm18
4 files changed, 24 insertions, 14 deletions
diff --git a/fml/lib/FML/Article.pm b/fml/lib/FML/Article.pm
index d6df27ac..993f15e6 100644
--- a/fml/lib/FML/Article.pm
+++ b/fml/lib/FML/Article.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: Article.pm,v 1.21 2001/04/08 06:42:59 fukachan Exp $
+# $FML: Article.pm,v 1.22 2001/05/27 14:27:53 fukachan Exp $
#
package FML::Article;
@@ -161,7 +161,9 @@ sub spool_in
mkpath( $spool_dir, 0, 0700 );
}
- my $file = $spool_dir . "/" . $id;
+ use File::Spec;
+ my $file = File::Spec->catfile($spool_dir, $id);
+
use FileHandle;
my $fh = new FileHandle;
$fh->open($file, "w");
diff --git a/fml/lib/FML/Command/newml.pm b/fml/lib/FML/Command/newml.pm
index a3773c14..6317ef4d 100644
--- a/fml/lib/FML/Command/newml.pm
+++ b/fml/lib/FML/Command/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.6 2001/05/27 14:27:54 fukachan Exp $
+# $FML: newml.pm,v 1.7 2001/07/15 12:03:37 fukachan Exp $
#
package FML::Command::newml;
@@ -52,9 +52,11 @@ sub newml
unless (-d $ml_home_dir) {
mkdirhier( $ml_home_dir, $config->{ default_dir_mode } || 0755 );
+ use File::Spec;
+
my $default_config_dir = $main_cf->{ default_config_dir };
- my $src = $default_config_dir ."/config.cf";
- my $dst = $ml_home_dir . "/" . 'config.cf';
+ my $src = File::Spec->catfile($default_config_dir, "config.cf");
+ my $dst = File::Spec->catfile($ml_home_dir, 'config.cf');
copy($src, $dst);
}
else {
diff --git a/fml/lib/FML/Process/CGI.pm b/fml/lib/FML/Process/CGI.pm
index 6a0044fa..2ccfc9cd 100644
--- a/fml/lib/FML/Process/CGI.pm
+++ b/fml/lib/FML/Process/CGI.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: CGI.pm,v 1.13 2001/05/28 16:17:13 fukachan Exp $
+# $FML: CGI.pm,v 1.14 2001/06/10 11:24:12 fukachan Exp $
#
package FML::Process::CGI;
@@ -59,7 +59,9 @@ sub new
my $ml_name = param('ml_name') || do {
croak("not get ml_name from HTTP") if $args->{ need_ml_name };
};
- my $ml_home_dir = $ml_home_prefix .'/'. $ml_name;
+
+ use File::Spec;
+ my $ml_home_dir = File::Spec->catfile($ml_home_prefix, $ml_name);
# fix $args { cf_list, ml_home_dir };
my $cf = $args->{ cf_list };
diff --git a/fml/lib/FML/Ticket/Model/minimal_states.pm b/fml/lib/FML/Ticket/Model/minimal_states.pm
index 503362d7..c24369e5 100644
--- a/fml/lib/FML/Ticket/Model/minimal_states.pm
+++ b/fml/lib/FML/Ticket/Model/minimal_states.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: minimal_states.pm,v 1.19 2001/06/10 10:22:47 fukachan Exp $
+# $FML: minimal_states.pm,v 1.20 2001/07/31 14:19:44 fukachan Exp $
#
package FML::Ticket::Model::minimal_states;
@@ -12,6 +12,7 @@ package FML::Ticket::Model::minimal_states;
use strict;
use vars qw(@ISA @EXPORT @EXPORT_OK);
use Carp;
+use File::Spec;
use FML::Log qw(Log LogWarn LogError);
use FML::Ticket::System;
@@ -78,16 +79,18 @@ sub new
my $ml_name = $config->{ ml_name };
croak("specify \$ml_name\n") unless defined $ml_name;
-
+
$me->{ _fd } = $args->{ fd } || \*STDOUT;
- $me->{ _db_dir } = $config->{ ticket_db_dir } ."/". $ml_name;
+ $me->{ _db_dir } = File::Spec->catfile($config->{ ticket_db_dir },
+ $ml_name);
$me->_init_ticket_db_dir($curproc, $args) || do {
Log("fail to initialize ticket_db_dir");
return undef;
};
# index for cross reference over mailing lists.
- $me->{ _index_db } = $config->{ ticket_db_dir } ."/\@index";
+ $me->{ _index_db } = File::Spec->catfile($config->{ ticket_db_dir },
+ "\@index");
# pragma for operations hints
$me->{ _pragma } = '';
@@ -802,7 +805,8 @@ sub _print_article_summary
(@aid) = split(/\s+/, $rh->{ _articles }->{ $tid });
$aid = $aid[0];
- print $fd $self->_article_summary( $spool_dir ."/". $aid );
+ print $fd $self->_article_summary(File::Spec->catfile($spool_dir,
+ $aid));
}
}
@@ -905,7 +909,7 @@ sub show_articles_for_ticket
my $s = '';
for (split(/\s+/, $articles)) {
- my $file = $spool_dir.'/'.$_;
+ my $file = File::Spec->catfile($spool_dir, $_);
my $fh = new FileHandle $file;
while (defined($_ = $fh->getline())) {
@@ -1005,7 +1009,7 @@ sub _show_ticket_by_html_table
print "<TD>";
$aid = (split(/\s+/, $articles))[0];
- my $buf = $self->_article_summary( $spool_dir ."/". $aid );
+ my $buf = $self->_article_summary(File::Spec->catfile($spool_dir, $aid));
use FML::Language::ISO2022JP qw(STR2EUC);
print STR2EUC($buf);
}