ActivePerl::PPM::Package - Package class
my $pkg = ActivePerl::PPM::Package->new(name => 'Foo',...); # or my $pkg = ActivePerl::PPM::Package->new(\%hash);
ActivePerl::PPM::Package class wraps hashes that describes packages; the unit that the PPM system manages.
The following constructor methods are provided:
The constructor either take key/value pairs or a hash reference as argument. The only mandatory field is
name. If a hash reference is passed then it is turned into an
ActivePerl::PPM::Package object and returned; which basically pass ownership of the hash.
Returns a copy of the current package object. The attributes of the clone can be modified without changing the original.
Read object from a database and return it. Returns
undef if no package with the given key is found.
Writes the current package to a database. If $pkg was constructed by
new_dbi then this updates the package, otherwise this creates a new package object in the database.
Returns the $id of the object stored if successful, otherwise
The attributes of a package can be accessed directly using hash syntax or by accesor methods. The most common attributes are described below, but the set of attributes is extensible.
Returns the database id of package. This attribute is set if the object exists in a database.
Returns the name of the package.
Returns the version identifier for the package. This string can be anything and there is no reliable way to order packages based on these version strings.
Returns the name and version concatenated together. This form might be handy for display, but there is no reliable way to parse back what is the name and what is the version identifier.
Returns the date the package was released on as an ISO 8601 date (YYYY-MM-DDThh:mm:ss). For CPAN packages this is the date the package was uploaded to CPAN.
The name and email address of the current maintainer of the package.
A short sentence describing the purpose of the package.
This is the URI for the PPD file itself.
This is the
ETag that the server reported for the PPD last time.
This is the
Last-Modified field that the server reported for the PPD last time.
Returns the URL to implementation; a blib tarball. Interpret this URL relative to ppd_uri.
Returns the absolute URL to the 'codebase'
Returns a list of (feature, version) pairs describing what features this package provide. A feature name with a double colon in it represent a perl module. A package always provide its own name as a feature.
Returns a list of (feature, version) pairs describing what features this package require to be installed for it to work properly. A feature name with a double colon in it represent a perl module.
The following functions/methods can be used to order packages.
Returns -1, 0, 1 like perl's builtin
undef if no order is defined.
Returns TRUE if this package is better than the package passed as argument. This method will croak if no order is defined.
Returns the best package. Might croak if no order is defined among the packages passed in.
This returns SQL
CREATE TABLE statements used to initialize the database that the
dbi_store methods depend on.
Returns TRUE if this package declare what features it provide. PPM4 style packages should declare what modules and other features they provide, but packages from older repositories might not.
Return TRUE if the package has the given $kind of script attached. The $kind argument should be either "install" or "uninstall".
Execute the given kind of script for the package. The $kind argument should be either "install" or "uninstall". The $kind and $area argument must be provided.