| 1 | package Shipwright::Source::Shipyard; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Shipwright::Util; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use File::Spec::Functions qw/catdir/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use base qw/Shipwright::Source::Base/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | =head2 run | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | =cut | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 0 | ▶ | sub run { | ||||||||||||||||||||||||||
|
Subroutine
run: not called CC=11 SCAR=48.8
Pod
documented
| |||||||||||||||||||||||||||||
| 15 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 0 | $self->log->info( "preparing to run source: " . $self->source ); | |||||||||||||||||||||||||||
| 18 | 0 | my ( $base, $dist ) = $self->source =~ m{(.*)/([^/]+)}; | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 0 | my $source_shipwright = Shipwright->new( repository => $base ); | |||||||||||||||||||||||||||
| 21 | 0 | ▶ | $self->name($dist) unless $self->name; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | if ( $source_shipwright->backend->has_branch_support ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 24 | 0 | $source_shipwright->backend->export( | |||||||||||||||||||||||||||
| 25 | target => catdir( $self->directory, $self->name ), | ||||||||||||||||||||||||||||
| 26 | path => "/sources/$dist", | ||||||||||||||||||||||||||||
| 27 | ); | ||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | else { | ||||||||||||||||||||||||||||
| 30 | 0 | $source_shipwright->backend->export( | |||||||||||||||||||||||||||
| 31 | target => catdir( $self->directory, $self->name ), | ||||||||||||||||||||||||||||
| 32 | path => "/dists/$dist", | ||||||||||||||||||||||||||||
| 33 | ); | ||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 0 | $source_shipwright->backend->export( | |||||||||||||||||||||||||||
| 37 | target => catdir( $self->scripts_directory, $self->name ), | ||||||||||||||||||||||||||||
| 38 | path => "/scripts/$dist", | ||||||||||||||||||||||||||||
| 39 | ); | ||||||||||||||||||||||||||||
| 40 | 0 | my $source_version = $source_shipwright->backend->version->{$dist}; | |||||||||||||||||||||||||||
| 41 | 0 | my $source_branch; | |||||||||||||||||||||||||||
| 42 | 0 | ▶ | if ( $source_shipwright->backend->branches | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$source_shipwright->backend->branches and $source_shipwright->backend->branches->{$dist}
MC/DC0%0/2
$source_shipwright->backend->branches and $source_shipwright->backend->branches->{$dist}
$source_shipwright->backend->branches
$source_shipwright->backend->branches->{$dist}
Truth table0%0/3
A and B
A= $source_shipwright->backend->branchesB= $source_shipwright->backend->branches->{$dist}
| |||||||||||||||||||||||||||||
| 43 | && $source_shipwright->backend->branches->{$dist} ) | ||||||||||||||||||||||||||||
| 44 | { | ||||||||||||||||||||||||||||
| 45 | 0 | $source_branch = $source_shipwright->backend->branches->{$dist}; | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 0 | $self->_update_version( $self->name, $source_version ); | |||||||||||||||||||||||||||
| 49 | 0 | $self->_update_url( $self->name, 'shipyard:' . $self->source ); | |||||||||||||||||||||||||||
| 50 | 0 | ▶ | $self->_update_branches( $self->name, $source_branch ) if $source_branch; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | # follow | ||||||||||||||||||||||||||||
| 53 | 0 | ▶ | if ( $self->follow ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 54 | 0 | my $out = run_cmd( | |||||||||||||||||||||||||||
| 55 | $source_shipwright->backend->_cmd( | ||||||||||||||||||||||||||||
| 56 | 'cat', path => "/scripts/$dist/require.yml", | ||||||||||||||||||||||||||||
| 57 | ), | ||||||||||||||||||||||||||||
| 58 | 1 | ||||||||||||||||||||||||||||
| 59 | ); | ||||||||||||||||||||||||||||
| 60 | 0 | ▶ | my $require = load_yaml($out) || {}; | ||||||||||||||||||||||||||
|
Condition0%0/2
load_yaml($out) || {}
MC/DC0%0/1
load_yaml($out) || {}
load_yaml($out)
Truth table0%0/2
A
A= load_yaml($out)
| |||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 0 | for my $type ( keys %$require ) { | |||||||||||||||||||||||||||
| 63 | 0 | for my $req ( keys %{ $require->{$type} } ) { | |||||||||||||||||||||||||||
| 64 | 0 | ▶ | unless ( -e catdir( $self->directory, $req ) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 65 | 0 | my $s = Shipwright::Source->new( | |||||||||||||||||||||||||||
| 66 | %$self, | ||||||||||||||||||||||||||||
| 67 | source => "shipyard:$base/$req", | ||||||||||||||||||||||||||||
| 68 | name => $req | ||||||||||||||||||||||||||||
| 69 | ); | ||||||||||||||||||||||||||||
| 70 | 0 | $s->run; | |||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | 0 | return catdir( $self->directory, $self->name ); | |||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | 1 | 1; | |||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | __END__ | ||||||||||||||||||||||||||||