Your message dated Wed, 22 Jan 2025 15:59:31 +0100
with message-id <z5eh0y5xl_c5m...@ni.fr.eu.org>
and subject line Bug#1085179 fixed in qa.debian.org
has caused the Debian Bug report #1085179,
regarding debcheck: Wrongly parse build profile restrictions with several terms
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
1085179: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1085179
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: qa.debian.org
Severity: normal
Tags: patch
User: qa.debian....@packages.debian.org
Usertags: debcheck

Hello,

While checking my newly uploaded nxt-python package, I found that
debcheck does not parse correctly build profile restrictions with
several terms.

Example of Build-Depends that fail to parse:

        python3-usb <!nocheck> <!nodoc>

The current code use ungreedy matching, but anchored to the end of the
string, so the result is actually greedy:

        /\s*(\<)\s*(.*?)\s*\>$/xp
                         ^^

And in the above example, it matches "!nocheck> <!nodoc".

See also: https://wiki.debian.org/BuildProfileSpec

Previous bug about this (partial fix):
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=816448

I have made a patch to fix this, you can find it as attachment, or on

https://git.ni.fr.eu.org/nicolas/debian/qa.git/ fix-build-profile

Regards,

Nicolas.
>From f6832d5570d7e0b9266ba2139cd629194d5fa77e Mon Sep 17 00:00:00 2001
From: Nicolas Schodet <n...@ni.fr.eu.org>
Date: Tue, 15 Oct 2024 21:51:25 +0200
Subject: [PATCH] Fix parsing of build profile constrains with several terms

Example of Build-Depends that failed to parse:

        python3-usb <!nocheck> <!nodoc>

The previous code use ungreedy matching, but anchored to the end of
the string, so the result is actually greedy:

        /\s*(\<)\s*(.*?)\s*\>$/xp
                     ^^

And in the above example, it matched "!nocheck> <!nodoc".

Fixed code explicitly excludes the delimiter.
---
 data/debcheck/debcheck | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/data/debcheck/debcheck b/data/debcheck/debcheck
index efe6b364..7bab4013 100755
--- a/data/debcheck/debcheck
+++ b/data/debcheck/debcheck
@@ -541,8 +541,8 @@ sub checkBuildDepends($$$) {
                                                my $depends_archs = undef;
 
                                                my $partdependencyclean = 
$partdependency;
-                                               while ($partdependencyclean =~ 
/\s*(\[)\s*(.*?)\s*\]$/xp
-                                                               or 
$partdependencyclean =~ /\s*(\<)\s*(.*?)\s*\>$/xp) {
+                                               while ($partdependencyclean =~ 
/\s*(\[)\s*([^]]*)\s*\]$/xp
+                                                               or 
$partdependencyclean =~ /\s*(\<)\s*([^>]*)\s*\>$/xp) {
                                                        my $item = $2;
                                                        $partdependencyclean = 
${^PREMATCH};
 
-- 
2.39.5


--- End Message ---
--- Begin Message ---
Hello,

Fix has been included in the qa repository, it can be seen here:

https://salsa.debian.org/qa/qa/-/commit/f6832d5570d7e0b9266ba2139cd629194d5fa77e

Nicolas.

Attachment: signature.asc
Description: PGP signature


--- End Message ---

Reply via email to