Changeset 78
- Timestamp:
- 05/02/07 07:11:44 (2 years ago)
- Files:
-
- branches/refactoring/lib/Brackup/Backup.pm (modified) (2 diffs)
- branches/refactoring/lib/Brackup/File.pm (modified) (1 diff)
- branches/refactoring/lib/Brackup/Restore.pm (modified) (2 diffs)
- branches/refactoring/lib/Brackup/Test.pm (modified) (3 diffs)
- branches/refactoring/t/00-use.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/refactoring/lib/Brackup/Backup.pm
r69 r78 32 32 my ($file, $progress) = @_; # a Brackup::File and Brackup::Progress 33 33 34 print STDERR "", $file->path, "\n";34 #print STDERR "* ", $file->path, "\n"; 35 35 my @stored_chunks; 36 36 … … 39 39 my $schunk; 40 40 41 print "foreach chunk: ", $pchunk->as_string, "\n";41 #print " * foreach chunk: ", $pchunk->as_string, "\n"; 42 42 43 43 if ($schunk = $target->stored_chunk_from_inventory($pchunk)) { 44 #print " * stored chunk already on target.\n"; 44 45 push @stored_chunks, $schunk;; 45 46 return; 46 47 } 47 print "doesn't have chunk.\n"; 48 49 #$pchunk->will_need_data; 48 #print " * doesn't have chunk.\n"; 50 49 51 50 my $handle; branches/refactoring/lib/Brackup/File.pm
r76 r78 9 9 use Fcntl qw(S_ISREG S_ISDIR S_ISLNK); 10 10 use Digest::SHA1; 11 use Brackup:: Chunk;11 use Brackup::PositionedChunk; 12 12 13 13 sub new { branches/refactoring/lib/Brackup/Restore.pm
r66 r78 59 59 $self->_restore_directory($full, $it) if $type eq "d"; 60 60 $self->_restore_file ($full, $it) if $type eq "f"; 61 warn " * restored $it->{Path} to $full\n";61 #warn " * restored $it->{Path} to $full\n"; 62 62 } 63 63 … … 85 85 return $dataref; 86 86 87 unless ($ENV{'GPG_AGENT_INFO'}) { 87 unless ($ENV{'GPG_AGENT_INFO'} || 88 @Brackup::GPG_ARGS || 89 $self->{warned_about_gpg_agent}++) 90 { 88 91 my $err = q{# 89 92 # WARNING: trying to restore encrypted files, branches/refactoring/lib/Brackup/Test.pm
r60 r78 17 17 18 18 my $has_diff = eval "use Text::Diff; 1;"; 19 20 my @to_unlink; 21 my $par_pid = $$; 22 END { 23 if ($$ == $par_pid) { 24 my $rv = unlink @to_unlink; 25 print "unlinked = $rv\n"; 26 } 27 } 19 28 20 29 sub do_backup { … … 40 49 ok_dir_empty($backup_dir); 41 50 51 my ($inv_fh, $inv_filename) = tempfile(); 52 push @to_unlink, $inv_filename; 53 42 54 $confsec = Brackup::ConfigSection->new("TARGET:test_restore"); 43 55 $confsec->add("type" => "Filesystem"); 56 $confsec->add("inventory_db" => $inv_filename); 44 57 $confsec->add("path" => $backup_dir); 45 58 $conf->add_section($confsec); … … 56 69 my ($meta_fh, $meta_filename) = tempfile(); 57 70 ok(-e $meta_filename, "metafile exists"); 71 push @to_unlink, $meta_filename; 58 72 59 73 ok(eval { $backup->backup($meta_filename) }, "backup succeeded"); branches/refactoring/t/00-use.t
r19 r78 1 1 use Test::More tests => 1; 2 use Brackup::Backup; 3 use Brackup::DigestDatabase; 4 use Brackup::Target; 5 use Brackup::File; 6 use Brackup::Chunk; 2 use Brackup; 7 3 ok(1);
