Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
633756be05
2 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  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
   * 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@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.

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