OpenNMS::Release::Package(3pm)

NAME
OpenNMS::Release::Package - Perl extension for manipulating packages

SYNOPSIS
  use OpenNMS::Release::Package;

  my $package = OpenNMS::Release::Package->new("path/to/foo");
  if ($package->is_in_repo("path/to")) {
    print "all good!"
  }

DESCRIPTION
This is just a perl module for manipulating packages, including version comparisons, path comparisons, and other miscellaneous things.

CONSTRUCTOR
OpenNMS::Release::Package->new($path, $name, $version, [$arch])

Given a path to a package file, name, OpenNMS::Release::Version, and optional architecture, create a new OpenNMS::Release::Package object.

The file must be absolute.

METHODS

  * name
The name of the package, i.e., "opennms".

  * version
The package version, as an OpenNMS::Release::Version object.

  * arch
The package arch, as an OpenNMS::Release::Version object.

  * compare_to($package)
Given a package, performs a cmp-style comparison on the packages' name and version, for use in sorting.

  * equals($package)
Given a package, returns true if both packages have the same name and version.

  * is_newer_than($package)
Given a package, returns true if the current package is newer than the given package, and they have the same name.

  * is_older_than($package)
Given a package, returns true if the current package is older than the given package, and they have the same name.

  * delete
Delete the package from the filesystem.

  * sign($id, $password)
Given a GPG id and password, sign (or resign) the package.

  * to_string
Returns a string representation of the package, suitable for printing.

AUTHOR
Benjamin Reed, <ranger@opennms.org> Matt Brozowski, <brozow@opennms.org>

COPYRIGHT AND LICENSE
Copyright (C) 2012 by The OpenNMS Group, Inc.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.