urpm/xml_info_pkg.pm

filter: Statementstmt 14.7% 5 / 34 Branchbran 0.0% 0 / 24 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 3.7% 1 / 27 Podpod 76.9% 20 / 26 totaltotal 19.8% 26 / 131 CC 17 SCAR 18.3
CC
17
Cov
7%
name
12.0
version
12.0
release
12.0
CRAP 6.3
« urpm/xml_info.pm ↑ Summary urpmi.pm »
1 package urpm::xml_info_pkg;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 =head1 NAME
6  
7 urpm::xml_info_pkg - XML Package data retrieving related routines for urpmi
8  
9 =head1 SYNOPSIS
10  
11 =head1 DESCRIPTION
12  
13 =over
14  
15 =item new($class, $hash, $pkg)
16  
17 Returns a proxy object
18 It enable to get the XML info if available, otherwise redirects to URPM::Package
19  
20 =cut
21  
22 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
23 0 my ($class, $hash, $pkg) = @_;
24  
25 0 ▶ $pkg and $hash->{pkg} = $pkg;
Branch: 1 branch
BranchTrueFalseTotal
$pkg and $hash->{"pkg"} = $pkg 0 0 0
26  
27 0 bless $hash, $class;
28 }
29  
30  
31 =item id($pkg)
32  
33 =item group($pkg)
34  
35 =item size($pkg)
36  
37 =item epoch($pkg)
38  
39 =item buildhost($pkg)
40  
41 =item packager($pkg)
42  
43 =item summary($pkg)
44  
45 Only available in synthesis/hdlist
46 =cut
47  
48 0 ▶sub id { $_[0]{pkg}->id }
Subroutine id: not called CC=1 SCAR=6.9
Pod documented
49 0 ▶sub group { $_[0]{pkg}->group }
Subroutine group: not called CC=1 SCAR=6.9
Pod documented
50 0 ▶sub size { $_[0]{pkg}->size }
Subroutine size: not called CC=1 SCAR=6.9
Pod documented
51 0 ▶sub epoch { $_[0]{pkg}->epoch }
Subroutine epoch: not called CC=1 SCAR=6.9
Pod documented
52 0 ▶sub buildhost { $_[0]{pkg}->buildhost }
Subroutine buildhost: not called CC=1 SCAR=6.9
Pod documented
53 0 ▶sub packager { $_[0]{pkg}->packager }
Subroutine packager: not called CC=1 SCAR=6.9
Pod documented
54 0 ▶sub summary { $_[0]{pkg}->summary }
Subroutine summary: not called CC=1 SCAR=6.9
Pod documented
55 0 ▶sub conflicts { $_[0]{pkg}->conflicts }
Subroutine conflicts: not called CC=1 SCAR=6.9
Pod undocumented
56 0 ▶sub obsoletes { $_[0]{pkg}->obsoletes }
Subroutine obsoletes: not called CC=1 SCAR=6.9
Pod undocumented
57 0 ▶sub provides { $_[0]{pkg}->provides }
Subroutine provides: not called CC=1 SCAR=6.9
Pod undocumented
58 0 ▶sub requires { $_[0]{pkg}->requires }
Subroutine requires: not called CC=1 SCAR=6.9
Pod undocumented
59 0 ▶sub suggests { $_[0]{pkg}->recommends_nosense }
Subroutine suggests: not called CC=1 SCAR=6.9
Pod undocumented
60 0 ▶sub recommends{ $_[0]{pkg}->recommends_nosense }
Subroutine recommends: not called CC=1 SCAR=6.9
Pod undocumented
61  
62  
63 =item url($pkg)
64  
65 =item license($pkg)
66  
67 =item sourcerpm($pkg)
68  
69 =item description($pkg)
70  
71 =item changelogs($pkg)
72  
73 =item files($pkg)
74  
75 Can be directly available in xml_info
76  
77 =cut
78  
79 0 ▶sub url { exists $_[0]{url} ? $_[0]{url} : $_[0]{pkg}->url }
Subroutine url: not called CC=2 SCAR=17.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]{'url'} ? : 0 0 0
80 0 ▶sub license { exists $_[0]{license} ? $_[0]{license} : $_[0]{pkg}->license }
Subroutine license: not called CC=2 SCAR=17.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]{'license'} ? : 0 0 0
81 0 ▶sub sourcerpm { exists $_[0]{sourcerpm} ? $_[0]{sourcerpm} : $_[0]{pkg}->sourcerpm }
Subroutine sourcerpm: not called CC=2 SCAR=17.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]{'sourcerpm'} ? : 0 0 0
82 0 ▶sub description { exists $_[0]{description} ? $_[0]{description} : $_[0]{pkg}->description }
Subroutine description: not called CC=2 SCAR=17.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]{'description'} ? : 0 0 0
83  
84 0 ▶sub changelogs { exists $_[0]{changelogs} ? @{$_[0]{changelogs}} : $_[0]{pkg}->changelogs }
Subroutine changelogs: not called CC=2 SCAR=17.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]{'changelogs'} ? : 0 0 0
85  
86 0 ▶sub files { exists $_[0]{files} ? split("\n", $_[0]{files}) : $_[0]{pkg}->files }
Subroutine files: not called CC=2 SCAR=17.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]{'files'} ? : 0 0 0
87  
88 1 my $fullname_re = qr/^(.*)-([^\-]*)-([^\-]*)\.([^\.\-]*)$/;
89  
90 =item name($pkg)
91  
92 =item version($pkg)
93  
94 =item release($pkg)
95  
96 =item arch($pkg)
97  
98 =item fullname($pkg)
99  
100 =item filename($pkg)
101  
102 Available in both {pkg} and {fn}
103  
104 =cut
105  
106 0 ▶sub name { exists $_[0]{pkg} ? $_[0]{pkg}->name : $_[0]{fn} =~ $fullname_re && $1 }
Subroutine name: not called CC=3 SCAR=24.8
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]{'pkg'} ? : 0 0 0
Condition0%0/3
$_[0]{"fn"} =~ /$fullname_re/ and $1
!ll&&!rl&&r
000
MC/DC0%0/2
$_[0]{"fn"} =~ /$fullname_re/ and $1
$_[0]{"fn"} =~ /$fullname_re/ $1
Truth table0%0/3
A and B
A= $_[0]{"fn"} =~ /$fullname_re/B= $1
ABresult
0X0
100
111
107 0 ▶sub version { exists $_[0]{pkg} ? $_[0]{pkg}->version : $_[0]{fn} =~ $fullname_re && $2 }
Subroutine version: not called CC=3 SCAR=24.8
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]{'pkg'} ? : 0 0 0
Condition0%0/3
$_[0]{"fn"} =~ /$fullname_re/ and $2
!ll&&!rl&&r
000
MC/DC0%0/2
$_[0]{"fn"} =~ /$fullname_re/ and $2
$_[0]{"fn"} =~ /$fullname_re/ $2
Truth table0%0/3
A and B
A= $_[0]{"fn"} =~ /$fullname_re/B= $2
ABresult
0X0
100
111
108 0 ▶sub release { exists $_[0]{pkg} ? $_[0]{pkg}->release : $_[0]{fn} =~ $fullname_re && $3 }
Subroutine release: not called CC=3 SCAR=24.8
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]{'pkg'} ? : 0 0 0
Condition0%0/3
$_[0]{"fn"} =~ /$fullname_re/ and $3
!ll&&!rl&&r
000
MC/DC0%0/2
$_[0]{"fn"} =~ /$fullname_re/ and $3
$_[0]{"fn"} =~ /$fullname_re/ $3
Truth table0%0/3
A and B
A= $_[0]{"fn"} =~ /$fullname_re/B= $3
ABresult
0X0
100
111
109 0 ▶sub arch { exists $_[0]{pkg} ? $_[0]{pkg}->arch : $_[0]{fn} =~ $fullname_re && $4 }
Subroutine arch: not called CC=3 SCAR=24.8
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]{'pkg'} ? : 0 0 0
Condition0%0/3
$_[0]{"fn"} =~ /$fullname_re/ and $4
!ll&&!rl&&r
000
MC/DC0%0/2
$_[0]{"fn"} =~ /$fullname_re/ and $4
$_[0]{"fn"} =~ /$fullname_re/ $4
Truth table0%0/3
A and B
A= $_[0]{"fn"} =~ /$fullname_re/B= $4
ABresult
0X0
100
111
110  
111 0 ▶sub fullname { wantarray() ? $_[0]{pkg}->fullname : $_[0]{fn} }
Subroutine fullname: not called CC=2 SCAR=17.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
112 0 ▶sub filename { $_[0]{fn} . '.rpm' }
Subroutine filename: not called CC=1 SCAR=6.9
Pod documented
113  
114  
115 1 1;
116  
117 =back
118  
119 =head1 COPYRIGHT
120  
121 Copyright (C) 2005 MandrakeSoft SA
122  
123 Copyright (C) 2005-2010 Mandriva SA
124  
125 Copyright (C) 2011-2020 Mageia
126  
127 =cut
« urpm/xml_info.pm ↑ Summary urpmi.pm »