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

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

require Exporter;

our @ISA = qw(Exporter);
our @EXPORT_OK = qw();
our @EXPORT = ();

our $VERSION = 1.7;

sub label       { shift-&gt;Label(@_) }
sub compare     { shift-&gt;CmpVersion(@_) }
sub rel_compare { shift-&gt;CmpReleaseVer(@_) }
sub upstream    { shift-&gt;UpstreamVersion(@_) }

{
    my %DEB_RELATION = (
	'&lt;&lt;'	=&gt; AptPkg::Dep::Less,
	'&lt;='	=&gt; AptPkg::Dep::LessEq,
	'='	=&gt; AptPkg::Dep::Equals,
	'&gt;='	=&gt; AptPkg::Dep::GreaterEq,
	'&gt;&gt;'	=&gt; AptPkg::Dep::Greater,

	# deprecated
	'&lt;'	=&gt; AptPkg::Dep::LessEq,
	'&gt;'	=&gt; AptPkg::Dep::GreaterEq,
    );

    sub check_dep
    {
	my $self = shift;
	my ($pkg, $op_str, $dep) = @_;
	my $op = $DEB_RELATION{$op_str} || croak "invalid relation for check_dep `$op_str'";

	$self-&gt;CheckDep($pkg, $op, $dep);
    }
}

1;

__END__

=head1 NAME

AptPkg::Version - APT package versioning class

=head1 SYNOPSIS

use AptPkg::Version;

=head1 DESCRIPTION

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

=head2 AptPkg::Version

The AptPkg::Version package implements the B&lt;APT&gt; pkgVersioningSystem
class.

An instance of the AptPkg::Version class may be fetched using the
C&lt;versioning&gt; method from an AptPkg::System object.

The following methods are implemented:

=over 4

=item label

Return the description of the versioning system, for example:

    Standard .deb

for Debian systems.

=item compare(I&lt;A&gt;, I&lt;B&gt;)

Compare package version I&lt;A&gt; with I&lt;B&gt;, returning a negative value if
I&lt;A&gt; is an earlier version than I&lt;B&gt;, zero if the same or a positive
value if I&lt;A&gt; is later.

=item rel_compare(I&lt;A&gt;, I&lt;B&gt;)

Compare distribution release numbers.

=item check_dep(I&lt;PKG&gt;, I&lt;OP&gt;, I&lt;DEP&gt;)

Check that the package version I&lt;PKG&gt; satisfies the relation I&lt;OP&gt; to
the dependency version I&lt;DEP&gt;.

The relation I&lt;OP&gt; is specified in the Debian syntax regardless of the
versioning system:

    &lt;&lt;	strictly earlier
    &lt;=	earlier or equal
    =	exactly equal
    &gt;=	later or equal
    &gt;&gt;	strictly later

=item upstream(I&lt;VER&gt;)

Return the upstream component of the given version string.

=back

=head1 SEE ALSO

AptPkg::Config(3pm), AptPkg::System(3pm), AptPkg(3pm).

=head1 AUTHOR

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

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