diff options
| author | fukachan <fukachan> | 2004-03-17 12:55:03 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2004-03-17 12:55:03 +0000 |
| commit | ede2ff42523ed6e392437240a07ab2d1425f4dab (patch) | |
| tree | a879e98474499201965fb05f2c7da4c9a60b51dc /fml/lib | |
| parent | 5ac33a8d6a44af1ae2145b067f997c2e580582b0 (diff) | |
| download | fml8-ede2ff42523ed6e392437240a07ab2d1425f4dab.tar.gz fml8-ede2ff42523ed6e392437240a07ab2d1425f4dab.tar.bz2 fml8-ede2ff42523ed6e392437240a07ab2d1425f4dab.zip | |
install some files to be used continuously e.g. seq, summary, log, ...
Diffstat (limited to 'fml/lib')
| -rw-r--r-- | fml/lib/FML/Merge.pm | 12 | ||||
| -rw-r--r-- | fml/lib/FML/Merge/FML4/Config.pm | 41 |
2 files changed, 51 insertions, 2 deletions
diff --git a/fml/lib/FML/Merge.pm b/fml/lib/FML/Merge.pm index 53bf28cb..eb4da5b9 100644 --- a/fml/lib/FML/Merge.pm +++ b/fml/lib/FML/Merge.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: Merge.pm,v 1.4 2004/03/17 06:08:23 fukachan Exp $ +# $FML: Merge.pm,v 1.5 2004/03/17 08:38:31 fukachan Exp $ # package FML::Merge; @@ -115,6 +115,16 @@ sub backup_old_config_files } } } + + # continuous use: summary, log, seq ... + my $cont_files = $config->get_continuous_use_files(); + for my $f (@$cont_files) { + my $src = $self->backup_file_path($f); + my $dst = $self->new_file_path($f); + printf STDERR "copying: %-30s -> %-30s\n", $src, $dst; + use IO::Adapter::AtomicFile; + IO::Adapter::AtomicFile->copy($src, $dst); + } } diff --git a/fml/lib/FML/Merge/FML4/Config.pm b/fml/lib/FML/Merge/FML4/Config.pm index 0ccaaf70..12005e8a 100644 --- a/fml/lib/FML/Merge/FML4/Config.pm +++ b/fml/lib/FML/Merge/FML4/Config.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: @template.pm,v 1.8 2004/01/01 07:29:27 fukachan Exp $ +# $FML: Config.pm,v 1.1.1.1 2004/03/16 12:58:21 fukachan Exp $ # package FML::Merge::FML4::Config; @@ -165,6 +165,25 @@ my $ml_home_dir_backup_target_files = { # + # log et.al. + # + 'summary' => { + 'backup_mode' => 'copy', + 'continue' => 'yes', + }, + + 'seq' => { + 'backup_mode' => 'copy', + 'continue' => 'yes', + }, + + 'log' => { + 'backup_mode' => 'copy', + 'continue' => 'yes', + }, + + + # # misc # 'Makefile' => { @@ -226,6 +245,26 @@ sub get_old_list_files } +# Descriptions: return list of files we use continuously. +# Arguments: OBJ($self) +# Side Effects: none +# Return Value: ARRAY_REF +sub get_continuous_use_files +{ + my ($self) = @_; + my (@files) = (); + + for my $f (keys %$ml_home_dir_backup_target_files) { + my $cnt = $ml_home_dir_backup_target_files->{ $f }->{ continue } || ''; + if ($cnt eq 'yes') { + push(@files, $f); + } + } + + return \@files +} + + sub backup_mode { my ($self, $file) = @_; |
