lintian: r24 - in trunk: checks debian
Author: jeroen
Date: 2004-02-09 03:29:23 +0100 (Mon, 09 Feb 2004)
New Revision: 24
Modified:
trunk/checks/po-debconf
trunk/checks/po-debconf.desc
trunk/debian/changelog
Log:
checks/po-debconf
+ Check whether po-debconf is used at all, and warn if it isn't
+ Check for required POTFILES.in and template.pot in debian/po
And fix some perl errors in previous patch (mea culpa)
Modified: trunk/checks/po-debconf
===================================================================
--- trunk/checks/po-debconf 2004-02-09 01:56:45 UTC (rev 23)
+++ trunk/checks/po-debconf 2004-02-09 02:29:23 UTC (rev 24)
@@ -28,13 +28,37 @@
my $pkg = shift;
my $type = shift;
+# First, check wether this package seems to use debconf but not po-debconf
+opendir(DEB, 'debfiles')
+ or fail("Can't open debfiles directory.");
+my $has_template = 0;
+for (readdir(DEB)) {
+ if ($_ =~ m/^(.+\.)?templates$/) {
+ $has_template = 1;
+ last;
+ }
+}
+closedir(DEB);
+
+if ( $has_template && ! -d "debfiles/po" ) {
+ print "W: $pkg $type: not-using-po-debconf\n";
+}
+
# Exit if package does not seem to use po-debconf
-d "debfiles/po" or exit(0);
+
+if (! -f "debfiles/po/POTFILES.in") {
+ print "W: $pkg $type: missing-potfiles-in\n";
+}
+if (! -f "debfiles/po/templates.pot") {
+ print "W: $pkg $type: missing-templates-pot\n";
+}
+
opendir(DEBIAN, 'debfiles/po')
or fail("Can't open debfiles/po directory.");
-if (! -x /usr/bin/msgfmt ) {
- print "N: Warning: msgfmt (package gettext) not available, not"
- print "N: going to check *.po syntax"
+if (! -x "/usr/bin/msgfmt" ) {
+ print "N: Warning: msgfmt (package gettext) not available, not\n";
+ print "N: going to check *.po syntax\n";
}
while (defined(my $file=readdir(DEBIAN))) {
next unless $file =~ m/\.po$/;
@@ -53,7 +77,7 @@
}
print "W: $pkg $type: unknown-charset-in-po-file debian/po/$file\n"
unless length($charset);
- if (-x /usr/bin/msgfmt ) {
+ if (-x "/usr/bin/msgfmt" ) {
system("msgfmt -o /dev/null debfiles/po/$file 2>/dev/null") == 0
or print "W: $pkg $type: invalid-po-file debian/po/$file\n";
}
Modified: trunk/checks/po-debconf.desc
===================================================================
--- trunk/checks/po-debconf.desc 2004-02-09 01:56:45 UTC (rev 23)
+++ trunk/checks/po-debconf.desc 2004-02-09 02:29:23 UTC (rev 24)
@@ -7,6 +7,21 @@
Info: This looks for common mistakes in packages using po-debconf.
Needs-Info: debfiles
+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).
+
+Tag: missing-potfiles-in
+Type: warning
+Info: The required file POTFILES.in is missing from debian/po
+ See po-debconf(7).
+
+Tag: missing-templates-pot
+Type: warning
+Info: The required file templates.pot is missing from debian/po
+ See po-debconf(7).
+
Tag: unknown-charset-in-po-file
Type: warning
Info: Encoding must be declared in PO files, otherwise charset conversions
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2004-02-09 01:56:45 UTC (rev 23)
+++ trunk/debian/changelog 2004-02-09 02:29:23 UTC (rev 24)
@@ -28,6 +28,8 @@
downloaded from a BR), but it should occur seldom.
+ PO files are processed through msgfmt to ensure they are valid.
+ Based on patch by Denis Barbier <barbier@debian.org>, Closes: #210576
+ + Check whether po-debconf is used at all, and warn if it isn't
+ + Check for required POTFILES.in and template.pot in debian/po
Frank Lichtenheld <djpig@debian.org>
* checks/debhelper:
Reply to: