[lintian] 03/07: gir: -dev can Depend on a typelib that Provides the canonical name
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository lintian.
commit 619274079617873eb49d4f36b5fb28a8bcfbf1f0
Author: Simon McVittie <smcv@debian.org>
Date: Sat Nov 11 14:01:03 2017 +0000
gir: -dev can Depend on a typelib that Provides the canonical name
If gir1.2-foo-1.0 bundles typelibs for both Foo-1.0 and FooBar-1.0
(as seen in gir1.2-glib-2.0 and gir1.2-gtk-3.0), and the -dev package
containing the GIR XML for Foo-1.0 and FooBar-1.0 depends on
gir1.2-foo-1.0, then it is unnecessary to depend on gir1.2-foobar-1.0
as well.
Signed-off-by: Simon McVittie <smcv@debian.org>
---
checks/gir.desc | 21 +++++++++++++--------
checks/gir.pm | 12 +++++++++++-
2 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/checks/gir.desc b/checks/gir.desc
index b154d6a..2c5980a 100644
--- a/checks/gir.desc
+++ b/checks/gir.desc
@@ -32,14 +32,19 @@ Info: Development packages that contain GObject-Introspection XML files
(for example <tt>gir1.2-foo-23 (= ${binary:Version})</tt> when using
debhelper).
.
- Please ignore and override this tag if the typelib is shipped in a package
- whose name does not match the typelib's machine-readable name, and the
- development package correctly depends on that package instead. For example,
- <tt>gir1.2-glib-2.0</tt> is named for the <tt>GLib-2.0</tt> typelib, but
- also contains the <tt>GObject-2.0</tt> and <tt>Gio-2.0</tt> typelibs, so
- it is correct that <tt>libglib2.0-dev</tt> depends on
- <tt>gir1.2-glib-2.0</tt> but not on <tt>gir1.2-gobject-2.0</tt> or
- <tt>gir1.2-gio-2.0</tt>.
+ If multiple typelibs are shipped in the same package, then that package
+ should have versioned <tt>Provides</tt> for the names that would have been
+ used for separate packages. In this case, Lintian does not emit this tag
+ when a group of binary packages from the same source is checked together.
+ .
+ For example, <tt>libgtk-3-dev</tt> contains <tt>Gtk-3.0.gir</tt>,
+ <tt>Gdk-3.0.gir</tt> and <tt>GdkX11-3.0.gir</tt>.
+ <tt>gir1.2-gtk-3.0</tt> contains all three corresponding typelibs,
+ so it is sufficient for <tt>libgtk-3-dev</tt> to depend on
+ <tt>gir1.2-gtk-3.0</tt>. Giving <tt>gir1.2-gtk-3.0</tt> <tt>Provides</tt>
+ entries for <tt>gir1.2-gdk-3.0 (= ${binary:Version})</tt>
+ and <tt>gir1.2-gdkx11-3.0 (= ${binary:Version})</tt> signals this
+ situation to Lintian.
Ref: /usr/share/doc/gobject-introspection/policy.txt
Tag: typelib-package-name-does-not-match
diff --git a/checks/gir.pm b/checks/gir.pm
index 5001ea0..90d4ae1 100644
--- a/checks/gir.pm
+++ b/checks/gir.pm
@@ -109,10 +109,20 @@ sub _run_binary {
}
}
- foreach my $gir (@girs) {
+ GIR: foreach my $gir (@girs) {
my $expected = 'gir1.2-' . lc($gir->basename);
$expected =~ s/\.gir$//;
my $version = $info->field('version');
+
+ foreach my $bin ($group->get_binary_processables) {
+ next unless $bin->pkg_name =~ m/^gir1\.2-/;
+ my $other = $bin->pkg_name.' (= '.$bin->info->field('version').')';
+ if ( $bin->info->relation('provides')->implies($expected)
+ and $info->relation('strong')->implies($other)) {
+ next GIR;
+ }
+ }
+
if (not $info->relation('strong')->implies("$expected (= $version)")) {
tag('gir-missing-typelib-dependency', $gir, $expected);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: