diff options
| author | fukachan <fukachan> | 2001-11-18 08:57:29 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-11-18 08:57:29 +0000 |
| commit | 5cdb01bb9f2cebdde7b59a3d0d4867f63cfa6510 (patch) | |
| tree | e82e6ef2714588dec6f79bf53596badd03b9ddd2 | |
| parent | 2102faeb7c7a7b5ac8855d1a604afcc04f4d6f3b (diff) | |
| download | fml8-5cdb01bb9f2cebdde7b59a3d0d4867f63cfa6510.tar.gz fml8-5cdb01bb9f2cebdde7b59a3d0d4867f63cfa6510.tar.bz2 fml8-5cdb01bb9f2cebdde7b59a3d0d4867f63cfa6510.zip | |
fmlthread db_dump $ml [$type]
to dump hash table as text for e.g. backup
| -rw-r--r-- | fml/lib/FML/Process/ThreadTrack.pm | 8 | ||||
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/DB.pm | 23 |
2 files changed, 29 insertions, 2 deletions
diff --git a/fml/lib/FML/Process/ThreadTrack.pm b/fml/lib/FML/Process/ThreadTrack.pm index c7742383..79883f38 100644 --- a/fml/lib/FML/Process/ThreadTrack.pm +++ b/fml/lib/FML/Process/ThreadTrack.pm @@ -4,7 +4,7 @@ # Copyright (C) 2000-2001 Ken'ichi Fukamachi # All rights reserved. # -# $FML: ThreadTrack.pm,v 1.12 2001/11/11 13:37:41 fukachan Exp $ +# $FML: ThreadTrack.pm,v 1.13 2001/11/18 06:42:17 fukachan Exp $ # package FML::Process::ThreadTrack; @@ -113,6 +113,12 @@ sub run my $str = defined $argv->[2] ? $argv->[ 2 ] : 'last:100'; $thread->review( $str , 1, $max_id ); } + elsif ($command eq 'db_dump') { + my $type = defined $argv->[ 2 ] ? $argv->[ 2 ] : 'status'; + $thread->db_open(); + $thread->db_dump( $type ); + $thread->db_close(); + } elsif ($command eq 'db_rebuild') { print STDERR "\$thread->db_mkdb(1, $max_id);\n" if $ENV{'debug'}; $thread->db_mkdb(1, $max_id); diff --git a/fml/lib/Mail/ThreadTrack/DB.pm b/fml/lib/Mail/ThreadTrack/DB.pm index 126855a2..3a427c84 100644 --- a/fml/lib/Mail/ThreadTrack/DB.pm +++ b/fml/lib/Mail/ThreadTrack/DB.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: DB.pm,v 1.11 2001/11/09 13:30:57 fukachan Exp $ +# $FML: DB.pm,v 1.12 2001/11/16 10:09:14 fukachan Exp $ # package Mail::ThreadTrack::DB; @@ -197,6 +197,27 @@ sub db_mkdb } +=head2 db_dump([$type]) + +dump hash as text. +dump status database if $type is not specified. + +=cut + + +sub db_dump +{ + my ($self, $type) = @_; + my $db_type = "_" . ( defined $type ? $type : 'status' ); + my $rh = $self->{ _hash_table }->{ $db_type }; + + my ($k, $v); + while (($k, $v) = each %$rh) { + printf "%-20s %s\n", $k, $v; + } +} + + =head1 AUTHOR Ken'ichi Fukamachi |
