Crate deb

Source
Expand description

🎉 You found the deb crate! 🎉

This crate is under active development, and "soft launched". Please do not post widely directing users to this crate yet -- the API shipped today is unstable, and will change -- fairly significantly -- without regard to following semver until it stabilizes.

You’re more than welcome to play with this and use it, but it’s not something I would encourage load bearing infrastructure to be written with as of right now.

§Introduction

The deb crate contains utilities for working with files and formats commonly found when working with Debian’s project tooling, or infrastructure.

Common use-cases are broken out into modules in the deb crate namespace, such as interacting with control files, parsing dependency relationships between Debian packages, parsing and ordering version numbers, or understanding Debian architecture strings.

Docs can be found on docs.rs, and information about the latest release can be found on crates.io.

§Feature Flags

There are a few feature flags. There’s no standard way to document the purpose and intent, so until that’s a thing, here’s a markdown table.

FlagDescription
fullEnable all optional features.
chronoEnable parsing dates using the chrono crate.
hexEnable parsing ASCII hex values using the hex crate
serdeEnable support for encoding and decoding using serde
sequoiaEnable support for validating OpenPGP signatures using sequoia_openpgp
tokioEnable support for the tokio crate.

§Feature chrono

Enable parsing dates from ASCII into a chrono::DateTime.

§Feature hex

Enable parsing hashes from ASCII into bytes using the hex crate. This is only really useful in places where you’re validating things like digests over files in control::package::Changes files, or similar.

§Feature serde

This exports two new modules for working with control files, control::de, and control::ser to read or write (respectively) control files in the Debian RFC2822-style format, as is our convention.

§Feature sequoia

Enable functions to verify Debian control files using the sequoia_openpgp OpenPGP implementation. This will export a few helpers throughout the crate, such as control::de::from_clearsigned_str.

§Feature tokio

Enable functions to handle places where there’s an i/o boundary that is handled by tokio::io rather than std::io.

Modules§

architecture
The arch module contains support for parsing Debian architecture strings.
build_profile
The build_profile module contains support for parsing Debian build profile strings.
control
The control module contains support for parsing Debian RFC 2822-style files into our conventional formats.
dependency
The dependency module contains support for parsing Debian dependency relationships.
release
The release module contains a best-effort basis copy of the Debian release history and metadata to help with processing Debian files.
version
The version module implements support for comparing Debian package Versions.