Returns the Pinto::Schema::Result::Stack object with the given $stack_name.
If the argument is a Pinto::Schema::Result::Stack,
then it just returns that.
If there is no stack with such a name in the repository,
throws an exception.
If you do not specify a stack name (or it is undefined) then you'll get whatever stack is currently marked as the default stack.

The stack object will not be open for revision,
so you will not be able to change any of the registrations for that stack.
To get a stack that you can modify,
use open_stack.

Returns a Pinto:Schema::Result::Package representing the latest version of the package in the repository with the same name as the package target and the same or higher version as the package spec.
See Pinto::Target::Package for the definition of a package target.

Returns a Pinto:Schema::Result::Package representing the latest version of the package in the repository with the given $pkg_name.
If there is no such package with that name in the repository,
returns nothing.

Given a distribution path,
(for example AUTHOR/Dist-1.0.tar.gz or A/AU/AUTHOR/Dist-1.0.tar.gz returns the Pinto::Schema::Result::Distribution from this repository that is identified by the author ID and archive file name in the path.
Returns nothing if no such distribution is found.

Given a Pinto::Target::Package,
locates the distribution that contains the latest version of the package across all upstream repositories with the same name as the target,
and the same or higher version as the target.
If such distribution is found,
it is fetched and added to this repository.
If it is not found,
then an exception is thrown.

Given a Pinto::Target::Distribution,
locates the first distribution in any upstream repository with the same author and archive as the target.
If such distribution is found,
it is fetched and added to this repository.
If it is not found,
then an exception is thrown.

TODO: Consider making this a "maybe" function and the wrapping it with a version that throws exceptions if no match is found.
See get_stack_maybe() for an example.

Adds the distribution archive located on the local filesystem at $path to the repository in the author directory for the author with $id.
The packages provided by the distribution will be indexed,
and the prerequisites will be recorded.
If the source is specified,
it must be the URI to the root of the repository where the distribution came from.
Otherwise,
the source defaults to LOCAL.
Returns a Pinto::Schema::Result::Distribution object representing the newly added distribution.

Fetches a distribution archive from a remote URI and adds it to this repository.
The packages provided by the distribution will be indexed,
and the prerequisites will be recorded.
Returns a Pinto::Schema::Result::Distribution object representing the fetched distribution.