NAME
Bioconda::Packages::Updater - Maintainer tool: (re)build the JSON database from a bioconda-recipes clone.
SYNOPSIS
use Bioconda::Packages::Updater;
my $up = Bioconda::Packages::Updater->new(
repo => 'bioconda-recipes',
db => 'share/bioconda-packages.json',
verbose => 1,
);
$up->pull_repo; # optional: git pull --ff-only
my $report = $up->build; # parse recipes, merge, enrich, write
DESCRIPTION
This is developer-facing: end users only ever read the shipped database via Bioconda::Packages. The intended workflow is
1. pull the bioconda-recipes clone (pull_repo / git pull)
2. rebuild the database (build)
3. commit the regenerated JSON (git)
Removed-package handling: any package present in the previous database but no longer found in the repo is kept and flagged is_removed, with removed_at stamped once. A package that reappears is un-flagged.
Dependencies: core Perl only. HTTP::Tiny (core since 5.14) is used for the optional anaconda.org enrichment.
METHODS
new
my $up = Bioconda::Packages::Updater->new(%opts);
Options: repo (path to the bioconda-recipes clone, required for "build"), db (output JSON path; defaults to the located bundled db), api (enable anaconda.org enrichment), api_sleep (seconds between API calls, default 0), limit (process at most N recipes, for testing), force (bump the version and rewrite even when the content is unchanged), verbose, and log (a code ref called with log lines; defaults to printing to STDERR when verbose).
The version only advances, and the database file is only rewritten, when the semantic package content actually changed (see "build"). Volatile fields (timestamps, download counts) are excluded from that comparison.
pull_repo
my $sha = $up->pull_repo;
Runs git -C $repo pull --ff-only and returns the new HEAD sha. Dies if the repo is not a git checkout or the pull fails.
repo_commit
Returns the repo's current HEAD sha (or undef if unavailable).
build
my $report = $up->build;
Parses every recipe, merges with the existing database (preserving removed state), optionally enriches via anaconda.org, and writes the database atomically.
Returns a report hashref: added, updated, removed, reappeared, parse_warnings, api_ok, api_fail, total, db_path.