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

lintian: r76 - in trunk: checks debian



Author: jeroen
Date: 2004-02-27 03:22:28 +0100 (Fri, 27 Feb 2004)
New Revision: 76

Modified:
   trunk/checks/po-debconf
   trunk/checks/po-debconf.desc
   trunk/debian/changelog
Log:
Applied patch by Denis Barbier for better po-debconf checking: POTFILES.in
files exist, and po-debconf dependency

Modified: trunk/checks/po-debconf
===================================================================
--- trunk/checks/po-debconf	2004-02-27 00:56:52 UTC (rev 75)
+++ trunk/checks/po-debconf	2004-02-27 02:22:28 UTC (rev 76)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 # po-debconf -- lintian check script
 
-# Copyright (C) 2002-2003 by Denis Barbier <barbier@linuxfr.org>
+# Copyright (C) 2002-2004 by Denis Barbier <barbier@linuxfr.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -32,9 +32,17 @@
 opendir(DEB, 'debfiles')
 	or fail("Can't open debfiles directory.");
 my $has_template = 0;
-for (readdir(DEB)) {
-	if ($_ =~ m/^(.+\.)?templates$/) {
-		$has_template = 1;
+for my $file (readdir(DEB)) {
+	if ($file =~ m/^(.+\.)?templates$/) {
+		open(IN,"debfiles/control")
+			or fail("Can't open debfiles/control.");
+		while (<IN>) {
+			if (m/^Depends:/i) {
+				$has_template = 1
+					if m/\bdebconf(-[.\d]+)?\b/;
+			}
+		}
+		close(IN);
 		last;
 	}
 }
@@ -47,7 +55,19 @@
 #   Exit if package does not seem to use po-debconf
 -d "debfiles/po" or exit(0);
 
-if (! -f "debfiles/po/POTFILES.in") {
+if (-f "debfiles/po/POTFILES.in") {
+	open(POTFILES,"debfiles/po/POTFILES.in")
+		or fail("Can't open debfiles/po/POTFILES.in.");
+	while (<POTFILES>) {
+		chomp;
+		s/.*\]\s*//;
+		#  Cannot check files which are not under debian/
+		next if m,^\.\./,;
+		print "W: $pkg $type: missing-file-from-potfiles-in $_\n"
+			 unless -f "debfiles/$_";
+	}
+	close(POTFILES);
+} else {
 	print "W: $pkg $type: missing-potfiles-in\n";
 }
 if (! -f "debfiles/po/templates.pot") {

Modified: trunk/checks/po-debconf.desc
===================================================================
--- trunk/checks/po-debconf.desc	2004-02-27 00:56:52 UTC (rev 75)
+++ trunk/checks/po-debconf.desc	2004-02-27 02:22:28 UTC (rev 76)
@@ -10,13 +10,19 @@
 Tag: not-using-po-debconf
 Type: warning
 Info: Package seems to be using debconf templates, but it does not
- use po-debconf to make translations possible. See po-debconf(7).
+ use po-debconf to make translations possible (debian/po doesn't exist, or no
+ dependency on po-debconf). See po-debconf(7).
 
 Tag: missing-potfiles-in
 Type: warning
 Info: The required file POTFILES.in is missing from debian/po
  See po-debconf(7).
 
+Tag: missing-file-from-potfiles-in
+Type: warning
+Info: A file listed in debian/po/POTFILES.in could not be found in the source
+ package.  See po-debconf(7).
+
 Tag: missing-templates-pot
 Type: warning
 Info: The required file templates.pot is missing from debian/po

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2004-02-27 00:56:52 UTC (rev 75)
+++ trunk/debian/changelog	2004-02-27 02:22:28 UTC (rev 76)
@@ -54,6 +54,10 @@
     + Revised the symlink detection stuff, it is now more rigorous, and has
       seperate warning for recursive symlinks that are otherwise not
       necessarily wrong (Closes: #118080)
+  * checks/po-debconf:
+    + Check whether files listed in debian/po/POTFILES.in actually exist,
+      and only positively detect po-debconf usage if dependency is there.
+      (Patch by Denis Barbier <barbier@debian.org>, only minimally modified)
 
  -- Frank Lichtenheld <djpig@debian.org>  Thu, 26 Feb 2004 21:52:14 +0100
 



Reply to: