Pinto::Repository(3pm)

NAME
Pinto::Repository - Coordinates the database, files, and indexes

VERSION
version 0.097

ATTRIBUTES

  root

  config

  db

  store

  cache

  locker

METHODS

  locate( package => );

  locate( distribution => );

  lock( $LOCK_TYPE )

  unlock

  get_stack()

  get_stack( $stack_name )

  get_stack( $stack_object )

  get_stack( $stack_name_or_object, nocroak => 1 )
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 the "nocroak" option is true, than an exception will not be thrown and undef will be returned. 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".

  get_default_stack()
Returns the Pinto::Schema::Result::Stack that is currently marked as the default stack in this repository. This is what you get when you call "get_stack" without any arguments.

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".

At any time, there must be exactly one default stack. This method will throw an exception if it discovers that condition is not true.

  get_all_stacks()
Returns a list of all the Pinto::Schema::Result::Stack objects in the repository. You can sort them as strings (by name) or numerically (by last modification time).

  get_revision($commit)

  get_package( spec => $pkg_spec )
Returns a <Pinto:Schema::Result::Package> representing the latest version of the package in the repository with the same name as the package spec and the same or higher version as the package spec. See Pinto::PackageSpec for the definition of a package spec.

  get_package( name => $pkg_name )
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.

  get_package( name => $pkg_name, path => $dist_path )
Returns the <Pinto:Schema::Result::Package> with the given $pkg_name that belongs to the distribution identified by $dist_path. If there is no such package in the repository, returns nothing.

  get_distribution( spec => $pkg_spec )
Given a Pinto::PackageSpec, returns the Pinto::Schema::Result::Distribution that contains the latest version of the package in this repository with the same name as the spec and the same or higher version as the spec. Returns nothing if no such distribution is found.

  get_distribution( spec => $dist_spec )
Given a Pinto::DistributionSpec, returns the Pinto::Schema::Result::Distribution from this repository with the same author id and archive attributes as the spec. Returns nothing if no such distribution is found.

  get_distribution( path => $dist_path )
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.

  get_distribution( author => $author, archive => $archive )
Given an author id and a distribution archive file basename, returns the Pinto::Schema::Result::Distribution from this repository with those attributes. Returns nothing if no such distribution exists.

  ups_distribution( spec => $pkg_spec )
Given a Pinto::PackageSpec, locates the distribution that contains the latest version of the package across all upstream repositories with the same name as the spec, and the same or higher version as the spec. If such distribution is found, it is fetched and added to this repository. If it is not found, then an exception is thrown.

  ups_distribution( spec => $dist_spec )
Given a Pinto::DistributionSpec, locates the first distribution in any upstream repository with the same author and archive as the spec. If such distribution is found, it is fetched and added to this repository. If it is not found, then an exception is thrown.

  add( archive => $path, author => $id )

  add( archive => $path, author => $id, source => $url )
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 URL 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.

  fetch_distribution( url => $url )
Fetches a distribution archive from a remote URL 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.

  clean_files()
Deletes all distribution archives that are on the filesystem but not in the database. This can happen when an Action fails or is aborted prematurely.

AUTHOR
Jeffrey Ryan Thalhammer <jeff@stratopan.com>

COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Jeffrey Ryan Thalhammer.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.