summaryrefslogtreecommitdiffstats
path: root/urpm/xml_info_pkg.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm/xml_info_pkg.pm')
-rw-r--r--urpm/xml_info_pkg.pm59
1 files changed, 54 insertions, 5 deletions
diff --git a/urpm/xml_info_pkg.pm b/urpm/xml_info_pkg.pm
index d75bd2ce..889bfabd 100644
--- a/urpm/xml_info_pkg.pm
+++ b/urpm/xml_info_pkg.pm
@@ -12,9 +12,12 @@ urpm::xml_info_pkg - XML Package data retrieving related routines for urpmi
=over
-=cut
+=item new($class, $hash, $pkg)
-# proxy object: returns the xml info if available, otherwise redirects to URPM::Package
+Returns a proxy object
+It enable to get the XML info if available, otherwise redirects to URPM::Package
+
+=cut
sub new {
my ($class, $hash, $pkg) = @_;
@@ -25,7 +28,23 @@ sub new {
}
-# only available in synthesis/hdlist
+=item id($pkg)
+
+=item group($pkg)
+
+=item size($pkg)
+
+=item epoch($pkg)
+
+=item buildhost($pkg)
+
+=item packager($pkg)
+
+=item summary($pkg)
+
+Only available in synthesis/hdlist
+=cut
+
sub id { $_[0]{pkg}->id }
sub group { $_[0]{pkg}->group }
sub size { $_[0]{pkg}->size }
@@ -35,7 +54,22 @@ sub packager { $_[0]{pkg}->packager }
sub summary { $_[0]{pkg}->summary }
-# can be directly available in xml_info
+=item url($pkg)
+
+=item license($pkg)
+
+=item sourcerpm($pkg)
+
+=item description($pkg)
+
+=item changelogs($pkg)
+
+=item files($pkg)
+
+Can be directly available in xml_info
+
+=cut
+
sub url { exists $_[0]{url} ? $_[0]{url} : $_[0]{pkg}->url }
sub license { exists $_[0]{license} ? $_[0]{license} : $_[0]{pkg}->license }
sub sourcerpm { exists $_[0]{sourcerpm} ? $_[0]{sourcerpm} : $_[0]{pkg}->sourcerpm }
@@ -47,7 +81,22 @@ sub files { exists $_[0]{files} ? split("\n", $_[0]{files}) : $_[0]{pkg}->files
my $fullname_re = qr/^(.*)-([^\-]*)-([^\-]*)\.([^\.\-]*)$/;
-# available in both {pkg} and {fn}
+=item name($pkg)
+
+=item version($pkg)
+
+=item release($pkg)
+
+=item arch($pkg)
+
+=item fullname($pkg)
+
+=item filename($pkg)
+
+Available in both {pkg} and {fn}
+
+=cut
+
sub name { exists $_[0]{pkg} ? $_[0]{pkg}->name : $_[0]{fn} =~ $fullname_re && $1 }
sub version { exists $_[0]{pkg} ? $_[0]{pkg}->version : $_[0]{fn} =~ $fullname_re && $2 }
sub release { exists $_[0]{pkg} ? $_[0]{pkg}->release : $_[0]{fn} =~ $fullname_re && $3 }