[dpkg] 139/200: dpkg-genbuildinfo: Fix parsing of Pre-Depends and Depends

Ximin Luo infinity0 at debian.org
Wed Apr 5 15:17:29 UTC 2017


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

infinity0 pushed a commit to branch master
in repository dpkg.

commit 633756be05d6dbd46f93f4211b44c2660dc8dc6c
Author: Guillem Jover <guillem at debian.org>
Date:   Fri Jan 27 05:23:27 2017 +0100

    dpkg-genbuildinfo: Fix parsing of Pre-Depends and Depends
    
    The loop is per package stanza, so we need to parse both fields
    separately.
    
    Based-on-patch-by: Johannes Schauer <josch at debian.org>
    Signed-off-by: Guillem Jover <guillem at debian.org>
---
 debian/changelog             | 3 +++
 scripts/dpkg-genbuildinfo.pl | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 1a3a512..cd673af 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -35,6 +35,9 @@ dpkg (1.18.19) UNRELEASED; urgency=medium
     Closes: #846164
   * Fix check for expected number of binary artifacts in dpkg-genchanges, to
     only take into account the artifacts that we are distributing.
+  * Fix parsing of Pre-Depends and Depends in dpkg-genbuildinfo, so that
+    the code parses both and not just the first to appear in the stanza.
+    Based on a patch by Johannes Schauer <josch at debian.org>.
   * Portability:
     - On GNU/Hurd try to use the new process executable name attribute from
       libps, to properly match on start-stop-daemon --exec.
diff --git a/scripts/dpkg-genbuildinfo.pl b/scripts/dpkg-genbuildinfo.pl
index 57f881e..03cf75c 100755
--- a/scripts/dpkg-genbuildinfo.pl
+++ b/scripts/dpkg-genbuildinfo.pl
@@ -118,7 +118,9 @@ sub parse_status {
             });
         }
 
-        if (/^(?:Pre-)?Depends: (.*)$/m) {
+        foreach my $deptype (qw(Pre-Depends Depends)) {
+            next unless /^$deptype: (.*)$/m;
+
             my $depends = $1;
             foreach (split /,\s*/, $depends) {
                 push @{$depends{"$package:$arch"}}, $_;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list