Crate debian_changelog

Crate debian_changelog 

Source
Expand description

A lossless parser for Debian changelog files.

See https://manpages.debian.org/bookworm/dpkg-dev/deb-changelog.5.en.html

For its format specification, see Debian Policy.

Example:

use std::io::Read;
let contents = r#"rustc (1.70.0+dfsg1-1) unstable; urgency=medium

  * Upload to unstable

 -- Jelmer Vernooij <jelmer@debian.org>  Wed, 20 Sep 2023 20:18:40 +0200
"#;
let changelog: debian_changelog::ChangeLog = contents.parse().unwrap();
assert_eq!(
    vec![("rustc".to_string(), "1.70.0+dfsg1-1".parse().unwrap())],
    changelog.iter().map(
        |e| (e.package().unwrap(), e.version().unwrap()))
    .collect::<Vec<_>>());

Re-exports§

pub use crate::changes::changes_by_author;

Modules§

changes
Functions to parse the changes from a changelog entry.
textwrap
Text wrapping functions

Structs§

Change
Represents a logical change within a changelog entry.
ChangeLog
A node in the changelog syntax tree.
Entry
A node in the changelog syntax tree.
EntryBody
A node in the changelog syntax tree.
EntryFooter
A node in the changelog syntax tree.
EntryHeader
A node in the changelog syntax tree.
Identity
Simple representation of an identity.
Maintainer
A node in the changelog syntax tree.
MetadataEntry
A node in the changelog syntax tree.
MetadataKey
A node in the changelog syntax tree.
MetadataValue
A node in the changelog syntax tree.
Parse
The result of parsing: a syntax tree and a collection of errors.
ParseError
Error while parsing
Timestamp
A node in the changelog syntax tree.

Enums§

Error
Error while reading a changelog file.
SyntaxKind
Let’s start with defining all kinds of tokens and composite nodes.
Urgency
Urgency of the changes in the changelog entry

Constants§

UNRELEASED
Constant for the unreleased distribution name

Traits§

IntoTimestamp
Trait for types that can be converted to a timestamp string

Functions§

distribution_is_unreleased
Check if the given distribution marks an unreleased entry.
distributions_is_unreleased
Check if any of the given distributions marks an unreleased entry.
gbp_dch
Update changelog with commit messages from commits
get_maintainer
Get the maintainer information in the same manner as dch.
get_maintainer_from_env
Get the maintainer information from the environment.
is_unreleased_inaugural
Check whether this is a traditional inaugural release
iter_changes_by_author
Iterator over all changes across all entries, grouped by author.
iter_entries_by_author
Iterator over changelog entries grouped by author (maintainer).
parseaddr
Parse a identity string
release
Create a release for a changelog file.
take_uploadership
Take uploadership of a changelog entry, but attribute contributors.