Debian Codegraph @

README.md

raw symbols SCIP
1 Rust parser for Debian DEP-3 patch headers
2 ------------------------------------------
3
4 # Examples
5
6 ```rust
7 use dep3::PatchHeader;
8 use std::str::FromStr;
9 let text = r#"From: John Doe <john.doe@example>
10 Date: Mon, 1 Jan 2000 00:00:00 +0000
11 Subject: [PATCH] fix a bug
12 Bug-Debian: https://bugs.debian.org/123456
13 Bug: https://bugzilla.example.com/bug.cgi?id=123456
14 Forwarded: not-needed
15 "#;
16
17 let patch_header = PatchHeader::from_str(text).unwrap();
18 assert_eq!(patch_header.description(), Some("[PATCH] fix a bug".to_string()));
19 assert_eq!(patch_header.vendor_bugs("Debian").collect::<Vec<_>>(), vec!["https://bugs.debian.org/123456".to_string()]);
20 ```
21
22 ## Features
23
24 * `lossless` (default): round-trip preserving parser built on `deb822-lossless`.
25 * `patchkit`: parse the unified diff body of a `debian/patches/*` file into
26 [`patchkit`](https://crates.io/crates/patchkit) structures alongside its DEP-3
27 header, via the `dep3::patchkit` module.
28
29 See <https://dep-team.pages.debian.net/deps/dep3/> for details