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

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=5eec3d31ff0ad5a22ced343969dda99b9e2af442

commit 5eec3d31ff0ad5a22ced343969dda99b9e2af442
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Sep 18 23:34:41 2018 +0200

    scripts: Track automatic packages using the new file attribute
    
    This should make it possible to ignore the warning w/o hardcoding any
    distribution specific package name pattern on the code.
---
 debian/changelog           |  3 +++
 man/deb-src-files.man      |  2 ++
 scripts/dpkg-genchanges.pl | 14 +++++++++-----
 scripts/dpkg-gencontrol.pl |  5 ++++-
 4 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 5b00463da..6e18c2587 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -95,6 +95,9 @@ dpkg (1.19.1) UNRELEASED; urgency=medium
     for cross-build paths.
   * Check that DPKG_MAINTSCRIPT_PACKAGE is defined in dpkg-maintscript-helper.
     Closes: #907772
+  * Switch dpkg-gencontrol and dpkg-genchanges to track automatically
+    generated artifacts by using the Auto-Built-Package field from the binary
+    package instead of hardcoding package name patterns (such as «-dbgsym$»).
   * Architecture support:
     - Add support for riscv64 CPU. Closes: #822914
       Thanks to Manuel A. Fernandez Montecelo <[email protected]>
diff --git a/man/deb-src-files.man b/man/deb-src-files.man
index cc8abda52..4908cea89 100644
--- a/man/deb-src-files.man
+++ b/man/deb-src-files.man
@@ -50,6 +50,8 @@ The allowed values are specific to each distribution archive.
 .I keyword=value\&...\&
 corresponds to an optional whitespace-delimited list of attributes for this
 entry.
+The only currently supported keyword is \fBautomatic\fP with value
+\fByes\fP, to mark automatically generated files.
 .
 .SH NOTES
 This file is not intended to be modified directly, please use one of
diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl
index 4f4b33608..13ab8a453 100755
--- a/scripts/dpkg-genchanges.pl
+++ b/scripts/dpkg-genchanges.pl
@@ -22,7 +22,7 @@
 use strict;
 use warnings;
 
-use List::Util qw(any none);
+use List::Util qw(any all none);
 use Encode;
 use POSIX qw(:errno_h :locale_h);
 
@@ -423,10 +423,14 @@ if ($changesdescription) {
 
 for my $p (keys %p2f) {
     if (not defined $control->get_pkg_by_name($p)) {
-        # XXX: Skip automatic debugging symbol packages. We should not be
-        # hardcoding packages names here, as this is distribution-specific.
-        # Instead we should use the Auto-Built-Package field.
-        next if $p =~ m/-dbgsym$/;
+        # Skip automatically generated packages (such as debugging symbol
+        # packages), by using the Auto-Built-Package field.
+        next if all {
+            my $file = $dist->get_file($_);
+
+            $file->{attrs}->{automatic} eq 'yes'
+        } @{$p2f{$p}};
+
         warning(g_('package %s listed in files list but not in control info'), 
$p);
         next;
     }
diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl
index 1c92e66dd..960043fa2 100755
--- a/scripts/dpkg-gencontrol.pl
+++ b/scripts/dpkg-gencontrol.pl
@@ -406,7 +406,10 @@ if ($stdout) {
         }
     }
 
-    $dist->add_file($forcefilename, $section, $priority);
+    my %fileattrs;
+    $fileattrs{automatic} = 'yes' if $fields->{'Auto-Built-Package'};
+
+    $dist->add_file($forcefilename, $section, $priority, %fileattrs);
     $dist->save("$fileslistfile.new");
 
     rename "$fileslistfile.new", $fileslistfile

-- 
Dpkg.Org's dpkg

Reply via email to