{"id":49902359,"url":"https://github.com/lu-zero/portage-atom-pubgrub","last_synced_at":"2026-05-23T21:01:48.551Z","repository":{"id":358144267,"uuid":"1240000381","full_name":"lu-zero/portage-atom-pubgrub","owner":"lu-zero","description":"Bridge between portage-atom and the PubGrub dependency solver","archived":false,"fork":false,"pushed_at":"2026-05-16T06:46:42.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-16T08:39:17.789Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lu-zero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-15T17:00:59.000Z","updated_at":"2026-05-16T06:42:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lu-zero/portage-atom-pubgrub","commit_stats":null,"previous_names":["lu-zero/portage-atom-pubgrub"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lu-zero/portage-atom-pubgrub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lu-zero%2Fportage-atom-pubgrub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lu-zero%2Fportage-atom-pubgrub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lu-zero%2Fportage-atom-pubgrub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lu-zero%2Fportage-atom-pubgrub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lu-zero","download_url":"https://codeload.github.com/lu-zero/portage-atom-pubgrub/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lu-zero%2Fportage-atom-pubgrub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33412082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T18:09:33.147Z","status":"ssl_error","status_checked_at":"2026-05-23T18:09:31.380Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-16T08:20:12.841Z","updated_at":"2026-05-23T21:01:48.510Z","avatar_url":"https://github.com/lu-zero.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# portage-atom-pubgrub\n\n[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE-MIT)\n[![Build Status](https://github.com/lu-zero/portage-atom-pubgrub/workflows/CI/badge.svg)](https://github.com/lu-zero/portage-atom-pubgrub/actions?query=workflow:CI)\n[![Crates.io](https://img.shields.io/crates/v/portage-atom-pubgrub.svg)](https://crates.io/crates/portage-atom-pubgrub)\n[![docs.rs](https://docs.rs/portage-atom-pubgrub/badge.svg)](https://docs.rs/portage-atom-pubgrub)\n\nA Rust library that bridges [portage-atom](https://crates.io/crates/portage-atom) types with the [PubGrub](https://pubgrub-rs.github.io/pubgrub/) dependency solver, implementing the [Package Manager Specification (PMS) 9](https://projects.gentoo.org/pms/9/pms.html).\n\n\u003e **Warning**: This codebase was largely AI-generated and has not been thoroughly\n\u003e audited. It may contain bugs, incomplete PMS coverage, or surprising edge-case\n\u003e behaviour. Use at your own risk and please report issues.\n\n## Overview\n\n`portage-atom-pubgrub` provides a `DependencyProvider` implementation for the\nPubGrub version solver that understands Gentoo Portage dependency semantics:\n\n- **`PortagePackage`** — a PubGrub `Package` backed by a `Cpn` + optional slot\n- **`PortageVersionSet`** — a PubGrub `VersionSet` mapping PMS operators (`\u003e=`,\n  `~`, `=*`, etc.) to `Ranges\u003cVersion\u003e`\n- **`PortageDependencyProvider`** — a PubGrub `DependencyProvider` over a\n  package repository, with support for:\n  - All five PMS dependency classes (DEPEND, RDEPEND, BDEPEND, PDEPEND, IDEPEND)\n  - OR groups, exactly-one-of, at-most-one-of modelled as virtual choice packages\n  - Slot and subslot operators (`:=`, `:*`)\n  - USE-conditional dependencies with hybrid evaluation (eager for user-decided,\n    virtual packages for solver-decided flags)\n  - USE-dep constraints (`[ssl]`, `[-debug]`, `[ssl?]`, `[ssl=]`)\n  - Repository constraints (`::gentoo`)\n  - Installed package tracking (favored / locked)\n  - Blocker detection and post-solve validation\n  - Dependency graph with labeled edges and topological install ordering\n  - Filtering of dependencies referencing packages absent from the repository\n\n## Installation\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\nportage-atom-pubgrub = \"0.1\"\n```\n\n## Usage\n\n```rust\nuse portage_atom_pubgrub::{\n    PackageRepository, PortageDependencyProvider, PortagePackage, PortageVersionSet, UseConfig,\n};\nuse portage_atom::{Cpn, Version};\nuse pubgrub::resolve;\n\n// Implement PackageRepository for your data source\nlet repo = MyRepository::new();\nlet use_config = UseConfig::new();\nlet mut provider = PortageDependencyProvider::new(repo, use_config);\n\n// Set up a root package with the target dependencies\nlet root = PortagePackage::unslotted(Cpn::parse(\"virtual/root\").unwrap());\nlet root_ver = Version::parse(\"1\").unwrap();\nprovider.add_root(root.clone(), root_ver.clone(), vec![\n    (target_package, target_version_set),\n]);\n\nlet solution = resolve(\u0026provider, root, root_ver);\n```\n\nSee `examples/resolve.rs` and `examples/resolve_conflicts.rs` for complete examples.\n\n## PMS Operators to Version Sets\n\n| PMS Operator | Version Set |\n|---|---|\n| `\u003e=V` | `Ranges::higher_than(V)` |\n| `\u003eV` | `Ranges::strictly_higher_than(V)` |\n| `\u003c=V` | `Ranges::lower_than(V)` |\n| `\u003cV` | `Ranges::strictly_lower_than(V)` |\n| `=V` | `Ranges::singleton(V)` |\n| `=V*` (glob) | `Ranges::between(V, next_after_glob(V))` |\n| `~V` (approximate) | `Ranges::between(V_norev, V_rev_bumped)` |\n\n## Post-Solve Validation\n\nThe provider exposes methods for checks that happen after resolution:\n\n- **`check_blockers()`** — validates that no installed packages conflict with\n  resolved blockers\n- **`check_use_deps()`** — validates USE-dep constraints against the solution\n- **`check_repo_constraints()`** — validates repository constraints\n- **`dependency_graph()`** — returns labeled edges with dependency class and\n  topological install order (PDEPEND edges deferred)\n\n## Related Projects\n\n- [portage-atom](https://crates.io/crates/portage-atom) — Portage package atom parser\n- [portage-atom-resolvo](https://crates.io/crates/portage-atom-resolvo) — Bridge to the resolvo SAT solver\n- [pubgrub](https://crates.io/crates/pubgrub) — PubGrub version solving algorithm\n- [PMS 9](https://projects.gentoo.org/pms/9/pms.html) — Package Manager Specification\n\n## License\n\n[MIT](LICENSE-MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flu-zero%2Fportage-atom-pubgrub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flu-zero%2Fportage-atom-pubgrub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flu-zero%2Fportage-atom-pubgrub/lists"}