The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

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

VERSION

version 0.061

ATTRIBUTES

db

store

cache

locker

METHODS

locate( package => );

locate( distribution => );

lock( $LOCK_TYPE )

unlock

get_stack()

get_stack( name => $stack_name )

get_stack( name => $stack_name, nocroak => 1 )

Returns the Pinto::Schema::Result::Stack object with the given $stack_name. 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.

open_stack()

open_stack( name => $stack_name )

Returns the Pinto::Schema::Result::Stack object with the given $stack_name and sets the head revision of the stack to point to a newly created Pinto::Schema::Result::Revision. You can them proceed to modify the registrations or properties associated with the stack.

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. But if you do specify a name, then the stack must already exist or an exception will be thrown.

This method also starts a transaction. Calling commit or rollback on the stack will close the transaction. If the stack object goes out of scope before you call close the transaction, it will automatically rollback.

Use get_stack instead if you just want to read the registrations and properties.

get_package( name => $pkg_name )

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

get_package( name => $pkg_name, stack => $stk_name )

Returns the Pinto:Schema::Result::Package with the given $pkg_name that is on the stack with the given $stk_name. If there is no such package on that stack, returns nothing.

get_distribution( author => $author, archive => $archive )

get_distribution( spec => $dist_spec )

get_distribution( path => $dist_path )

get_distribution( sha256 => $sha256 )

Returns the Pinto::Schema::Result::Distribution with the given author ID and archive name. If given a Pinto::DistributionSpec object, it will get the author ID and archive name from it instead. If given a distribution path like those from an 02packages file, it parses the author ID and archive name from that instead. If there is no matching distribution in the respoistory, returns nothing.

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

pull( url => $url )

Pulls 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 newly pulled distribution.

create_stack(name => $stk_name)

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@imaginative-software.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Imaginative Software Systems.

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