[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#590723: lintian: check for missing dependency on python-support



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

tags 592491 + tags
thanks

Hey

This is a possible implementation for the issue, a bit of bike-shedding
is appreciated.

~Niels

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJNPijqAAoJEAVLu599gGRCijsP+wSySN8QN4npy99AGt+0pkC7
N2gDQxMMN9QA+L7q72hHDwwHeE5raU2MyjnAji9H36Mn7t2P/3ZJjaELwQU7XgVF
pfdTvJZjbiqBnyb2wIda+TaunTlr4LlhrjoTaonjW8z3QQlJjqzbyJbyd3PO4SDo
a5FONmqscetdZ9hIqyzxTCyvaBtqbuQ+L1KCOSQYaA7pWD0359olg3f4SL0TA5DD
q8DHCq2NVRZGUFmoFtZqp0N8qKEnwenOKEUd+/l4dhDK7/I9f80ZzOcy7takwes+
4z7Q3fLvuxFUbxchaukCK/07L/Nv42NVMDyBJUiWxeNaZNtQd8usPN5Wz1/j4313
sG9WZFIwr2V2bJZeqvXN81aVQ7dFi/ImnHlzH2zF8u3RMD/zperypo+cnCJha6WM
0r0ZLd+lc1Q+UUzNSTeQn0fy0hx7K2RJ7WXjUrUaslfM+/2/cKws0THMPiHwzBVB
gNnqq/Ay1d+2+ruIxTaC5B6dPrvEJ+u3X9du+G8DYpicbeKqqg31kHySrlP+kfAa
PZdnPg9fht6Yt7gzlb3qZpsXvwVO8gwOkj216P8NxNoPcMGKme8mKJLg4uiiuWl7
N8QXBGQLY6h2bPpQ/0oRpLjdlTRR+zTipd63X2JwlUYbIylFfOWIBZr6h2cT4VW3
ciq8QNEoNAXWr4M6bihc
=1gld
-----END PGP SIGNATURE-----
>From e57fd7bdafc116700902967fe0a90167d2ebcb91 Mon Sep 17 00:00:00 2001
From: Niels Thykier <niels@thykier.net>
Date: Tue, 25 Jan 2011 02:00:10 +0100
Subject: [PATCH] Implementation of #592491

---
 checks/files      |   22 ++++++++++++++++++++++
 checks/files.desc |    9 +++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/checks/files b/checks/files
index 09aaa6b..c4ac09b 100644
--- a/checks/files
+++ b/checks/files
@@ -152,6 +152,8 @@ my @nonbinary_perl_files_in_lib;
 
 my %linked_against_libvga;
 
+my $py_support_nver = undef;
+
 # read data from objdump-info file
 foreach my $file (sort keys %{$info->objdump_info}) {
     my $objdump = $info->objdump_info->{$file};
@@ -811,6 +813,12 @@ foreach my $file (@{$info->sorted_index}) {
 	tag "missing-dependency-on-python-central" unless ($dep->implies('python-central (>= 0.6)'));
     }
 
+    if ($file =~ m,/usr/share/python-support/$tmp\.(?:public|private)$,){
+	$py_support_nver = '(>= 0.90)';
+    } elsif ($file =~ m,/usr/share/python-support/\S+,o && !$py_support_nver){
+	$py_support_nver = '';
+    }
+
     # ---------------- python file locations
     #  - The python people kindly provided the following table.
     # good:
@@ -1245,6 +1253,20 @@ foreach my $file (@{$info->sorted_index}) {
     }
 }
 
+# python-support check
+if (defined($py_support_nver) && $pkg ne 'python-support'){
+    # Okay - package installs something to /usr/share/python-support/
+    # $py_support_nver is either the empty string or a version
+    # describing what we need.
+    #
+    # We also skip debug packages since they are okay as long as
+    # foo-dbg depends on foo (= $version) and foo has its dependency
+    # correct.
+    my $dep = Lintian::Relation->new($info->field('depends')//'');
+    tag "missing-dependency-on-python-support", "python-support $py_support_nver"
+	unless ($pkg =~ m/-dbg$/ || $dep->implies("python-support $py_support_nver"));
+}
+
 # Check for section games but nothing in /usr/games.  Check for any binary to
 # save ourselves from game-data false positives:
 my $games = dir_counts($info, "usr/games/");
diff --git a/checks/files.desc b/checks/files.desc
index cb8ee00..6cb0921 100644
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -770,6 +770,15 @@ Info: The package installs a file with the package name in
  This can happen if ${python:Depends} was omitted from the Depends field
  in debian/control.
 
+Tag: missing-dependency-on-python-support
+Severity: important
+Certainty: possible
+Info: The package installs a file in usr/share/python-support/ but does
+ not declare the necessary dependency on python-support.
+ .
+ This can happen if ${python:Depends} was omitted from the Depends field
+ in debian/control.
+
 Tag: package-installs-python-pyc
 Severity: serious
 Certainty: certain
-- 
1.7.2.3

Attachment: 0001-Implementation-of-592491.patch.sig
Description: Binary data


Reply to: