Bug#458785: [checks/fields] *-dbg packages should not have empty dependencies

2008-01-06 Thread Chris Lamb
tags 458785 +patch
kthxbye

A patch (with testcases) is attached, which checks for a dependency on a
non-dbg equivalent package. It does not check whether the dependency is
versioned at all.

The case where Depends: is empty is caught, along with the case where
libfoo0-dbg depends on libfoo (it was not necessary to modify the
testcase input for this). This latter case may even be wrong; I'm not sure.


Regards,

-- 
Chris Lamb, UK   [EMAIL PROTECTED]
GPG: 0x634F9A20
Index: checks/fields
===
--- checks/fields   (revision 1122)
+++ checks/fields   (working copy)
@@ -408,6 +408,14 @@
 }
 if (($type eq binary) || ($type eq 'udeb')) {
my (%deps, %fields, %parsed);
+
+   my $non_dbg_variant_check = 0;
+   my $non_dbg_variant = ;
+   if ($pkg =~ m/(.+)\-dbg$/) {
+   $non_dbg_variant_check = 1;
+   $non_dbg_variant = $1;
+   }
+
for my $field (qw(depends pre-depends recommends suggests conflicts 
provides replaces)) {
if (open(FH, '', fields/$field)) {
#Get data and clean it
@@ -453,6 +461,11 @@
push @{$deps{$d_pkg}}, [$field, 
$d_version];
}
 
+   # We have found a Depends: on our 
non-dbg equivalent
+   if ($non_dbg_variant_check  $field eq 
depends  $d_pkg eq $non_dbg_variant) {
+   $non_dbg_variant = ;
+   }
+
tag versioned-provides, $part_d_orig
if ($field eq provides  
$d_version-[0]);
 
@@ -513,6 +526,9 @@
}
}
 
+   tag foo-dbg-package-missing-depends-on-foo, missing $non_dbg_variant
+   if ($non_dbg_variant_check  $non_dbg_variant ne );
+
# If Conflicts is set, make sure it's not inconsistent with the other
# dependency fields.
if ($fields{conflicts}) {
Index: checks/fields.desc
===
--- checks/fields.desc  (revision 1122)
+++ checks/fields.desc  (working copy)
@@ -706,3 +706,9 @@
 Info: This package has a name suggesting that it contains detached
  debugging symbols.  If so, it should have priority extra since users
  normally do not need such packages.
+
+Tag: foo-dbg-package-missing-depends-on-foo
+Type: warning
+Info: This package has a name in the form of foo-dbg which suggests that
+ it contains detached debugging symbols. If so, it should depend on the
+ corresponding foo package.
Index: testset/tags.debug
===
--- testset/tags.debug  (revision 1122)
+++ testset/tags.debug  (working copy)
@@ -9,6 +9,8 @@
 W: debug source: changelog-should-not-mention-nmu
 W: debug source: debian-rules-sets-DH_COMPAT line 5
 W: debug source: out-of-date-standards-version 3.7.0 (current is 3.7.3)
+W: hello-dbg: foo-dbg-package-missing-depends-on-foo missing hello
 W: hello: binary-without-manpage usr/bin/hello
 W: hello: binary-without-manpage usr/bin/hello.dbg
+W: libhello0-dbg: foo-dbg-package-missing-depends-on-foo missing libhello0
 W: libhello0-dbg: shared-lib-without-dependency-information 
./usr/lib/libhello.so.dbg
Index: testset/debug/debian/control
===
--- testset/debug/debian/control(revision 1122)
+++ testset/debug/debian/control(working copy)
@@ -15,7 +15,7 @@
 Package: hello-dbg
 Priority: extra
 Architecture: alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 m68k mips 
mipsel powerpc ppc64 s390 sparc
-Depends: hello (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Depends:
 Description: Test for external debugging information
  lintian regression test for external debugging file handling.
 


signature.asc
Description: PGP signature


Bug#458785: [checks/fields] *-dbg packages should not have empty dependencies

2008-01-02 Thread Russ Allbery
Package: lintian
Version: 1.23.41
Severity: wishlist

*-dbg packages should depend on the package for which they're providing
debugging symbols, generally with an (= ${binary:Version) dependency,
to ensure consistency between the debugging symbols and the package.

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-3-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages lintian depends on:
ii  binutils2.18.1~cvs20071027-1 The GNU assembler, linker and bina
ii  diffstat1.45-2   produces graph of changes introduc
ii  dpkg-dev1.14.14  package building tools for Debian
ii  file4.21-3   Determines file type using magic
ii  gettext 0.16.1-2 GNU Internationalization utilities
ii  intltool-debian 0.35.0+20060710.1Help i18n of RFC822 compliant conf
ii  libparse-debianchan 1.1.1-1  parse Debian changelogs and output
ii  liburi-perl 1.35.dfsg.1-1Manipulates and accesses URI strin
ii  man-db  2.5.0-4  on-line manual pager
ii  perl [libdigest-md5 5.8.8-12 Larry Wall's Practical Extraction 

lintian recommends no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]