| 1 | package File::DistDir; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Cwd qw(abs_path getcwd); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use English qw(-no_match_vars); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use File::Basename qw(basename dirname); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use File::Copy (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use File::Path qw(make_path); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 2 | ▶ | use File::ShareDir qw(dist_dir); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 2 | ▶ | use File::Spec; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 2 | our $VERSION = '1.0.0'; | |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | ######################################################################## | ||||||||||||||||||||||||||||
| 17 | 1 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=5 SCAR=18.4
Pod
documented
| |||||||||||||||||||||||||||||
| 18 | ######################################################################## | ||||||||||||||||||||||||||||
| 19 | 1 | my ( $class, %args ) = @_; | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 1 | my $distribution = $args{distribution}; | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 1 | ▶ | die "ERROR: distribution is required\n" | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $distribution and length $distribution
MC/DC0%0/2
defined $distribution and length $distribution
defined $distribution
length $distribution
Truth table33%1/3
A and B
A= defined $distributionB= length $distribution
| |||||||||||||||||||||||||||||
| 24 | if !defined $distribution || !length $distribution; | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 1 | my $root = abs_path( dist_dir($distribution) ); | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 1 | ▶ | die sprintf "ERROR: distribution share directory not found: %s\n", $distribution | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $root and -d $root
MC/DC0%0/2
defined $root and -d $root
defined $root
-d $root
Truth table33%1/3
A and B
A= defined $rootB= -d $root
| |||||||||||||||||||||||||||||
| 29 | if !defined $root || !-d $root; | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 1 | return bless { | |||||||||||||||||||||||||||
| 32 | distribution => $distribution, | ||||||||||||||||||||||||||||
| 33 | dir => $root, | ||||||||||||||||||||||||||||
| 34 | }, $class; | ||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | ######################################################################## | ||||||||||||||||||||||||||||
| 38 | 21 | ▶ | sub dir { | ||||||||||||||||||||||||||
|
Subroutine
dir: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 39 | ######################################################################## | ||||||||||||||||||||||||||||
| 40 | 21 | my ($self) = @_; | |||||||||||||||||||||||||||
| 41 | 21 | return $self->{dir}; | |||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | ######################################################################## | ||||||||||||||||||||||||||||
| 45 | 10 | ▶ | sub path { | ||||||||||||||||||||||||||
|
Subroutine
path: called CC=6 SCAR=18.1
Pod
documented
| |||||||||||||||||||||||||||||
| 46 | ######################################################################## | ||||||||||||||||||||||||||||
| 47 | 10 | my ( $self, $relative ) = @_; | |||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 10 | ▶ | $relative //= q{.}; | ||||||||||||||||||||||||||
|
Condition50%1/2
$relative //= "."
MC/DC0%0/1
$relative //= "."
$relative
Truth table50%1/2
A
A= $relative
| |||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 10 | ▶ | die "ERROR: source must be relative to the distribution directory\n" | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 52 | if File::Spec->file_name_is_absolute($relative); | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 10 | my $root = $self->dir; | |||||||||||||||||||||||||||
| 55 | 10 | my $candidate = File::Spec->catfile( $root, $relative ); | |||||||||||||||||||||||||||
| 56 | 10 | my $resolved = abs_path($candidate); | |||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 10 | ▶ | die sprintf "ERROR: source not found: %s\n", $relative | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 59 | if !defined $resolved; | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | 10 | ▶ | die sprintf "ERROR: source is outside distribution directory: %s\n", $relative | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$resolved ne $root and index($resolved, $root . '/') != 0
MC/DC100%2/2
$resolved ne $root and index($resolved, $root . '/') != 0
$resolved ne $root
index($resolved, $root . '/') != 0
Truth table100%3/3
A and B
A= $resolved ne $rootB= index($resolved, $root . '/') != 0
| |||||||||||||||||||||||||||||
| 62 | if $resolved ne $root && index( $resolved, $root . q{/} ) != 0; | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | 9 | return $resolved; | |||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | ######################################################################## | ||||||||||||||||||||||||||||
| 68 | 9 | ▶ | sub copy { | ||||||||||||||||||||||||||
|
Subroutine
copy: called CC=17 SCAR=29.6
Pod
documented
| |||||||||||||||||||||||||||||
| 69 | ######################################################################## | ||||||||||||||||||||||||||||
| 70 | 9 | my ( $self, $source, $destination, %options ) = @_; | |||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 9 | ▶ | die "ERROR: copy requires a source\n" | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 73 | if !defined $source; | ||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | 9 | ▶ | die "ERROR: destination is required for file copying\n" | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not defined $destination and $source ne "."
MC/DC0%0/2
not defined $destination and $source ne "."
not defined $destination
$source ne "."
Truth table66%2/3
not(A) and B
A= not defined $destinationB= $source ne "."
| |||||||||||||||||||||||||||||
| 76 | if !defined $destination && $source ne q{.}; | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | 9 | ▶ | $destination //= q{.}; | ||||||||||||||||||||||||||
|
Condition100%2/2
$destination //= "."
MC/DC100%1/1
$destination //= "."
$destination
Truth table100%2/2
A
A= $destination
| |||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | 9 | my $source_path = File::Spec->catfile( $self->dir, $source ); | |||||||||||||||||||||||||||
| 81 | 9 | _reject_symlink_components($source_path); | |||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | 8 | my $resolved = $self->path($source); | |||||||||||||||||||||||||||
| 84 | 8 | _reject_symlink_components($destination); | |||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | 7 | ▶ | if ( -d $resolved ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 87 | die "ERROR: copying directories requires recursive => 1\n" | ||||||||||||||||||||||||||||
| 88 | 6 | ▶ | if !$options{recursive}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | 5 | ▶ | die sprintf "ERROR: destination is not a directory: %s\n", $destination | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
-e $destination and not -d $destination
MC/DC0%0/2
-e $destination and not -d $destination
-e $destination
not -d $destination
Truth table66%2/3
A and not(B)
A= -e $destinationB= not -d $destination
| |||||||||||||||||||||||||||||
| 91 | if -e $destination && !-d $destination; | ||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | 5 | my $dest_abs = File::Spec->rel2abs($destination); | |||||||||||||||||||||||||||
| 94 | 5 | my $dest_existing = abs_path($destination); | |||||||||||||||||||||||||||
| 95 | 5 | ▶ | if ( defined $dest_existing ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 96 | 5 | $dest_abs = $dest_existing; | |||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | 5 | ▶ | die sprintf "ERROR: destination is inside source directory: %s\n", $destination | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$dest_abs eq $resolved or index($dest_abs, $resolved . '/') == 0
MC/DC50%1/2
$dest_abs eq $resolved or index($dest_abs, $resolved . '/') == 0
$dest_abs eq $resolved
index($dest_abs, $resolved . '/') == 0
Truth table66%2/3
A or B
A= $dest_abs eq $resolvedB= index($dest_abs, $resolved . '/') == 0
| |||||||||||||||||||||||||||||
| 100 | if $dest_abs eq $resolved || index( $dest_abs, $resolved . q{/} ) == 0; | ||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||
| 102 | 4 | ▶ | make_path($destination) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 103 | if !-d $destination; | ||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | 4 | _copy_directory_contents( $resolved, $destination ); | |||||||||||||||||||||||||||
| 106 | 3 | return 1; | |||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | 1 | ▶ | die sprintf "ERROR: source is not a regular file: %s\n", $source | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 110 | if !-f $resolved; | ||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | 1 | ▶ | if ( -d $destination ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 113 | 0 | $destination = File::Spec->catfile( $destination, basename($source) ); | |||||||||||||||||||||||||||
| 114 | } | ||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||
| 116 | 1 | ▶ | die sprintf "ERROR: destination directory does not exist: %s\n", dirname($destination) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 117 | if !-d dirname($destination); | ||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | 1 | ▶ | die sprintf "ERROR: unable to copy %s => %s: %s\n", $resolved, $destination, $OS_ERROR | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 120 | if !File::Copy::copy( $resolved, $destination ); | ||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||
| 122 | 1 | return 1; | |||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||
| 125 | ######################################################################## | ||||||||||||||||||||||||||||
| 126 | 1 | ▶ | sub list { | ||||||||||||||||||||||||||
|
Subroutine
list: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 127 | ######################################################################## | ||||||||||||||||||||||||||||
| 128 | 1 | my ($self) = @_; | |||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||
| 130 | 1 | my @files; | |||||||||||||||||||||||||||
| 131 | 1 | _collect_entries( $self->dir, q{}, \@files ); | |||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||
| 133 | 1 | return @files; | |||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||
| 136 | ######################################################################## | ||||||||||||||||||||||||||||
| 137 | 2 | ▶ | sub _collect_entries { | ||||||||||||||||||||||||||
|
Subroutine
_collect_entries: called CC=7 SCAR=19.5
| |||||||||||||||||||||||||||||
| 138 | ######################################################################## | ||||||||||||||||||||||||||||
| 139 | 2 | my ( $root, $prefix, $result ) = @_; | |||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||
| 141 | 2 | ▶ | opendir my $dh, $root | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 142 | or die sprintf "ERROR: cannot open directory %s: %s\n", $root, $OS_ERROR; | ||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||
| 144 | 2 | ▶ | my @entries = sort grep { $_ ne q{.} && $_ ne q{..} } readdir $dh; | ||||||||||||||||||||||||||
|
Condition100%3/3
$_ ne '.' && $_ ne '..'
MC/DC100%2/2
$_ ne '.' && $_ ne '..'
$_ ne '.'
$_ ne '..'
Truth table100%3/3
A && B
A= $_ ne '.'B= $_ ne '..'
| |||||||||||||||||||||||||||||
| 145 | 2 | closedir $dh; | |||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||
| 147 | 2 | foreach my $entry (@entries) { | |||||||||||||||||||||||||||
| 148 | 3 | ▶ | my $relative = length $prefix ? File::Spec->catfile( $prefix, $entry ) : $entry; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 149 | 3 | my $full = File::Spec->catfile( $root, $entry ); | |||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||
| 151 | 3 | push @{$result}, $relative; | |||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||
| 153 | 3 | ▶ | if ( -d $full && !-l $full ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
-d $full and not -l $full
MC/DC50%1/2
-d $full and not -l $full
-d $full
not -l $full
Truth table66%2/3
A and not(B)
A= -d $fullB= not -l $full
| |||||||||||||||||||||||||||||
| 154 | 1 | _collect_entries( $full, $relative, $result ); | |||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||
| 158 | 2 | return; | |||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||
| 161 | ######################################################################## | ||||||||||||||||||||||||||||
| 162 | 28 | ▶ | sub _reject_symlink_components { | ||||||||||||||||||||||||||
|
Subroutine
_reject_symlink_components: called CC=6 SCAR=17.9
| |||||||||||||||||||||||||||||
| 163 | ######################################################################## | ||||||||||||||||||||||||||||
| 164 | 28 | my ($path) = @_; | |||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||
| 166 | # Preserve explicit .. components while inspecting the actual path walked | ||||||||||||||||||||||||||||
| 167 | # by the filesystem. rel2abs() would normalize them prematurely. | ||||||||||||||||||||||||||||
| 168 | 28 | ▶ | my $absolute | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 169 | = File::Spec->file_name_is_absolute($path) | ||||||||||||||||||||||||||||
| 170 | ? $path | ||||||||||||||||||||||||||||
| 171 | : File::Spec->catfile( getcwd(), $path ); | ||||||||||||||||||||||||||||
| 172 | 28 | my $current = File::Spec->rootdir; | |||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||
| 174 | 28 | foreach my $part ( File::Spec->splitdir($absolute) ) { | |||||||||||||||||||||||||||
| 175 | 139 | ▶ | next if !length $part || $part eq q{.}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not length $part or $part eq "."
MC/DC100%2/2
not length $part or $part eq "."
not length $part
$part eq "."
Truth table100%3/3
not(A) or B
A= not length $partB= $part eq "."
| |||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||
| 177 | 106 | $current = File::Spec->catdir( $current, $part ); | |||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||
| 179 | 106 | ▶ | die sprintf "ERROR: symbolic links are not supported: %s\n", $current | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 180 | if -l $current; | ||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||
| 183 | 26 | return; | |||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||
| 186 | ######################################################################## | ||||||||||||||||||||||||||||
| 187 | 7 | ▶ | sub _copy_directory_contents { | ||||||||||||||||||||||||||
|
Subroutine
_copy_directory_contents: called CC=11 SCAR=24.6
| |||||||||||||||||||||||||||||
| 188 | ######################################################################## | ||||||||||||||||||||||||||||
| 189 | 7 | my ( $source, $destination ) = @_; | |||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||
| 191 | 7 | ▶ | opendir my $dh, $source | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 192 | or die sprintf "ERROR: cannot open directory %s: %s\n", $source, $OS_ERROR; | ||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||
| 194 | 7 | ▶ | my @entries = grep { $_ ne q{.} && $_ ne q{..} } readdir $dh; | ||||||||||||||||||||||||||
|
Condition100%3/3
$_ ne '.' && $_ ne '..'
MC/DC100%2/2
$_ ne '.' && $_ ne '..'
$_ ne '.'
$_ ne '..'
Truth table100%3/3
A && B
A= $_ ne '.'B= $_ ne '..'
| |||||||||||||||||||||||||||||
| 195 | 7 | closedir $dh; | |||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||
| 197 | 7 | foreach my $entry (@entries) { | |||||||||||||||||||||||||||
| 198 | 11 | my $from = File::Spec->catfile( $source, $entry ); | |||||||||||||||||||||||||||
| 199 | 11 | my $to = File::Spec->catfile( $destination, $entry ); | |||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||
| 201 | 11 | _reject_symlink_components($to); | |||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||
| 203 | 11 | ▶ | die sprintf "ERROR: symbolic links are not supported: %s\n", $from | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 204 | if -l $from; | ||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||
| 206 | 10 | ▶ | if ( -d $from ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 207 | 3 | ▶ | die sprintf "ERROR: destination is not a directory: %s\n", $to | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
-e $to and not -d $to
MC/DC0%0/2
-e $to and not -d $to
-e $to
not -d $to
Truth table33%1/3
A and not(B)
A= -e $toB= not -d $to
| |||||||||||||||||||||||||||||
| 208 | if -e $to && !-d $to; | ||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||
| 210 | 3 | ▶ | make_path($to) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 211 | if !-d $to; | ||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||
| 213 | 3 | _copy_directory_contents( $from, $to ); | |||||||||||||||||||||||||||
| 214 | 3 | next; | |||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||
| 217 | 7 | ▶ | die sprintf "ERROR: unsupported resource type: %s\n", $from | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 218 | if !-f $from; | ||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||
| 220 | 7 | ▶ | die sprintf "ERROR: unable to copy %s => %s: %s\n", $from, $to, $OS_ERROR | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 221 | if !File::Copy::copy( $from, $to ); | ||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||
| 224 | 6 | return; | |||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||
| 227 | 2 | 1; | |||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||
| 229 | __END__ | ||||||||||||||||||||||||||||