The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

P5U::Lib::DebianRelease - support library implementing p5u's debian-release command

SYNOPSIS

 use P5U::Lib::DebianRelease;
 use Path::Tiny qw(path);
 
 my $dr = P5U::Lib::DebianRelease->new(
   cache_file  => path("/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";
 }

DESCRIPTION

This is a support library for the debian-release command.

It's a Moo-based class.

Constructor

new(%attributes)

Creates a new instance of the class.

Attributes

cache_file

A Path::Tiny object 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!

Methods

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.

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.

Function

P5U::Lib::DebianRelease::dist2deb($dist)

Returns the expected Debian package name for a distribution. For example, given "Foo-Bar" will return "libfoo-bar-perl".

BUGS

Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=P5U.

SEE ALSO

p5u.

AUTHOR

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.

COPYRIGHT AND LICENCE

This software is copyright (c) 2012-2013 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.

DISCLAIMER OF WARRANTIES

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.