File Coverage

blib/lib/Arepa/Builder/Sbuildfake.pm
Criterion Covered Total %
statement 28 28 100.0
branch 2 2 100.0
condition n/a
subroutine 7 7 100.0
pod n/a
total 37 37 100.0


line stmt bran cond sub pod time code
1             package Arepa::Builder::Sbuildfake;
2              
3 1     1   20588 use strict;
  1         3  
  1         38  
4 1     1   6 use warnings;
  1         2  
  1         33  
5              
6 1     1   6 use base qw(Arepa::Builder::Sbuild);
  1         1  
  1         625  
7              
8 1     1   7 use File::Spec;
  1         1  
  1         17  
9 1     1   4 use File::Copy;
  1         2  
  1         39  
10 1     1   5 use File::Basename;
  1         1  
  1         203  
11              
12             sub _call_sbuild {
13 2     2   4 my ($self, $package_spec, $params, $output_dir) = @_;
14              
15 2         61 my $glob_pattern = File::Basename::basename($package_spec);
16 2         9 $glob_pattern =~ s/\.dsc//;
17              
18 2         13 my @compilation_results =
19             glob(File::Spec->catfile($self->config('results_from'),
20             "$glob_pattern*.deb"));
21 2         14 $self->{last_build_log} = "Checking for results for $glob_pattern in " .
22             $self->config('results_from') . ", found " .
23             (scalar @compilation_results) . " results\n";
24 2 100       8 if (@compilation_results) {
25 1         3 foreach my $file (@compilation_results) {
26 1         8 copy($file, $output_dir);
27             }
28 1         473 return 0;
29             }
30             else {
31 1         4 return 1;
32             }
33             }
34              
35             1;
36              
37             __END__