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

lintian: r1013 - in trunk: checks debian



Author: he
Date: 2007-12-01 13:40:13 +0100 (Sat, 01 Dec 2007)
New Revision: 1013

Modified:
   trunk/checks/rules
   trunk/checks/rules.desc
   trunk/debian/changelog
Log:
  + [HE] Implement 'desktop-file-but-no-dh_desktop-call', checking for
         missing dh_desktop calls when .desktop files are installed in
         a debhelperized package. (Closes: #409138)

Modified: trunk/checks/rules
===================================================================
--- trunk/checks/rules	2007-12-01 11:24:41 UTC (rev 1012)
+++ trunk/checks/rules	2007-12-01 12:40:13 UTC (rev 1013)
@@ -17,6 +17,7 @@
 use strict;
 use Tags;
 use Util;
+use Dep;
 
 # The following targets are required per Policy.
 my %required = map { $_ => 1 }
@@ -47,6 +48,21 @@
 }
 close(IN);
 
+#get build-depends:
+my $build_deps = "";
+if (open(IN, '<', "fields/build-depends")) {
+    local $/ = undef;
+    chomp($build_deps .= <IN>);
+    close(IN);
+}
+if (open(IN, '<', "fields/build-depends-indep")) {
+    local $/ = undef;
+    chomp($build_deps .= <IN>);
+    close(IN);
+}
+$build_deps = Dep::parse($build_deps);
+
+
 open(RULES, '<', 'debfiles/rules') or fail("Failed opening rules: $!");
 
 # Check for required #!/usr/bin/make -f opening line.  Allow -r or -e; a
@@ -113,12 +129,21 @@
 }
 close RULES;
 
-# Make sure all the required rules were seen.
 unless ($includes) {
+    # Make sure all the required rules were seen.
     for my $target (sort keys %required) {
 	tag "debian-rules-missing-required-target", $target
 	    unless $seen{$target};
     }
+
+    #check if we should have seen some dh_ calls:
+    if (Dep::implies($build_deps, Dep::parse("debhelper"))) {
+        #.desktop files usually imply dh_desktop:
+	if (scalar @{[glob("debfiles/*.desktop")]} &&
+	    ! grep { /^\s*dh_desktop/ } map { @$_ } values %rules_per_target) {
+	    tag "desktop-file-but-no-dh_desktop-call";
+	}
+    }
 }
 
 # Make sure we have no content for binary-arch if we are arch-indep:

Modified: trunk/checks/rules.desc
===================================================================
--- trunk/checks/rules.desc	2007-12-01 11:24:41 UTC (rev 1012)
+++ trunk/checks/rules.desc	2007-12-01 12:40:13 UTC (rev 1013)
@@ -76,3 +76,9 @@
 Info: It looks like you try to run code in the binary-arch target of 
  <tt>debian/rules</tt>, even though your package is architecture-
  independent.
+
+Tag: desktop-file-but-no-dh_desktop-call
+Type: warning
+Info: It looks like your package includes a .desktop file and you use
+ debhelper to build it, but you don't call dh_desktop in your rules
+ file.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2007-12-01 11:24:41 UTC (rev 1012)
+++ trunk/debian/changelog	2007-12-01 12:40:13 UTC (rev 1013)
@@ -48,6 +48,9 @@
     + [HE] Implement 'binary-arch-rules-but-pkg-is-arch-indep', checking
            for rules in binary-arch when the package is arch: all.
            (Closes: #409109, #119097)
+    + [HE] Implement 'desktop-file-but-no-dh_desktop-call', checking for
+           missing dh_desktop calls when .desktop files are installed in
+           a debhelperized package. (Closes: #409138)
   * checks/scripts:
     + [HE] Allow packages to drop snippets into /etc/csh/login.d
            without a dependency on csh. Files there should also



Reply to: