P5U::Lib::DebianRelease - support library implementing p5u's debian-release command
use P5U::Lib::DebianRelease; use Path::Class qw(file dir); my $dr = P5U::Lib::DebianRelease->new( cache_file => file("/tmp/debian.data"), ); my $author_data = $dr->author_data('tobyink'); foreach my $dist (@$author_data) { print "Dist: $dist->[0]\n"; print "CPAN: $dist->[1]\n"; print "Debian: $dist->[2]\n\n"; }
This is a support library for the debian-release command.
It's a Moo-based class.
new(%attributes)
Creates a new instance of the class.
cache_file
A Path::Class::File representing the location we should download Debian release data to (and cache it). This is required, so provided it to the constructor.
debian
A hashref mapping Debian packages to versions. You presumably don't want to provide this data in the constructor. Let the module handle building it for you!
author_data($cpanid)
Get a list of the author's distributions which are included in Debian. This is an AoA (array of arrays) structure. The "outer" array is the list. Each "inner" array is three elements long; the first element being the distribution name; the second, the version number of the latest non-dev release on CPAN; and the third, the version number in Debian.
distribution_data($dist)
Returns a similar AoA to author_data, but selected by distribution name rather than author. The "outer" array will only ever contain one "inner" array, so is redundant, but included for consistency.
author_data
Unlike author_data, the third element will be the string "(none)" when the distribution does not appear in Debian.
format_report
Given an AoA structure as above, formats it into a single string for printing to a terminal or other output device using a fixed-width font.
author_report($cpanid)
author_data and format_report in a single method call.
distribution_report($dist)
distribution_data and format_report in a single method call.
distribution_data
P5U::Lib::DebianRelease::dist2deb($dist)
Returns the expected Debian package name for a distribution. For example, given "Foo-Bar" will return "libfoo-bar-perl".
Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=P5U.
p5u.
Toby Inkster <tobyink@cpan.org>.
This module is largely based on a script by Steven Haryanto, so any credit belongs to him. Any blame is almost certainly down to the changes I've made.
This software is copyright (c) 2012 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
To install P5U, copy and paste the appropriate command in to your terminal.
cpanm
cpanm P5U
CPAN shell
perl -MCPAN -e shell install P5U
For more information on module installation, please visit the detailed CPAN module installation guide.