App::reposdb - Manipulate repos.db
This document describes version 0.007 of App::reposdb (from Perl distribution App-reposdb), released on 2020-10-10.
See reposdb.
repos.db is a SQLite database that lists repository names along with some extra data. They have various uses, but my first use-case for this is to store last commit/status/pull time (updated via a post-commit git hook or gitwrap). This is useful to speed up like syncing of repositories in Git::Bunch that wants to find out which of the hundreds/thousand+ git repositories are "the most recently used" to prioritize these repositories first. Using information from repos.db is faster than having to git status or even stat() each repository.
repos.db
gitwrap
Git::Bunch
git status
Usage:
add_repo_tag(%args) -> [status, msg, payload, meta]
Add a tag to a repo (by default the current repo).
This function is not exported.
Arguments ('*' denotes required arguments):
repo => str
reposdb_path* => str
tags* => array[str]
Returns an enveloped result (an array).
First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (payload) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.
Return value: (any)
get_repo_metadata(%args) -> [status, msg, payload, meta]
Get metadata for a repo (by default the current repo).
list_repos(%args) -> [status, msg, payload, meta]
List repositories registered in repos.db.
detail => bool
has_tags => array[str]
lacks_tags => array[str]
sorts => array[str] (default: ["name"])
remove_all_repo_tags(%args) -> [status, msg, payload, meta]
Remove all tags from a repo (by default the current repo).
remove_repo_tag(%args) -> [status, msg, payload, meta]
Remove tag from a repo (by default the current repo).
touch_repo(%args) -> [status, msg, payload, meta]
Touch the timestamp(s) of a repo (by default current repo).
commit_time => bool
pull_time => bool
status_time => bool
to => date
Please visit the project's homepage at https://metacpan.org/release/App-reposdb.
Source repository is at https://github.com/perlancar/perl-App-reposdb.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-reposdb
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2020, 2017, 2016 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::reposdb, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::reposdb
CPAN shell
perl -MCPAN -e shell install App::reposdb
For more information on module installation, please visit the detailed CPAN module installation guide.