assorted_debian_utils

Module version

Source
Expand description

§Version handling

This module handles versions of Debian packages.

use assorted_debian_utils::version::PackageVersion;

let ver1 = PackageVersion::new(None, "1.0", Some("2")).expect("Failed to construct version");
assert_eq!(ver1.to_string(), "1.0-2");
assert!(!ver1.has_epoch());
assert!(!ver1.is_native());

let ver2 = PackageVersion::new(Some(1), "0.2", Some("1.1")).expect("Failed to construct version");
assert_eq!(ver2.to_string(), "1:0.2-1.1");
assert!(ver2.has_epoch());
assert!(!ver2.is_native());

assert!(ver1 < ver2);
assert_eq!(ver1, PackageVersion::new(Some(0), "1.0", Some("2")).expect("Failed to construct version"));

Re-exports§

pub use crate::ParseError;

Structs§

PackageVersion
A version number of a Debian package

Enums§

VersionError
Version errors