#debian #patch #lossless

dep3

A library for parsing and generating DEP-3 headers

15 releases

0.2.4 Jun 15, 2026
0.2.1 Dec 2, 2025
0.2.0 Oct 31, 2025
0.1.28 Oct 7, 2024
0.1.1 Nov 28, 2023

#2692 in Parser implementations

Download history 488/week @ 2026-07-25 356/week @ 2026-08-01 631/week @ 2026-08-08 1200/week @ 2026-08-15 2706/week @ 2026-08-22 7699/week @ 2026-08-29 1662/week @ 2026-09-05 1234/week @ 2026-09-12 802/week @ 2026-09-19 2415/week @ 2026-09-26 5452/week @ 2026-10-03 2449/week @ 2026-10-10 7274/week @ 2026-10-17 4768/week @ 2026-10-24 7224/week @ 2026-10-31 10233/week @ 2026-11-07

30,059 downloads per month
Used in 12 crates (5 directly)

Apache-2.0

135KB
3K SLoC

Rust parser for Debian DEP-3 patch headers

Examples

use dep3::PatchHeader;
use std::str::FromStr;
let text = r#"From: John Doe <john.doe@example>
Date: Mon, 1 Jan 2000 00:00:00 +0000
Subject: [PATCH] fix a bug
Bug-Debian: https://bugs.debian.org/123456
Bug: https://bugzilla.example.com/bug.cgi?id=123456
Forwarded: not-needed
"#;

let patch_header = PatchHeader::from_str(text).unwrap();
assert_eq!(patch_header.description(), Some("[PATCH] fix a bug".to_string()));
assert_eq!(patch_header.vendor_bugs("Debian").collect::<Vec<_>>(), vec!["https://bugs.debian.org/123456".to_string()]);

Features

  • lossless (default): round-trip preserving parser built on deb822-lossless.
  • patchkit: parse the unified diff body of a debian/patches/* file into patchkit structures alongside its DEP-3 header, via the dep3::patchkit module.

See https://dep-team.pages.debian.net/deps/dep3/ for details

Dependencies

~4.5–6.5MB
~113K SLoC