DPKG::Parse::Available - Parse the "available" file


DPKG-Parse documentation Contained in the DPKG-Parse distribution.

Index


Code Index:

NAME

Top

DPKG::Parse::Available - Parse the "available" file

SYNOPSIS

Top

    use DPKG::Parse::Available;

    my $available = DPKG::Parse::Available->new;
    while (my $entry = $available->next_package) { 
        print $entry->package . " " . $entry->version . "\n";
    }

    my $postfix = $available->get_package('name' => 'postfix');

DESCRIPTION

Top

DPKG::Parse::Available parses a dpkg "available" file and turns each entry into a DPKG::Parse::Entry object. By default, it uses the Debian default location of "/var/lib/dpkg/available".

See DPKG::Parse for more information on the get_package and next_package methods.

See DPKG::Parse::Entry for more information on the entry objects.

METHODS

Top

new('filename' => '/var/lib/dpkg/available')

Creates a new DPKG::Parse::Available object. By default, it tries to open /var/lib/dpkg/available.

SEE ALSO

Top

DPKG::Parse, DPKG::Parse::Entry

AUTHOR

Top

Adam Jacob, holoway@cpan.org

LICENSE

Top

This library is free software. You can redistribute it and/or modify it under the same terms as perl itself.


DPKG-Parse documentation Contained in the DPKG-Parse distribution.
#
# DPKG::Parse::Available.pm
# Created by: Adam Jacob, Marchex, <adam@marchex.com>
# Created on: 12/19/2005 02:21:25 PM PST
#
# $Id: $
#

package DPKG::Parse::Available;

use Params::Validate qw(:all);
use Class::C3;
use base qw(DPKG::Parse);
use strict;
use warnings;

sub new {
    my $pkg = shift;
    my %p = validate(@_,
        {
            'filename' => { 'type' => SCALAR, 'default' => '/var/lib/dpkg/available', 'optional' => 1 },
        }
    );
    my $ref = $pkg->next::method('filename' => $p{'filename'});
    return $ref;
}

1;

__END__