mod ecosystem

module ecosystem

Dependency-spec helpers shared by the language-ecosystem parsers.

PyPI, CRAN and every ecosystem after them write a dependency the same way: a name, then an optional comparator and version. The grammars differ in what surrounds that pair (PEP 508 markers and extras, R’s parenthesised pins), and that part belongs in the ecosystem module. The split itself does not, and keeping one copy is what stops the two implementations drifting: the PyPI copy grew parenthesis handling it never needed while the CRAN copy, whose grammar is the one that uses parentheses, lost it.

Functions

fn parse_package_index(text: &str) -> std::collections::BTreeMap<String, IndexEntry>

Parse a repository index into package name to version.

The format is the one CRAN publishes as PACKAGES and Debian calls a control file: stanzas of Field: value separated by blank lines. It is the artifact a site already has offline, which is what an overlay needs when a dependency states no version of its own.

Structs and Unions

struct IndexEntry

One package as a repository index describes it.

version: String

Version the index publishes.

checksum: Option<String>

Checksum the index publishes, already tagged with its algorithm so it can go straight into an easyconfig (md5:...).