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//! * [autoremovals]: Helpers to handle autoremovals
10//! * [buildinfo]: Helpers to handle `.buildinfo` files
11//! * [excuses]: Helpers to handle `excuses.yaml` for testing migration
12//! * [package]: Helpers to handle package names
13//! * [release]: Helpers to handle `Release` files
14//! * [version]: Helpers to handle package versions
15//! * [wb]: Helpers to generate commands for wanna-build
16
17#![warn(missing_docs)]
18#![warn(missing_debug_implementations)]
19#![warn(clippy::use_self)]
20
21use thiserror::Error;
22
23pub mod architectures;
24pub mod archive;
25pub mod autoremovals;
26pub mod buildinfo;
27pub mod excuses;
28pub mod package;
29pub mod release;
30mod utils;
31pub mod version;
32pub mod wb;
33
34// Re-export rfc822_like
35pub use rfc822_like;
36
37/// Parsing error
38#[derive(Clone, Copy, Debug, Error)]
39pub enum ParseError {
40 #[error("invalid architecture")]
41 /// Given string is not a valid architecture
42 InvalidArchitecture,
43 #[error("invalid version: {0}")]
44 /// Given string is not a valid version
45 InvalidVersion(#[from] version::VersionError),
46 #[error("invalid suite")]
47 /// Given string is not a valid suite
48 InvalidSuite,
49 #[error("invalid extension")]
50 /// Given string is not a valid suite or codename extension
51 InvalidExtension,
52 #[error("invalid codename")]
53 /// Given string is not a valid codename
54 InvalidCodename,
55 #[error("invalid suite or codename")]
56 /// Given string is not a valid suite or codename
57 InvalidSuiteOrCodename,
58 #[error("invalid multi-arch")]
59 /// Given string is not a valid multi-arch value
60 InvalidMultiArch,
61 #[error("invalid component")]
62 /// Given string is not a valid component
63 InvalidComponent,
64 #[error("invalid package: {0}")]
65 /// Given string is not a valid package
66 InvalidPackage(#[from] package::PackageError),
67}