| 1 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # (c) Jan Gehring <jan.gehring@gmail.com> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | # vim: set ts=2 sw=2 tw=0: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # vim: set expandtab: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | package Rex::Repositorio; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use Moose; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use English; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use common::sense; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use LWP::UserAgent; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | ▶ | use XML::LibXML; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 1 | ▶ | use XML::Simple; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 1 | ▶ | use Params::Validate qw(:all); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | ▶ | use IO::All; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | ▶ | use File::Path 'make_path'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use File::Basename qw'dirname'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use File::Spec; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | use File::Copy; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | ▶ | use Rex::Repositorio::Repository_Factory; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | ▶ | use JSON::XS; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 1 | ▶ | use Data::Dumper; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 1 | our $VERSION = '1.2.1'; # VERSION | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 1 | ▶ | if ( !$Rex::Repositorio::VERSION ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | $Rex::Repositorio::VERSION = "9999.99.99"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 1 | has config => ( is => 'ro' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 1 | has logger => ( is => 'ro' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | ▶ | sub ua { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
ua: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | my ( $self, %option ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | my $ua = LWP::UserAgent->new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | $ua->env_proxy; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | ▶ | if ( $self->config->{DownloadTimeout} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | $self->logger->debug( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | "Setting download timeout to: " . $self->config->{DownloadTimeout} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | $ua->timeout( $self->config->{DownloadTimeout} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | if ( exists $option{ssl_opts} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | for my $key ( keys %{ $option{ssl_opts} } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | $ua->ssl_opts( $key, $option{ssl_opts}->{$key} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | return $ua; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 0 | ▶ | sub run { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | my ( $self, %option ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | # this config checking/munging stuff should probably be in the 'has config' definition? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | $self->config->{RepositoryRoot} =~ s/\/$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | $self->logger->log_and_croak(level => 'error', message => qq/"all" is a reserved word and cannot be used as a repo name\n/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | ▶ | if grep { $_ eq 'all' } keys %{ $self->config->{Repository} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | ▶ | $self->config->{TagStyle} ||= 'TopDir'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$self->config->{"TagStyle"} ||= "TopDir"
MC/DC0%0/1
$self->config->{"TagStyle"} ||= "TopDir"
$self->config->{"TagStyle"}
Truth table0%0/2
A
A= $self->config->{"TagStyle"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | $self->logger->log_and_croak( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | level => 'error', message => sprintf "Unknown TagStyle %s, must be TopDir or BottomDir\n", $self->config->{TagStyle} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | unless $self->config->{TagStyle} =~ m/^(?:Top|Bottom)Dir$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | $self->parse_cli_option(%option); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | ▶ | sub parse_cli_option { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_cli_option: not called CC=31 SCAR=69.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | my ( $self, %option ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | ▶ | if ( exists $option{help} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | $self->_help(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | exit 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | ▶ | if ( exists $option{repo} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | $self->logger->log_and_croak(level => 'error', message => sprintf("Unknown repo: %s\n", $option{repo})) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | unless $option{repo} eq 'all' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | ▶ | or $self->config->{Repository}->{ $option{repo} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$option{"repo"} eq "all" or $self->config->{"Repository"}{$option{"repo"}}
MC/DC0%0/2
$option{"repo"} eq "all" or $self->config->{"Repository"}{$option{"repo"}}
$option{"repo"} eq "all"
$self->config->{"Repository"}{$option{"repo"}}
Truth table0%0/3
A or B
A= $option{"repo"} eq "all"B= $self->config->{"Repository"}{$option{"repo"}}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | ▶ | if ( exists $option{mirror} && exists $option{repo} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 9 branches
Condition0%0/3
exists $option{"mirror"} and exists $option{"repo"}
MC/DC0%0/2
exists $option{"mirror"} and exists $option{"repo"}
exists $option{"mirror"}
exists $option{"repo"}
Truth table0%0/3
A and B
A= exists $option{"mirror"}B= exists $option{"repo"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | $self->logger->info("Going to mirror $option{repo} This may take a while." ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | my $update_files = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | # so it is possible to only update metadata. (for example: for proxy support) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | ▶ | if ( exists $option{"no-update-files"} && $option{"no-update-files"} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $option{"no-update-files"} and $option{"no-update-files"}
MC/DC0%0/2
exists $option{"no-update-files"} and $option{"no-update-files"}
exists $option{"no-update-files"}
$option{"no-update-files"}
Truth table0%0/3
A and B
A= exists $option{"no-update-files"}B= $option{"no-update-files"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | $update_files = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | $self->mirror( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | repo => $option{repo}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | checksums => $option{'checksums'}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | update_metadata => ( $option{"update-metadata"} || 0 ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | update_files => $update_files, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | force => ( $option{"force-download"} || 0 ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/4
$option{'update-metadata'} || 0
$option{'force-download'} || 0
MC/DC0%0/1
$option{'update-metadata'} || 0
$option{'update-metadata'}
MC/DC0%0/1
$option{'force-download'} || 0
$option{'force-download'}
Truth table0%0/2
A
A= $option{'update-metadata'}
Truth table0%0/2
A
A= $option{'force-download'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | $self->logger->info("Finished downloading of files for $option{repo}"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | ▶ | elsif ( exists $option{tag} && exists $option{repo} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
exists $option{"tag"} and exists $option{"repo"}
MC/DC0%0/2
exists $option{"tag"} and exists $option{"repo"}
exists $option{"tag"}
exists $option{"repo"}
Truth table0%0/3
A and B
A= exists $option{"tag"}B= exists $option{"repo"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | $self->tag( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | tag => $option{tag}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | clonetag => $option{clonetag} || 'head', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | repo => $option{repo}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | ▶ | force => $option{force} || 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/4
$option{'clonetag'} || 'head'
$option{'force'} || 0
MC/DC0%0/1
$option{'clonetag'} || 'head'
$option{'clonetag'}
MC/DC0%0/1
$option{'force'} || 0
$option{'force'}
Truth table0%0/2
A
A= $option{'clonetag'}
Truth table0%0/2
A
A= $option{'force'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | ▶ | elsif ( exists $option{repo} && exists $option{"update-errata"} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
exists $option{"repo"} and exists $option{"update-errata"}
MC/DC0%0/2
exists $option{"repo"} and exists $option{"update-errata"}
exists $option{"repo"}
exists $option{"update-errata"}
Truth table0%0/3
A and B
A= exists $option{"repo"}B= exists $option{"update-errata"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | $self->update_errata( repo => $option{repo} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | ▶ | elsif ( exists $option{errata} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/12
exists $option{"errata"} and exists $option{"package"} and exists $option{"arch"} and exists $option{"repo"} and exists $option{"version"}
exists $option{"errata"} and exists $option{"package"} and exists $option{"arch"} and exists $option{"repo"}
exists $option{"errata"} and exists $option{"package"} and exists $option{"arch"}
exists $option{"errata"} and exists $option{"package"}
MC/DC0%0/5
exists $option{"errata"} and exists $option{"package"} and exists $option{"arch"} and exists $option{"repo"} and exists $option{"version"}
exists $option{"errata"}
exists $option{"package"}
exists $option{"arch"}
exists $option{"repo"}
exists $option{"version"}
Truth table0%0/6
A and B and C and D and E
A= exists $option{"errata"}B= exists $option{"package"}C= exists $option{"arch"}D= exists $option{"repo"}E= exists $option{"version"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | && exists $option{package} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | && exists $option{arch} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | && exists $option{repo} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | && exists $option{version} ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | $self->print_errata( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | package => $option{package}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | arch => $option{arch}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | version => $option{version}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | repo => $option{repo}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | ▶ | elsif ( exists $option{server} && exists $option{repo} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
exists $option{"server"} and exists $option{"repo"}
MC/DC0%0/2
exists $option{"server"} and exists $option{"repo"}
exists $option{"server"}
exists $option{"repo"}
Truth table0%0/3
A and B
A= exists $option{"server"}B= exists $option{"repo"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | $self->server( repo => $option{repo} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | elsif ( exists $option{list} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | $self->list(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | ▶ | elsif ( exists $option{init} && exists $option{repo} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
exists $option{"init"} and exists $option{"repo"}
MC/DC0%0/2
exists $option{"init"} and exists $option{"repo"}
exists $option{"init"}
exists $option{"repo"}
Truth table0%0/3
A and B
A= exists $option{"init"}B= exists $option{"repo"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | $self->init( repo => $option{repo} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | ▶ | elsif ( exists $option{"add-file"} && exists $option{repo} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
exists $option{"add-file"} and exists $option{"repo"}
MC/DC0%0/2
exists $option{"add-file"} and exists $option{"repo"}
exists $option{"add-file"}
exists $option{"repo"}
Truth table0%0/3
A and B
A= exists $option{"add-file"}B= exists $option{"repo"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | $self->add_file( file => $option{"add-file"}, repo => $option{repo} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | ▶ | elsif ( exists $option{"remove-file"} && exists $option{repo} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
exists $option{"remove-file"} and exists $option{"repo"}
MC/DC0%0/2
exists $option{"remove-file"} and exists $option{"repo"}
exists $option{"remove-file"}
exists $option{"repo"}
Truth table0%0/3
A and B
A= exists $option{"remove-file"}B= exists $option{"repo"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | $self->remove_file( file => $option{"remove-file"}, repo => $option{repo} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | $self->_help(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | exit 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | ▶ | sub server { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
server: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | my %option = validate( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | @_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | require Mojolicious::Commands; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | # pass config to mojo app | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | $ENV{'REPO_CONFIG'} = encode_json( $self->config ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 0 | $ENV{'REPO_NAME'} = $option{repo}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | $ENV{'MOJO_MAX_MESSAGE_SIZE'} = 1024 * 1024 * 1024 * 1024; # set max_message_size astronomically high / TODO: make it configurable | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | my $server_type = $self->config->{Repository}->{ $option{repo} }->{type}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | ▶ | if ( $server_type eq "Apt" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$server_type eq "Apt" or $server_type eq "OpenSuSE" or $server_type eq "Plain"
$server_type eq "Apt" or $server_type eq "OpenSuSE"
MC/DC0%0/3
$server_type eq "Apt" or $server_type eq "OpenSuSE" or $server_type eq "Plain"
$server_type eq "Apt"
$server_type eq "OpenSuSE"
$server_type eq "Plain"
Truth table0%0/4
A or B or C
A= $server_type eq "Apt"B= $server_type eq "OpenSuSE"C= $server_type eq "Plain"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | || $server_type eq "OpenSuSE" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | || $server_type eq "Plain" ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | $server_type = "Yum"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | Mojolicious::Commands->start_app("Rex::Repositorio::Server::$server_type"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | ▶ | sub add_file { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_file: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | my %option = validate( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | @_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | file => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | my $repo = $self->config->{Repository}->{ $option{repo} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | my $type = $repo->{type}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | my $repo_o = Rex::Repositorio::Repository_Factory->create( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | type => $type, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | options => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | app => $self, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | name => $option{repo}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | %{$repo}, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | $repo_o->add_file( file => $option{file} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | sub remove_file { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
remove_file: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | my %option = validate( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | @_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | file => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | my $repo = $self->config->{Repository}->{ $option{repo} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 0 | my $type = $repo->{type}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | my $repo_o = Rex::Repositorio::Repository_Factory->create( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | type => $type, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | options => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | app => $self, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | name => $option{repo}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | %{$repo}, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | $repo_o->remove_file( file => $option{file} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 0 | ▶ | sub list { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
list: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | my @repos = keys %{ $self->config->{Repository} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | $self->_print(@repos); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | ▶ | sub update_errata { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update_errata: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 0 | my %option = validate( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | @_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | my $repo = $self->config->{Repository}->{ $option{repo} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | my $type = $repo->{type}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | my $repo_o = Rex::Repositorio::Repository_Factory->create( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | type => $type, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | options => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | app => $self, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | name => $option{repo}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | %{$repo}, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | $repo_o->update_errata(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | ▶ | sub print_errata { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
print_errata: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 0 | my %option = validate( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | @_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | package => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | version => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | arch => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | my $repo = $self->config->{Repository}->{ $option{repo} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | 0 | my $type = $repo->{type}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | my $repo_o = Rex::Repositorio::Repository_Factory->create( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | type => $type, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | options => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | app => $self, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | name => $option{repo}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | %{$repo}, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | my $errata = $repo_o->get_errata( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | arch => $option{arch}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | package => $option{package}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | version => $option{version} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 0 | for my $pkg_version ( sort { $a cmp $b } keys %{$errata} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 0 | print "Name : $errata->{$pkg_version}->[0]->{advisory_name}\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | 0 | print "Version : $pkg_version\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 0 | print "Synopsis : $errata->{$pkg_version}->[0]->{synopsis}\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 0 | print "References : $errata->{$pkg_version}->[0]->{references}\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | 0 | print "Type : $errata->{$pkg_version}->[0]->{type}\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | 0 | print "\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | 0 | ▶ | sub init { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 0 | my %option = validate( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | @_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 0 | my $repo = $self->config->{Repository}->{ $option{repo} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | 0 | ▶ | if ( !$repo ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | 0 | $self->logger->error("Repository $option{repo} not found."); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 0 | confess "Repository $option{repo} not found."; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 0 | my $type = $repo->{type}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | my $repo_o = Rex::Repositorio::Repository_Factory->create( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | type => $type, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | options => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | app => $self, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | name => $option{repo}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | 0 | %{$repo}, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | $repo_o->verify_options; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | 0 | $repo_o->init; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | 0 | ▶ | sub mirror { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mirror: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 0 | my %option = validate( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | @_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | checksums => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | type => BOOLEAN, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | optional => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | update_metadata => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | type => BOOLEAN, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | optional => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | update_files => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | type => BOOLEAN, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | optional => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | force => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | type => BOOLEAN, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | optional => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | 0 | my @repositories = ( $option{repo} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | 0 | ▶ | if ( $option{repo} eq "all" ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | 0 | @repositories = keys %{ $self->config->{Repository} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | 0 | for my $repo (@repositories) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | 0 | my $type = $self->config->{Repository}->{$repo}->{type}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | my $repo_o = Rex::Repositorio::Repository_Factory->create( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | type => $type, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | options => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | app => $self, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | name => $repo, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | 0 | %{ $self->config->{Repository}->{$repo} }, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | $repo_o->mirror( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | checksums => $option{checksums}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | update_metadata => $option{update_metadata}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | update_files => $option{update_files}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | force => $option{force}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | 0 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | 0 | ▶ | sub tag { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
tag: not called CC=10 SCAR=47.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | 0 | my %option = validate( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | @_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | tag => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | clonetag => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | force => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | type => BOOLEAN | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | 0 | my $repo_config = $self->config->{Repository}->{ $option{repo} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | 0 | my $root_dir = $self->config->{RepositoryRoot}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | 0 | $repo_config->{local} =~ s/\/$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | # Why is this an array? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | 0 | my @dirs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | 0 | push @dirs, $self->get_repo_dir(repo => $option{repo}, tag => $option{clonetag}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | 0 | my $tag_dir = $self->get_repo_dir(repo => $option{repo}, tag => $option{tag}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | 0 | ▶ | $self->logger->log_and_croak(level => 'error', message => "Unknown tag $option{clonetag} on repo $option{repo} ($dirs[0])\n") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | unless ( -d $dirs[0] ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | 0 | ▶ | if ( -e $tag_dir ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | 0 | ▶ | if( $option{force} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | 0 | $self->logger->debug("Removing $tag_dir"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | 0 | rmtree $tag_dir; # should be remove_tree, but will use legacy to match mkdir | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | 0 | $self->logger->log_and_croak(level => 'error', message => "Tag $option{tag} on repo $option{repo} already exists (${tag_dir}), use --force\n"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | 0 | make_path($tag_dir); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | 0 | for my $dir (@dirs) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | 0 | ▶ | opendir my $dh, $dir | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | or $self->logger->log_and_croak(level => 'error', message => "Failed to open $dir: $!\nNew tag is probably unusable\n"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | 0 | ▶ | while ( my $entry = readdir $dh ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | 0 | ▶ | next if ( $entry eq '.' || $entry eq '..' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$entry eq "." or $entry eq ".."
MC/DC0%0/2
$entry eq "." or $entry eq ".."
$entry eq "."
$entry eq ".."
Truth table0%0/3
A or B
A= $entry eq "."B= $entry eq ".."
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | 0 | my $rel_entry = File::Spec->catfile($dir, $entry); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | 0 | $rel_entry =~ s{^$dirs[0]/}{}; # TODO use File::Spec? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | 0 | my $srcfile = File::Spec->catfile($dir,$entry); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | 0 | my $dstfile = File::Spec->catfile($tag_dir,$rel_entry); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | 0 | $self->logger->debug("Tag Src: $srcfile, Dst: $dstfile"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | 0 | ▶ | if ( -d $srcfile ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | 0 | push @dirs, $srcfile; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | 0 | $self->logger->debug("Creating directory: $dstfile"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | 0 | mkdir $dstfile; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | $self->logger->debug( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | 0 | "Linking (hard): $srcfile -> $dstfile"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | 0 | link $srcfile, $dstfile; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | 0 | closedir $dh; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | 0 | ▶ | sub get_errata_dir { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_errata_dir: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | 0 | my %option = validate( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | @_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | tag => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | 0 | ▶ | if ($self->config->{TagStyle} eq 'TopDir') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | return File::Spec->catdir( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | File::Spec->rel2abs( $self->config->{RepositoryRoot} ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | 0 | $option{tag}, $option{repo}, 'errata' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | elsif ($self->config->{TagStyle} eq 'BottomDir') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | return File::Spec->catdir( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | File::Spec->rel2abs( $self->config->{RepositoryRoot} ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | 0 | $option{repo}, $option{tag}, 'errata' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | # add other styles here | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | 0 | $self->logger->log_and_croak(level => 'error', message => 'Shouldnt have gotten here'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | 0 | ▶ | sub get_repo_dir { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_repo_dir: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | 0 | my %option = validate( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | @_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | repo => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | type => SCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | tag => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | type => SCALAR, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | default => 'head', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | 0 | my $repo_config = $self->config->{Repository}->{ $option{repo} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | 0 | ▶ | if ($self->config->{TagStyle} eq 'TopDir') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | 0 | return File::Spec->catdir($self->config->{RepositoryRoot}, $option{tag}, $repo_config->{local}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | elsif ($self->config->{TagStyle} eq 'BottomDir') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | 0 | return File::Spec->catdir($self->config->{RepositoryRoot}, $repo_config->{local}, $option{tag}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | 0 | $self->logger->log_and_croak(level => 'error', message => 'get_repo_dir: Unknown TagStyle: '.$self->config->{TagStyle}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | 0 | ▶ | sub _print { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_print: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | 0 | my @lines = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | 0 | print "repositorio: ${Rex::Repositorio::VERSION}\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | 0 | print "-" x 80; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | 0 | print "\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | 0 | print "$_\n" for @lines; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | 0 | ▶ | sub _help { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_help: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | 0 | $self->_print( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | "--mirror mirror a configured repository (needs --repo, use \"all\" for all repos)", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | "--tag=tagname tag a repository (needs --repo)", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | "--clonetag=tagname clones a tag in a repository (needs --repo and new --tag)", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | "--repo=reponame the name of the repository to use", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | "--update-metadata update the metadata of a repository", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | "--update-files download files even if they are already downloaded", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | "--force-download force the download of already downloaded files", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | "--checksums when mirroring verify local packages with checksums instead of size", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | "--no-update-files do not download packages", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | "--init initialize an empty repository", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | "--add-file=file add a file to a repository (needs --repo)", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | "--remove-file=file remove a file from a repository (needs --repo)", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | "--list list known repositories", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | "--server start a server for file delivery. (not available for all repository types)", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | "--update-errata updates the errata database for a repo (needs --repo)", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | "--errata query errata for a package (needs --repo, --package, --version, --arch)", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | " --package=pkg for which package the errata should be queries", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | " --version=ver for which version of a package the errata should be queries", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | " --arch=arch for which architecture of a package the errata should be queries", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | "--loglevel change the stdout log level (debug,info,notice,warning,error,critical)", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | "--help display this help message", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 584 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 585 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 586 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 587 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 588 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 589 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||