瀏覽代碼

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@debian.org>
Signed-off-by: Guillem Jover <guillem@debian.org>
Guillem Jover 9 年之前
父節點
當前提交
633756be05
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 3 0
      debian/changelog
  2. 3 1
      scripts/dpkg-genbuildinfo.pl

+ 3 - 0
debian/changelog

@@ -35,6 +35,9 @@ dpkg (1.18.19) UNRELEASED; urgency=medium
     Closes: #846164
     Closes: #846164
   * Fix check for expected number of binary artifacts in dpkg-genchanges, to
   * Fix check for expected number of binary artifacts in dpkg-genchanges, to
     only take into account the artifacts that we are distributing.
     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@debian.org>.
   * Portability:
   * Portability:
     - On GNU/Hurd try to use the new process executable name attribute from
     - On GNU/Hurd try to use the new process executable name attribute from
       libps, to properly match on start-stop-daemon --exec.
       libps, to properly match on start-stop-daemon --exec.

+ 3 - 1
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;
             my $depends = $1;
             foreach (split /,\s*/, $depends) {
             foreach (split /,\s*/, $depends) {
                 push @{$depends{"$package:$arch"}}, $_;
                 push @{$depends{"$package:$arch"}}, $_;