diff options
| author | fukachan <fukachan> | 2002-09-28 09:27:00 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-09-28 09:27:00 +0000 |
| commit | ee8f7c907631f76052fff6ff8563327df04df160 (patch) | |
| tree | b8f71a41d8c6d69f79adc26b44da5f161e5b93b9 /fml/lib | |
| parent | c286560bb9160392580ec060ee783ad6aeca9aa1 (diff) | |
| download | fml8-ee8f7c907631f76052fff6ff8563327df04df160.tar.gz fml8-ee8f7c907631f76052fff6ff8563327df04df160.tar.bz2 fml8-ee8f7c907631f76052fff6ff8563327df04df160.zip | |
hold file mode. set $dst mode same as $src mode
Diffstat (limited to 'fml/lib')
| -rw-r--r-- | fml/lib/FML/Config/Convert.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fml/lib/FML/Config/Convert.pm b/fml/lib/FML/Config/Convert.pm index 2f82c7d8..bd87c38e 100644 --- a/fml/lib/FML/Config/Convert.pm +++ b/fml/lib/FML/Config/Convert.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: Convert.pm,v 1.10 2002/09/11 23:18:11 fukachan Exp $ +# $FML: Convert.pm,v 1.11 2002/09/22 14:56:48 fukachan Exp $ # @@ -24,8 +24,6 @@ FML::Config::Convert -- variable expansion for __variable__ my $out = new FileHandle "> $dst.$$"; if (defined $in && defined $out) { - chmod 0644, "$dst.$$"; - &FML::Config::Convert::convert($in, $out, $config); $out->close(); @@ -88,7 +86,9 @@ sub convert_file my $out = new FileHandle "> " . $dst_tmp; if (defined $in && defined $out) { - chmod 0644, $dst_tmp; + use File::stat; + my $stat = stat($src); + my $mode = $stat->mode; eval q{ convert($in, $out, $config);}; croak($@) if $@; @@ -96,6 +96,7 @@ sub convert_file $out->close(); $in->close(); + chmod $mode, $dst_tmp; rename($dst_tmp, $dst) || croak("fail to rename $dst"); } else { |
