Bug#477628: reopen this bug?
Hi.
I don't think this bug should have been closed. If my tests are correct,
there are some problems with the solution used. What I did in my test
was this (on a Debian stable system):
> cd /tmp
> apt-get source lintian=1.23.49
...
> apt-get source mr=0.29
> cd lintian-1.23.49
> frontend/lintian --root /tmp/lintian-1.23.49 ../mr_0.29.dsc
E: mr source: debian-rules-missing-required-target binary
E: mr source: debian-rules-missing-required-target binary-arch
E: mr source: debian-rules-missing-required-target binary-indep
E: mr source: debian-rules-missing-required-target build
E: mr source: debian-rules-missing-required-target clean
The same results were achieved in a Debian unstable chroot.
Thus, lintian reports errors that shouldn't be reported, since the
debhelper dh util is called.
Furthermore, if I lower the number in debian/compat and the versioned
dependency on debhelper in debian/control of the "mr" package, but keep
using "dh", I think at least a warning should be issued.
I did a patch for the lintian version in stable (1.23.28) which I
attached, though it won't help much here. However, it disables the above
errors if a wildcard target with "dh $@" command is found and issues a
warning if debian/compat is too low.
If you want me to prepare a patch for 1.23.49 (or a newer version in
SVN), I can do so.
Regards,
Sven
diff -ur lintian-1.23.28/checks/rules lintian-1.23.28+nmu1/checks/rules
--- lintian-1.23.28/checks/rules 2007-03-10 07:55:47.000000000 +0100
+++ lintian-1.23.28+nmu1/checks/rules 2008-05-21 15:57:59.792873072 +0200
@@ -36,6 +36,15 @@
return 0 unless -f "debfiles/rules";
}
+# check for debhelper compatibility (needed for debhelper 7 short rules file)
+my $dh_level=0;
+if ( -s 'debfiles/compat') {
+ open(COMPAT, '< debfiles/compat') or fail("Failed to open compat: $!");
+ my $l=<COMPAT> or fail("Failed to read compat: $!");
+ chomp $l;
+ $dh_level=$l;
+}
+
open(RULES, '< debfiles/rules') or fail("Failed opening rules: $!");
# Check for required #!/usr/bin/make -f opening line. Allow -r or -e; a
@@ -52,11 +61,21 @@
# since to chase all includes we'd have to have all of its build dependencies
# installed.
my $includes = 0;
+my $wildcard_target = 0;
my %seen;
local $_;
while (<RULES>) {
$includes = 1 if /^ *[s-]?include\s+/;
-
+ # check wether a wildcard rule exists that calls debhelper 7
+ if ( /^\%:[[:space:]]*$/) {
+ next if eof(RULES);
+ $_=<RULES>;
+ if ( /^[[:space:]]*dh[[:space:]]*\$\@[[:space:]]*$/ ) {
+ tag "debian-rules-debhelper-wildcard-with-low-compat" , $dh_level
+ unless ($dh_level>=7);
+ $wildcard_target = 1;
+ }
+ }
# We're looking only for the required targets. Ignore everything else.
next unless /^([^:]+):/;
my @targets = split (' ', $1);
@@ -70,7 +89,7 @@
unless ($includes) {
for my $target (sort keys %required) {
tag "debian-rules-missing-required-target", $target
- unless $seen{$target};
+ unless $seen{$target} || $wildcard_target;
}
}
diff -ur lintian-1.23.28/checks/rules.desc lintian-1.23.28+nmu1/checks/rules.desc
--- lintian-1.23.28/checks/rules.desc 2007-03-10 07:55:47.000000000 +0100
+++ lintian-1.23.28+nmu1/checks/rules.desc 2008-05-21 15:21:21.766798705 +0200
@@ -33,3 +33,9 @@
of the required targets. All of build, binary, binary-arch,
binary-indep, and clean must be provided, even if they don't do anything
for this package.
+
+Tag: debian-rules-debhelper-wildcard-with-low-compat
+Type: warning
+Info: The <tt>debian/rules</tt> file for this package uses the debhelper 7
+ shortcut call, but <tt>debian/compat</tt> does not reflect the necessary
+ requirements
Only in lintian-1.23.28+nmu1: debfiles
Reply to: