assorted_debian_utils/
lib.rs

1// Copyright 2021 Sebastian Ramacher
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4//! # Collection of various utilities for Debian work
5//!
6//! This crate consists of the following modules:
7//! * [architectures]: Helpers to handle Debian architectures
8//! * [archive]: Helpers for various features of the Debian archive
9//! * [buildinfo]: Helpers to handle `.buildinfo` files
10//! * [excuses]: Helpers to handle `excuses.yaml` for testing migration
11//! * [version]: Helpers to handle package versions
12//! * [wb]: Helpers to generate commands for wanna-build
13
14#![warn(missing_docs)]
15#![warn(missing_debug_implementations)]
16#![warn(clippy::use_self)]
17
18use thiserror::Error;
19
20pub mod architectures;
21pub mod archive;
22pub mod autoremovals;
23pub mod buildinfo;
24pub mod excuses;
25pub mod release;
26mod utils;
27pub mod version;
28pub mod wb;
29
30// Re-export rfc822_like
31pub use rfc822_like;
32
33/// Parsing error
34#[derive(Clone, Copy, Debug, Error)]
35pub enum ParseError {
36    #[error("invalid architecture")]
37    /// Given string is not a valid architecture
38    InvalidArchitecture,
39    #[error("invalid version: {0}")]
40    /// Given string is not a valid version
41    InvalidVersion(#[from] version::VersionError),
42    #[error("invalid suite")]
43    /// Given string is not a valid suite
44    InvalidSuite,
45    #[error("invalid extension")]
46    /// Given string is not a valid suite or codename extension
47    InvalidExtension,
48    #[error("invalid codename")]
49    /// Given string is not a valid codename
50    InvalidCodename,
51    #[error("invalid suite or codename")]
52    /// Given string is not a valid suite or codename
53    InvalidSuiteOrCodename,
54    #[error("invalid multi-arch")]
55    /// Given string is not a valid multi-arch value
56    InvalidMultiArch,
57    #[error("invalid component")]
58    /// Given string is not a valid component
59    InvalidComponent,
60}