pkgsrc-rs
A Rust interface to pkgsrc packages and the pkg_install pkgdb.
This is being developed alongside pm, a Rust implementation of a pkgsrc package manager. Anything that handles lower level pkg_install routines will be placed here.
Example
This is a simple implementation of pkg_info(8) that supports the default
output format, i.e. list all currently installed packages and their single-line
comment.
use ;
use Path;
Status
- pkg_match() is implemented and verified to be correct against a large input of matches.
- Metadata handles "+*" files contained in an archive and is able to verify that the archive contains a valid package.
- PkgDB handles local pkg databases, currently supporting the regular file-backed repository, but with flexible support for future sqlite3-backed repositories.
- Summary handles pkg_summary(5) parsing and generation.
License
This project is licensed under the ISC license.
Testing/compatibility notes
Generate list of dependency matches.
| |
Generate list of package names
Implement the following algorithm in both C and Rust and compare output
while ; do
while ; do
done
done
As an added bonus, the C version took 55 seconds to generate 158,916,879 matches, whilst the Rust version took 42 seconds.