<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package AptPkg::Policy;

# $Id: Policy.pm,v 1.1 2007-06-17 12:09:00 bod Exp $

require 5.005_62;
use strict;
use warnings;
use AptPkg;

our $VERSION = qw$Revision: 1.1 $[1] || 0.1;

sub priority
{
    my ($self, $arg) = @_;
    my $xs = $$self;
    $xs-&gt;GetPriority($arg-&gt;_xs);
}

sub match
{
    my ($self, $pkg) = @_;
    my $xs = $$self;
    my $ver = $xs-&gt;GetMatch($pkg-&gt;_xs) or return;
    AptPkg::Cache::Version-&gt;new($ver);
}

sub candidate
{
    my ($self, $pkg) = @_;
    my $xs = $$self;
    my $ver = $xs-&gt;GetCandidateVer($pkg-&gt;_xs) or return;
    AptPkg::Cache::Version-&gt;new($ver);
}

1;

__END__

=head1 NAME

AptPkg::Policy - APT package version policy class

=head1 SYNOPSIS

use AptPkg::Policy;

=head1 DESCRIPTION

The AptPkg::Policy module provides an interface to B&lt;APT&gt;'s package
version policy.

=head2 AptPkg::Policy

The AptPkg::Policy package implements the B&lt;APT&gt; pkgPolicy class.

An instance of the AptPkg::Policy class may be fetched using the
C&lt;policy&gt; method from an AptPkg::Cache object.

The following methods are implemented:

=over 4

=item priority(I&lt;PKG&gt;|I&lt;FILE&gt;)

Return the pin priority for the given I&lt;PKG&gt; (AptPkg::Cache::Package)
or I&lt;FILE&gt; (AptPkg::Cache::PkgFile) object.

=item match(I&lt;PKG&gt;)

Find the pinned version of I&lt;PKG&gt;.  Returns an AptPkg::Cache::Version
object.

=item candidate(I&lt;PKG&gt;)

Returns the installation candidate version for I&lt;PKG&gt;.

=back

=head1 SEE ALSO

AptPkg::Cache(3pm), AptPkg(3pm).

=head1 AUTHOR

Brendan O'Dea &lt;bod@debian.org&gt;

=cut
</pre></body></html>