This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=47429bd9d1546c4b8416ec9c3b38fd00fb6ca065

commit 47429bd9d1546c4b8416ec9c3b38fd00fb6ca065
Author: Guillem Jover <[email protected]>
AuthorDate: Wed Dec 3 01:41:13 2025 +0100

    dpkg-source: Add a new profile:v1 property in Package-List field
    
    The profile property has several problems. It uses the plus character
    which is valid in package names, which can then be parsed incorrectly.
    And the separator characters are non-obvious mappings.
    
    We cannot replace value format for this property as that would break
    any existing user. Instead we add a new version 1 for this property,
    and use a more obvious and package name safe set of characters.
    
    New characters suggested by Simon McVittie as the more obvious
    candidates to use.
    
    Ref: https://lists.debian.org/debian-devel/2025/11/msg00333.html
---
 man/dsc.pod            | 12 ++++++++++++
 scripts/dpkg-source.pl | 12 ++++++++++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/man/dsc.pod b/man/dsc.pod
index 2989a038e..535f591ea 100644
--- a/man/dsc.pod
+++ b/man/dsc.pod
@@ -243,6 +243,18 @@ with ANDs (whitespace inside enclosed angle brackets) 
converted to ‘,’,
 and ORs (whitespace between enclosing angle brackets) to ‘+’.
 All angle brackets get removed during normalization.
 
+Deprecated since dpkg 1.23.0, superseded by B<profile:v1>.
+
+=item B<profile:v1>
+
+The normalized build-profile restriction formula from the binary package
+B<Build-Profile> field,
+with ANDs (whitespace inside enclosed angle brackets) converted to ‘&’,
+and ORs (whitespace between enclosing angle brackets) to ‘|’.
+All angle brackets get removed during normalization.
+
+Supported since dpkg 1.23.0.
+
 =item B<protected>
 
 If the binary package is protected, this key will contain the value of the
diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl
index a2b2657ed..f3d2f8d3f 100755
--- a/scripts/dpkg-source.pl
+++ b/scripts/dpkg-source.pl
@@ -327,12 +327,20 @@ if ($options{opmode} =~ 
/^(build|print-format|(before|after)-build|commit)$/) {
             # Restriction formulas are in disjunctive formal form:
             #   (foo AND bar) OR (blub AND bla)
 
-            # Generate the version 0 property:
+            # Generate the _deprecated_ version 0 property:
             #   Join lists with a plus (OR).
             #   Join their elements with a comma (AND).
+            # TODO: Remove once no known users are around.
             $pkg_prop{profile} = join '+', map {
                 join ',', $_->@*
             } @restrictions;
+
+            # Generate the version 1 property:
+            #   Join lists with a pipe (OR).
+            #   Join their elements with an ampersand (AND).
+            $pkg_prop{'profile:v1'} = join '|', map {
+                join '&', $_->@*
+            } @restrictions;
         }
 
         # Handle optional boolean fields.
@@ -344,7 +352,7 @@ if ($options{opmode} =~ 
/^(build|print-format|(before|after)-build|commit)$/) {
 
         # Generate the package list properties.
         my $pkg_summary = join ' ', $p, @pkg_prop{qw(type section priority)};
-        foreach my $prop (qw(arch profile protected essential)) {
+        foreach my $prop (qw(arch profile profile:v1 protected essential)) {
             next unless exists $pkg_prop{$prop};
             $pkg_summary .= " $prop=$pkg_prop{$prop}";
         }

-- 
Dpkg.Org's dpkg

Reply via email to