| 1 | package Brackup::Target::Filebased; | ||||||||||||||||||||||||||||
| 2 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use base 'Brackup::Target'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | # version >= 1.06: 01/23/0123456789abcdef...xxx.chunk | ||||||||||||||||||||||||||||
| 7 | # 256 * 256 directories, then files. would need 2 billion | ||||||||||||||||||||||||||||
| 8 | # files before leaves have 32k+ files, but at that point | ||||||||||||||||||||||||||||
| 9 | # users are probably using better filesystems if they | ||||||||||||||||||||||||||||
| 10 | # have 2+ billion inodes. | ||||||||||||||||||||||||||||
| 11 | 174 | ▶ | sub chunkpath { | ||||||||||||||||||||||||||
|
Subroutine
chunkpath: called CC=5 SCAR=16.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 12 | 174 | my ($self, $dig) = @_; | |||||||||||||||||||||||||||
| 13 | 174 | my @parts; | |||||||||||||||||||||||||||
| 14 | 174 | my $fulldig = $dig; | |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 174 | $dig =~ s/^\w+://; # remove the "hashtype:" from beginning | |||||||||||||||||||||||||||
| 17 | 174 | ▶ | $fulldig =~ s/:/./g if $self->nocolons; # Convert colons to dots if we've been asked to | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 174 | ▶ | while (length $dig && @parts < 2) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
length $dig and @parts < 2
MC/DC50%1/2
length $dig and @parts < 2
length $dig
@parts < 2
Truth table66%2/3
A and B
A= length $digB= @parts < 2
| |||||||||||||||||||||||||||||
| 20 | 348 | ▶ | $dig =~ s/^([0-9a-f]{2})// or die "Can't get 2 hex digits of $fulldig"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | 348 | push @parts, $1; | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 174 | return join("/", @parts) . "/$fulldig.chunk"; | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 13 | ▶ | sub metapath { | ||||||||||||||||||||||||||
|
Subroutine
metapath: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 28 | 13 | my ($self, $name) = @_; | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 13 | ▶ | $name ||= ''; | ||||||||||||||||||||||||||
|
Condition100%2/2
$name ||= ""
MC/DC100%1/1
$name ||= ""
$name
Truth table100%2/2
A
A= $name
| |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 13 | return "backups/$name"; | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 4 | 1; | |||||||||||||||||||||||||||