Pinto:...ository(3pm)

✨ NAME ✨

Pinto::Repository β€” coordinates the database, files, and indexes πŸ—‚οΈπŸ’–

Okay so real talk, this page comes straight outta the User Contributed Perl Documentation, and Pinto::Repository is the main character of your whole Pinto setup. She's the one holding the db, the files and the indexes together so nobody's out here texting into the void. Periodt. πŸ‘‘


πŸŽ€ VERSION πŸŽ€

version 0.14 β€” she's on 0.14 and thriving, no cap ✨


🌸 ATTRIBUTES 🌸

The little squad that makes the whole repo run. The original just lists them, so here they are, exactly as they come:

  • root
  • config
  • db
  • store
  • locator
  • locker

πŸ‘‘ METHODS πŸ‘‘

locate( target => );

locate( target => );

That's the whole thing, bestie. No description given. Moving on πŸ’…

lock( $LOCK_TYPE )

lock( $LOCK_TYPE )

unlock

unlock

get_stack()

get_stack()
get_stack( $stack_name )
get_stack( $stack_object )

Returns the Pinto::Schema::Result::Stack object with the given $stack_name. And if the argument is a Pinto::Schema::Result::Stack, then it just returns that, no drama. 🫢

If there is no stack with such a name in the repository, it throws an exception 😭. And if you don't specify a stack name at all (or it's undef), then you'll get whatever stack is currently marked as the default stack.

Heads up: the stack object will not be open for revision, so you will not be able to change any of the registrations for that stack. If you want a stack you can actually modify, use open_stack. πŸ’…

get_stack_maybe()

get_stack_maybe()
get_stack_maybe( $stack_name )
get_stack_maybe( $stack_object )

Same as get_stack but she's chill about it β€” simply returns undef if the stack does not exist rather than throwing an exception. No yelling, just vibes. 🌈

get_default_stack()

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

Again: 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. If she discovers that condition is not true, she throws an exception. Only one queen per repo, that's the rule πŸ‘‘πŸ˜­

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). Choose your fighter πŸ¦‹

get_revision($commit)

get_revision($commit)
get_revision_maybe($commit)

get_package( target => $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 target and the same or higher version as the package spec. See Pinto::Target::Package for the definition of a package target. πŸ“¦

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.

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

get_distribution( target => $target )

Given a Pinto::Target::Package, returns the Pinto::Schema::Result::Distribution that contains the latest version of the package in this repository with the same name as the target and the same or higher version as the target. Returns nothing if no such distribution is found. πŸ“

Given a Pinto::Target::Distribution, returns the Pinto::Schema::Result::Distribution from this repository with the same author id and archive attributes as the target. 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. πŸ’œ

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

ups_distribution( target => target )

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.

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

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

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

fetch_distribution( uri => $uri )

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

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>

This software is copyright (c) 2015 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.


And that's the whole page, bestie β€” brought to you by perl v5.40.1, dated 2025-04-21, from the Pinto:...ository(3pm) manual. Slay, stay hydrated, and go sort those stacks by last modification time πŸ’…πŸ’–

πŸ“¦ where this page comes from