{"id":20092369,"url":"https://github.com/rubixdev/rpm-pkg-count","last_synced_at":"2025-03-02T15:53:04.878Z","repository":{"id":164865142,"uuid":"640289512","full_name":"RubixDev/rpm-pkg-count","owner":"RubixDev","description":"Counts installed RPM packages using librpm","archived":false,"fork":false,"pushed_at":"2023-05-15T13:34:35.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-09-19T21:31:37.648Z","etag":null,"topics":["fetch","librpm","rpm","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/rpm-pkg-count","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RubixDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-05-13T15:42:50.000Z","updated_at":"2023-05-14T15:40:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"0c16493f-c426-40d5-8d06-6dccd998d97a","html_url":"https://github.com/RubixDev/rpm-pkg-count","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubixDev%2Frpm-pkg-count","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubixDev%2Frpm-pkg-count/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubixDev%2Frpm-pkg-count/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubixDev%2Frpm-pkg-count/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubixDev","download_url":"https://codeload.github.com/RubixDev/rpm-pkg-count/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241533650,"owners_count":19977826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["fetch","librpm","rpm","rust"],"created_at":"2024-11-13T16:36:46.841Z","updated_at":"2025-03-02T15:53:04.849Z","avatar_url":"https://github.com/RubixDev.png","language":"Rust","readme":"# rpm-pkg-count\n\nCounts installed RPM packages using `librpm`.\n\n\u003e Note: This crate does **not** make use of `librpm-sys` but links to the C\n\u003e library itself.\n\n## Requirements\n\nIn order to compile this crate, one must have `librpm` installed on the system.\nIt is usually provided by package managers under the name `rpm-devel` (e.g.,\nOpenSUSE), `rpm-tools` (e.g., Arch Linux) or `librpm-dev` (e.g., Debian).\n\n## Usage\n\nThe crate provides two cargo features, exactly **one** of them must be enabled.\n\n1. `compile-time`: Link to librpm during compile-time using Rust's `extern \"C\"`\n   functionality. This requires librpm to be installed on every target's system\n   for a binary to run at all.\n2. `runtime`: Link to librpm during runtime using the\n   [`libloading` crate](https://crates.io/crates/libloading). This way,\n   `count()` simply returns `None` if librpm is not installed on the target\n   system.\n\nThe crate then exposes exactly _one_ public function which takes no arguments\nand returns the package count as an `Option\u003cu32\u003e`. An example usage is shown\nhere:\n\n```rs\nuse rpm_pkg_count::count;\n\nmatch unsafe { count() } {\n    Some(count) =\u003e println!(\"{count} packages installed.\"),\n    None =\u003e println!(\"packages could not be counted\"),\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubixdev%2Frpm-pkg-count","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubixdev%2Frpm-pkg-count","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubixdev%2Frpm-pkg-count/lists"}