diff -Nru gobject-introspection-1.64.0/debian/changelog gobject-introspection-1.64.0/debian/changelog --- gobject-introspection-1.64.0/debian/changelog 2020-03-12 18:17:19.000000000 +0000 +++ gobject-introspection-1.64.0/debian/changelog 2020-03-28 19:17:49.000000000 +0000 @@ -1,3 +1,10 @@ +gobject-introspection (1.64.0-2) unstable; urgency=medium + + * debian/dh_girepository: Make the parsing of BD more robust. + Thanks to Simon McVittie (Closes: #933729) + + -- Laurent Bigonville Sat, 28 Mar 2020 20:17:49 +0100 + gobject-introspection (1.64.0-1) experimental; urgency=medium [ Simon McVittie ] diff -Nru gobject-introspection-1.64.0/debian/control gobject-introspection-1.64.0/debian/control --- gobject-introspection-1.64.0/debian/control 2020-03-12 18:17:19.000000000 +0000 +++ gobject-introspection-1.64.0/debian/control 2020-03-28 19:17:49.000000000 +0000 @@ -6,7 +6,7 @@ Section: devel Priority: optional Maintainer: Debian GNOME Maintainers -Uploaders: Iain Lane , Jeremy Bicha , Tim Lunn +Uploaders: Iain Lane , Jeremy Bicha , Laurent Bigonville , Tim Lunn Build-Depends: debhelper-compat (= 12), dh-sequence-gnome, dh-sequence-python3, @@ -105,6 +105,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}, + libdpkg-perl, libgirepository-1.0-1 (= ${binary:Version}), build-essential, python3-distutils, diff -Nru gobject-introspection-1.64.0/debian/control.in gobject-introspection-1.64.0/debian/control.in --- gobject-introspection-1.64.0/debian/control.in 2020-03-12 18:17:19.000000000 +0000 +++ gobject-introspection-1.64.0/debian/control.in 2020-03-28 19:17:49.000000000 +0000 @@ -101,6 +101,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}, + libdpkg-perl, libgirepository-1.0-1 (= ${binary:Version}), build-essential, python3-distutils, diff -Nru gobject-introspection-1.64.0/debian/dh_girepository gobject-introspection-1.64.0/debian/dh_girepository --- gobject-introspection-1.64.0/debian/dh_girepository 2020-03-12 18:17:19.000000000 +0000 +++ gobject-introspection-1.64.0/debian/dh_girepository 2020-03-28 19:17:49.000000000 +0000 @@ -8,6 +8,8 @@ use strict; use File::Find; +use Dpkg::Deps; +use Dpkg::Control; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS @@ -101,32 +103,15 @@ # Get Build-Depends in an array my @bdeps; -my $cur = 0; -open (my $control, "<", "debian/control") or error ("Cannot open debian/control"); -while (<$control>) { - chomp; - s/\s+$//; - if ($cur) { - if (/^\s+(.*)$/) { - push @bdeps, split ",",$1; - if ($1 !~ /,$/) { - $cur = 0; - } - } else { - $cur = 0; - } - } - if (/^Build-Depends:\s*(.*)$/) { - push @bdeps, split ",",$1; - if ($1 =~ /,$/) { - $cur = 1; - } else { - $cur = 0; - } + +my $ctrl = Dpkg::Control->new(type => CTRL_INFO_SRC); +$ctrl->load('debian/control'); +foreach my $field (qw(Build-Depends Build-Depends-Arch Build-Depends-Indep)) { + if (defined $ctrl->{$field}) { + my $value = deps_parse($ctrl->{$field}, build_dep => 1); + push @bdeps, split ', ', $value->output; } } -close $control; - # We can’t parse .typelib files, so we need the corresponding .gir # somewhere in the same source package (or with -l).