| 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
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 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
Condition0%0/3
$_[0]{"fn"} =~ /$fullname_re/ and $1
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
| |||||||||||||||||||||||||||||
| 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
Condition0%0/3
$_[0]{"fn"} =~ /$fullname_re/ and $2
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
| |||||||||||||||||||||||||||||
| 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
Condition0%0/3
$_[0]{"fn"} =~ /$fullname_re/ and $3
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
| |||||||||||||||||||||||||||||
| 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
Condition0%0/3
$_[0]{"fn"} =~ /$fullname_re/ and $4
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
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||