arch-pkg-db
Pure Rust library to read Arch Linux's package database archives. "Pure Rust" means not needing libalpm.
Description
This is a collection of APIs that allow for loading a database of pacman packages and query them.
The database could be a local database of installed packages or a sync database of all installable packages.
The sync database may or may not contain non-official repositories, with duplicated package names.
Why not libalpm?
Relying on libalpm has 2 limitations:
- The program would only work on Arch Linux.
- Every time
libalpmupdates, the program would need to be recompiled. And since Arch Linux is rolling release,libalpmwould update frequently, forcing the program to recompile frequently.
This library aims to provide the means to query pacman packages without the above limitations.
Documentation
See docs.rs.
Quick Start
Querying installed packages
use ;
let texts = par_from_local_db.unwrap;
let db: EagerQueryDatabase = texts.par_parse.unwrap;
let pkg = db.get.unwrap;
println!;
println!;
println!;
Querying installable packages without caring about repository names
use read;
use ;
let texts = new
.add_archive
.unwrap
.add_archive
.unwrap
.add_archive
.unwrap;
let db: EagerQueryDatabase = texts.par_parse.unwrap;
let pkg = db.get.unwrap;
println!;
println!;
println!;
Querying installable packages and their repository names
use read;
use ;
let multi_texts = new
.add_archive
.unwrap
.add_archive
.unwrap
.add_archive
.unwrap
.add_archive
.unwrap
.add_archive
.unwrap
.add_archive
.unwrap;
let db: EagerMultiQueryDatabase = multi_texts.par_parse.unwrap;
let Some = db.get else ;
for in pkgs.entries
More examples
See the examples directory.