1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#![warn(missing_docs)]

//! This crate contains helper functionality that's used by the `fedora-update-feedback` binary.
//! It's contents are probably not useful for external use. But if something turns out to be
//! generally useful, it can be upstreamed into either the [`fedora`][fedora-rs] or [`bodhi`][bodhi]
//! crates.
//!
//! [fedora-rs]: https://crates.io/crates/fedora
//! [bodhi-rs]: https://crates.io/crates/bodhi

use std::cmp::PartialEq;
use std::fmt::Display;

mod config;
pub use config::*;

mod ignore;
pub use ignore::*;

mod input;
pub use input::*;

mod output;
pub use output::*;

mod parse;
pub use parse::*;

mod query;
pub use query::*;

mod sysinfo;
pub use sysinfo::*;

/// This struct encapsulates a parsed NVR string.
#[derive(Debug, PartialEq)]
pub struct NVR {
    /// name of the package
    pub n: String,
    /// version of the package
    pub v: String,
    /// release of the package
    pub r: String,
}

impl Display for NVR {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        write!(f, "{}-{}-{}", self.n, self.v, self.r)
    }
}