debian: fix deb822 writer/parser asymmetries

write_paragraph emitted a bare-space continuation line for empty lines
inside a value, which parse_paragraphs treated as a paragraph separator
and silently dropped the rest of the value; blank lines are now encoded
as ' .' like dpkg does and decoded back on read. Tab-indented
continuation lines now strip exactly one tab instead of keeping it.

Clearsigned .dsc content no longer leaks armor metadata into parsed
fields: the Hash:/Comment: header and the signature trailer are
stripped before parse_paragraphs at both .dsc parse sites.
This commit is contained in:
2026-09-16 03:42:30 +02:00
parent dc6a019a13
commit 38562abe2c
4 changed files with 151 additions and 14 deletions
+6 -4
View File
@@ -376,10 +376,12 @@ pub fn run_source_build(
// order the .dsc itself lists them.
let dsc_content = std::fs::read_to_string(&ref_dsc_path)
.map_err(|e| format!("cannot read '{}': {}", ref_dsc_path.display(), e))?;
let dsc_para = parse_paragraphs(&dsc_content)
.into_iter()
.next()
.ok_or_else(|| format!("'{}' is empty", ref_dsc_path.display()))?;
let dsc_para = parse_paragraphs(crate::debian::control::strip_clearsigned_armour(
&dsc_content,
))
.into_iter()
.next()
.ok_or_else(|| format!("'{}' is empty", ref_dsc_path.display()))?;
let mut tarball_paths = Vec::new();
let mut dsc_file_names: Vec<String> = Vec::new();