Discussion:
Bug#1099170: dpkg-source: Source/Patch: fix parsing of patch header
Add Reply
Tj
2025-03-01 07:50:01 UTC
Reply
Permalink
Package: dpkg-dev
Version: 1.21.22
Severity: normal
File: /usr/bin/dpkg-source
Tags: patch
X-Debbugs-Cc: ***@proton.me

analyze() fails to correctly parse a patch header that has a line that
matches two of the three hunk detection regular expressions because it
treats them in isolation rather than as a linked, ordered, series.

josch in IRC's #debian-mentors reported this error:

dpkg-source: error: expected ^--- in line 7 of diff 'mesa-24.3.4.orig.JVu23i/debian/patches/mesa25/2079-radeonsi-fix-a-TCS-regression.patch'

The cause being the isolated "@@ -" in the patch header that was directly
taken from git-format-patch (here prefixed with "> " to avoid causing
From a0579f75fb5aa6926f4acfdee3fa91f2666df559 Mon Sep 17 00:00:00 2001
Date: Tue, 24 Dec 2024 15:00:39 -0500
Subject: [PATCH 2079/3849] radeonsi: fix a TCS regression
@@ -853,7 +853,7 @@ bool si_llvm_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32780>
---
src/gallium/drivers/radeonsi/si_shader_llvm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm.c b/src/gallium/drivers/radeonsi/si_shader_llvm.c
index 620953e817f..bd0309744de 100644
--- a/src/gallium/drivers/radeonsi/si_shader_llvm.c
+++ b/src/gallium/drivers/radeonsi/si_shader_llvm.c
@@ -840,12 +840,12 @@ bool si_llvm_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *
struct si_shader prev_shader = {};
My patch revises the parsing logic to treat the three hunk markers as ordered and
linked.
Tj
2025-03-02 09:00:01 UTC
Reply
Permalink
Package: dpkg-dev
Followup-For: Bug #1099170
X-Debbugs-Cc: ***@proton.me

Revised patch that fixes an issue where $patchheader incorrectly
included the hunk preamble.
Tj
2025-03-02 09:10:01 UTC
Reply
Permalink
Package: dpkg-dev
Followup-For: Bug #1099170
X-Debbugs-Cc: ***@proton.me

The (forgotten) revised patch!
Tj
2025-03-02 09:40:02 UTC
Reply
Permalink
Package: dpkg-dev
Followup-For: Bug #1099170
X-Debbugs-Cc: ***@proton.me

Apologies that the previous attached patch did NOT include the changes I
described. This one definitely does include dealing with partial hunk
preambles correctly.

Loading...