Changeset 78

Show
Ignore:
Timestamp:
05/02/07 07:11:44 (2 years ago)
Author:
bradfitz
Message:

gets tests passing again, and quietly.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/refactoring/lib/Brackup/Backup.pm

    r69 r78  
    3232        my ($file, $progress) = @_;  # a Brackup::File and Brackup::Progress 
    3333 
    34         print STDERR " ", $file->path, "\n"; 
     34        #print STDERR "* ", $file->path, "\n"; 
    3535        my @stored_chunks; 
    3636 
     
    3939            my $schunk; 
    4040 
    41             print "foreach chunk: ", $pchunk->as_string, "\n"; 
     41            #print "  * foreach chunk: ", $pchunk->as_string, "\n"; 
    4242 
    4343            if ($schunk = $target->stored_chunk_from_inventory($pchunk)) { 
     44                #print "    * stored chunk already on target.\n"; 
    4445                push @stored_chunks, $schunk;; 
    4546                return; 
    4647            } 
    47             print "doesn't have chunk.\n"; 
    48  
    49             #$pchunk->will_need_data; 
     48            #print "    * doesn't have chunk.\n"; 
    5049 
    5150            my $handle; 
  • branches/refactoring/lib/Brackup/File.pm

    r76 r78  
    99use Fcntl qw(S_ISREG S_ISDIR S_ISLNK); 
    1010use Digest::SHA1; 
    11 use Brackup::Chunk; 
     11use Brackup::PositionedChunk; 
    1212 
    1313sub new { 
  • branches/refactoring/lib/Brackup/Restore.pm

    r66 r78  
    5959        $self->_restore_directory($full, $it) if $type eq "d"; 
    6060        $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"; 
    6262    } 
    6363 
     
    8585        return $dataref; 
    8686 
    87     unless ($ENV{'GPG_AGENT_INFO'}) { 
     87    unless ($ENV{'GPG_AGENT_INFO'} || 
     88            @Brackup::GPG_ARGS || 
     89            $self->{warned_about_gpg_agent}++) 
     90    { 
    8891        my $err = q{# 
    8992                        # WARNING: trying to restore encrypted files, 
  • branches/refactoring/lib/Brackup/Test.pm

    r60 r78  
    1717 
    1818my $has_diff = eval "use Text::Diff; 1;"; 
     19 
     20my @to_unlink; 
     21my $par_pid = $$; 
     22END { 
     23    if ($$ == $par_pid) { 
     24        my $rv = unlink @to_unlink; 
     25        print "unlinked = $rv\n"; 
     26    } 
     27} 
    1928 
    2029sub do_backup { 
     
    4049    ok_dir_empty($backup_dir); 
    4150 
     51    my ($inv_fh, $inv_filename) = tempfile(); 
     52    push @to_unlink, $inv_filename; 
     53 
    4254    $confsec = Brackup::ConfigSection->new("TARGET:test_restore"); 
    4355    $confsec->add("type" => "Filesystem"); 
     56    $confsec->add("inventory_db" => $inv_filename); 
    4457    $confsec->add("path" => $backup_dir); 
    4558    $conf->add_section($confsec); 
     
    5669    my ($meta_fh, $meta_filename) = tempfile(); 
    5770    ok(-e $meta_filename, "metafile exists"); 
     71    push @to_unlink, $meta_filename; 
    5872 
    5973    ok(eval { $backup->backup($meta_filename) }, "backup succeeded"); 
  • branches/refactoring/t/00-use.t

    r19 r78  
    11use Test::More tests => 1; 
    2 use Brackup::Backup; 
    3 use Brackup::DigestDatabase; 
    4 use Brackup::Target; 
    5 use Brackup::File; 
    6 use Brackup::Chunk; 
     2use Brackup; 
    73ok(1);