1Pinto::Repository(3)  User Contributed Perl Documentation Pinto::Repository(3)
2
3
4

NAME

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

VERSION

9       version 0.14
10

ATTRIBUTES

12   root
13   config
14   db
15   store
16   locator
17   locker

METHODS

19   locate( target => );
20   lock( $LOCK_TYPE )
21   unlock
22   get_stack()
23   get_stack( $stack_name )
24   get_stack( $stack_object )
25       Returns the Pinto::Schema::Result::Stack object with the given
26       $stack_name.  If the argument is a Pinto::Schema::Result::Stack, then
27       it just returns that.  If there is no stack with such a name in the
28       repository, throws an exception.  If you do not specify a stack name
29       (or it is undefined) then you'll get whatever stack is currently marked
30       as the default stack.
31
32       The stack object will not be open for revision, so you will not be able
33       to change any of the registrations for that stack.  To get a stack that
34       you can modify, use "open_stack".
35
36   get_stack_maybe()
37   get_stack_maybe( $stack_name )
38   get_stack_maybe( $stack_object )
39       Same as "get_stack" but simply returns undef if the stack does not
40       exist rather than throwing an exception.
41
42   get_default_stack()
43       Returns the Pinto::Schema::Result::Stack that is currently marked as
44       the default stack in this repository.  This is what you get when you
45       call "get_stack" without any arguments.
46
47       The stack object will not be open for revision, so you will not be able
48       to change any of the registrations for that stack.  To get a stack that
49       you can modify, use "open_stack".
50
51       At any time, there must be exactly one default stack.  This method will
52       throw an exception if it discovers that condition is not true.
53
54   get_all_stacks()
55       Returns a list of all the Pinto::Schema::Result::Stack objects in the
56       repository.  You can sort them as strings (by name) or numerically (by
57       last modification time).
58
59   get_revision($commit)
60   get_revision_maybe($commit)
61   get_package( target => $pkg_spec )
62       Returns a <Pinto:Schema::Result::Package> representing the latest
63       version of the package in the repository with the same name as the
64       package target and the same or higher version as the package  spec.
65       See Pinto::Target::Package for the definition of a package target.
66
67   get_package( name => $pkg_name )
68       Returns a <Pinto:Schema::Result::Package> representing the latest
69       version of the package in the repository with the given $pkg_name.   If
70       there is no such package with that name in the repository,  returns
71       nothing.
72
73   get_package( name => $pkg_name, path => $dist_path )
74       Returns the <Pinto:Schema::Result::Package> with the given $pkg_name
75       that belongs to the distribution identified by  $dist_path. If there is
76       no such package in the repository,  returns nothing.
77
78       TODO: Consider making this a "maybe" function and the wrapping it with
79       a version that throws exceptions if no match is found. See
80       "get_stack_maybe()" for an example.
81
82   get_distribution( target => $target )
83       Given a Pinto::Target::Package, returns the
84       Pinto::Schema::Result::Distribution that contains the latest version of
85       the package in this repository with the same  name as the target and
86       the same or higher version as the target.  Returns nothing  if no such
87       distribution is found.
88
89       Given a Pinto::Target::Distribution, returns the
90       Pinto::Schema::Result::Distribution from this repository with the same
91       author id and archive attributes as the target.   Returns nothing if no
92       such distribution is found.
93
94   get_distribution( path => $dist_path )
95       Given a distribution path, (for example "AUTHOR/Dist-1.0.tar.gz" or
96       "A/AU/AUTHOR/Dist-1.0.tar.gz" returns the
97       Pinto::Schema::Result::Distribution from this repository that is
98       identified by the author ID and archive file name in the path.  Returns
99       nothing if no such distribution is found.
100
101   get_distribution( author => $author, archive => $archive )
102       Given an author id and a distribution archive file basename, returns
103       the Pinto::Schema::Result::Distribution from this repository with those
104       attributes.  Returns nothing if no such distribution exists.
105
106       TODO: Consider making this a "maybe" function and the wrapping it with
107       a version that throws exceptions if no match is found. See
108       "get_stack_maybe()" for an example.
109
110   ups_distribution( target => target )
111       Given a Pinto::Target::Package, locates the distribution that contains
112       the latest version of the package across all upstream repositories with
113       the same name as  the target, and the same or higher version as the
114       target.  If such distribution is found, it is fetched and added to this
115       repository.  If it is not found, then an exception is thrown.
116
117       Given a Pinto::Target::Distribution, locates the first distribution in
118       any upstream repository with the same author and archive as the target.
119       If such distribution is found, it is fetched and added to this
120       repository.  If it  is not found, then an exception is thrown.
121
122       TODO: Consider making this a "maybe" function and the wrapping it with
123       a version that throws exceptions if no match is found. See
124       "get_stack_maybe()" for an example.
125
126   add( archive => $path, author => $id )
127   add( archive => $path, author => $id, source => $uri )
128       Adds the distribution archive located on the local filesystem at $path
129       to the repository in the author directory for the author with $id.  The
130       packages provided by the distribution will be indexed, and the
131       prerequisites will be recorded.  If the "source" is specified, it must
132       be the URI to the root of the repository where the distribution came
133       from.  Otherwise, the "source" defaults to "LOCAL".  Returns a
134       Pinto::Schema::Result::Distribution object representing the newly added
135       distribution.
136
137   fetch_distribution( uri => $uri )
138       Fetches a distribution archive from a remote URI and adds it to this
139       repository.  The packages provided by the distribution will be indexed,
140       and the prerequisites will be recorded.  Returns a
141       Pinto::Schema::Result::Distribution object representing the fetched
142       distribution.
143
144   clean_files()
145       Deletes all distribution archives that are on the filesystem but not in
146       the database.  This can happen when an Action fails or is aborted
147       prematurely.
148

AUTHOR

150       Jeffrey Ryan Thalhammer <jeff@stratopan.com>
151
153       This software is copyright (c) 2015 by Jeffrey Ryan Thalhammer.
154
155       This is free software; you can redistribute it and/or modify it under
156       the same terms as the Perl 5 programming language system itself.
157
158
159
160perl v5.28.1                      2017-08-06              Pinto::Repository(3)
Impressum