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

lintian: r371 - in trunk: checks debian testset testset/debconf/debian



Author: djpig
Date: 2004-11-19 14:06:39 +0100 (Fri, 19 Nov 2004)
New Revision: 371

Modified:
   trunk/checks/po-debconf
   trunk/checks/po-debconf.desc
   trunk/debian/changelog
   trunk/debian/control
   trunk/testset/debconf/debian/debconf-test.templates
   trunk/testset/tags.debconf
Log:
Check for outdated .pot files when using po-debconf.
This requires a new dependency on intltool-debian. Patch
by Denis Barbier with corrections by JvW (Closes: #242345)


Modified: trunk/checks/po-debconf
===================================================================
--- trunk/checks/po-debconf	2004-11-17 00:01:58 UTC (rev 370)
+++ trunk/checks/po-debconf	2004-11-19 13:06:39 UTC (rev 371)
@@ -57,6 +57,7 @@
 #   Exit if package does not seem to use po-debconf
 -d "debfiles/po" or return(0);
 
+my $missing_files = 0;
 if (-f "debfiles/po/POTFILES.in") {
 	open(POTFILES,"debfiles/po/POTFILES.in")
 		or fail("Can't open debfiles/po/POTFILES.in.");
@@ -65,22 +66,36 @@
 		s/.*\]\s*//;
 		#  Cannot check files which are not under debian/
 		next if m,^\.\./, or $_ eq '';
-		tag "missing-file-from-potfiles-in", "$_"
-			 unless -f "debfiles/$_";
+		unless (-f "debfiles/$_") {
+			tag "missing-file-from-potfiles-in", "$_";
+			$missing_files = 1;
+		} 
 	}
 	close(POTFILES);
 } else {
 	tag "missing-potfiles-in", "";
+	$missing_files = 1;
 }
 if (! -f "debfiles/po/templates.pot") {
 	tag "missing-templates-pot", "";
+	$missing_files = 1;
 }
 
-opendir(DEBIAN, 'debfiles/po')
-        or fail("Can't open debfiles/po directory.");
+if (-x "/usr/bin/msgcmp" && -x "/usr/share/intltool-debian/intltool-update" ) {
+	if ($missing_files == 0) {
+		system("cd debfiles/po && /usr/share/intltool-debian/intltool-update --gettext-package=test --pot");
+		system("/usr/bin/msgcmp debfiles/po/test.pot debfiles/po/templates.pot >/dev/null 2>&1") == 0
+                	or tag "newer-debconf-templates";
+	}
+} else {
+	fail("either msgcmp or intltool-update not found");
+}
+
 if (! -x "/usr/bin/msgfmt" ) {
 	fail("msgfmt not found");
 }
+opendir(DEBIAN, 'debfiles/po')
+        or fail("Can't open debfiles/po directory.");
 while (defined(my $file=readdir(DEBIAN))) {
         next unless $file =~ m/\.po$/;
         local ($/) = "\n\n";
@@ -98,10 +113,8 @@
         }
         tag "unknown-encoding-in-po-file", "debian/po/$file"
                 unless length($charset);
-	if (-x "/usr/bin/msgfmt" ) {
-	    system("msgfmt -o /dev/null debfiles/po/$file 2>/dev/null") == 0
-                or tag "invalid-po-file", "debian/po/$file";
-	}
+	system("msgfmt -o /dev/null debfiles/po/$file 2>/dev/null") == 0
+		or tag "invalid-po-file", "debian/po/$file";
 }
 
 }

Modified: trunk/checks/po-debconf.desc
===================================================================
--- trunk/checks/po-debconf.desc	2004-11-17 00:01:58 UTC (rev 370)
+++ trunk/checks/po-debconf.desc	2004-11-19 13:06:39 UTC (rev 371)
@@ -37,3 +37,16 @@
 Type: warning
 Info: Some errors are found in PO files and their content will be
  discarded.  Run 'msgfmt' to see error messages.
+
+Tag: newer-debconf-templates
+Type: warning
+Info: debconf-updatepo has not been run since the last change to your
+ debconf template(s).
+ .
+ You should run debconf-updatepo whenever debconf templates files are
+ changed so that translators can be warned that their files are
+ outdated.
+ .
+ This can be ensured by running debconf-updatepo in the 'clean' target
+ of debian/rules, PO files will then always be up-to-date in the source
+ package.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2004-11-17 00:01:58 UTC (rev 370)
+++ trunk/debian/changelog	2004-11-19 13:06:39 UTC (rev 371)
@@ -13,6 +13,10 @@
   * checks/menu-format.desc:
     + [FL] Adjust references to the menu documentation. Noted by
       Jack Moffitt (Closes: #277393)
+  * checks/po-debconf{,.desc}:
+    + [FL] Check for outdated .pot files when using po-debconf.
+      This requires a new dependency on intltool-debian. Patch
+      by Denis Barbier with corrections by JvW (Closes: #242345)
   * checks/scripts.desc:
     + [FL] Fix copy-and-paste error in description
       of wrong-path-for-gnuplot (Closes: #276945)

Modified: trunk/debian/control
===================================================================
--- trunk/debian/control	2004-11-17 00:01:58 UTC (rev 370)
+++ trunk/debian/control	2004-11-19 13:06:39 UTC (rev 371)
@@ -8,7 +8,7 @@
 
 Package: lintian
 Architecture: all
-Depends: perl, libdigest-md5-perl | perl (>> 5.8), file, binutils, diffstat (>= 1.27-1), man-db (>= 2.3.20-1), gettext
+Depends: perl, libdigest-md5-perl | perl (>> 5.8), file, binutils, diffstat (>= 1.27-1), man-db (>= 2.3.20-1), gettext, intltool-debian
 Suggests: binutils-multiarch
 Description: Debian package checker
  Lintian dissects Debian packages and reports bugs and policy

Modified: trunk/testset/debconf/debian/debconf-test.templates
===================================================================
--- trunk/testset/debconf/debian/debconf-test.templates	2004-11-17 00:01:58 UTC (rev 370)
+++ trunk/testset/debconf/debian/debconf-test.templates	2004-11-19 13:06:39 UTC (rev 371)
@@ -1,3 +1,3 @@
 Template: debconf/test
 Type: text
-_description: Foo bar
+_description: Foo bar (2)

Modified: trunk/testset/tags.debconf
===================================================================
--- trunk/testset/tags.debconf	2004-11-17 00:01:58 UTC (rev 370)
+++ trunk/testset/tags.debconf	2004-11-19 13:06:39 UTC (rev 371)
@@ -1,4 +1,5 @@
 E: debconf-test: extended-description-is-empty
 E: debconf-test: settitle-requires-versioned-depends config
 W: debconf source: maintainer-script-lacks-debhelper-token debian/debconf-test.postinst
+W: debconf source: newer-debconf-templates
 W: debconf-udeb udeb: missing-debconf-dependency



Reply to: