Bug#560414: lintian: Don't warn about length of short description of text templates

2010-02-09 Thread Frans Pop
tag 560414 patch
thanks

Attached a patch that implements this. It changes the name of the local 
variable (template) 'type' which currently shadows the higher level 
(package) 'type' variable.

Cheers,
FJP

--- checks/debconf.orig	2010-01-31 10:02:32.0 +0100
+++ checks/debconf	2010-02-09 21:05:15.0 +0100
@@ -290,10 +290,10 @@
 } else {
 ($short, $extended) = ('', '');
 }
-my $type = $template-{type} || '';
+my $ttype = $template-{type} || '';
 unless ($short =~ /for internal use/i) {
-	my $isprompt = grep { $_ eq $type } qw(string password);
-my $isselect = grep { $_ eq $type } qw(select multiselect);
+	my $isprompt = grep { $_ eq $ttype } qw(string password);
+my $isselect = grep { $_ eq $ttype } qw(select multiselect);
 	if ($isprompt) {
 	if ($short  ($short !~ m/:$/ || $short =~ m/^(what|who|when|where|which|how)/i)) {
 		tag malformed-prompt-in-templates, $template-{template};
@@ -304,7 +304,7 @@
 		tag using-imperative-form-in-templates, $template-{template};
 	}
 	}
-	if ($type eq 'boolean') {
+	if ($ttype eq 'boolean') {
 	if ($short !~ /\?/) {
 		tag malformed-question-in-templates, $template-{template};
 	}
@@ -312,19 +312,20 @@
 	if (defined ($extended)  $extended =~ /[^\?]\?(\s+|$)/) {
 	tag using-question-in-extended-description-in-templates, $template-{template};
 	}
-	if ($type eq 'note') {
+	if ($ttype eq 'note') {
 	if ($short =~ /[.?;:]$/) {
 		tag malformed-title-in-templates, $template-{template};
 	}
 	}
 	if (length ($short)  75) {
-	tag too-long-short-description-in-templates, $template-{template};
+	tag too-long-short-description-in-templates, $template-{template}
+		unless $type eq 'udeb'  $ttype eq 'text';
 	}
 if (defined $template-{description}) {
 if ($template-{description} =~ /(\A|\s)(I|[Mm]y|[Ww]e|[Oo]ur|[Oo]urs|mine|myself|ourself|me|us)(\Z|\s)/) {
 tag using-first-person-in-templates, $template-{template};
 }
-if ($template-{description} =~ /[ \'\]yes[ \'\,;.]/i and $type eq 'boolean') {
+if ($template-{description} =~ /[ \'\]yes[ \'\,;.]/i and $ttype eq 'boolean') {
 tag making-assumptions-about-interfaces-in-templates, $template-{template};
 }
 }


Bug#560406: lintian: warn against use of debconf TITLE command with fixed text

2009-12-10 Thread Frans Pop
Package: lintian
Severity: wishlist
X-Debbugs-CC: debc...@packages.debian.org

Some packages use the command 'db_title' in maintainer scripts to set the 
title for debconf dialogs to a fixed string. Disadvantage is that this 
does not allow the string to be translated.

Because of that the command 'db_settitle' (which takes the title form a 
debconf template) is normally to be preferred.

Please add a warning against setting the dialog title to a fixed string 
using db_title.

A regular expression for that could be:
db_title[[:space:]]+[']?[^\$]
(One of the quotes may need escaping.)

The explanation could read as follows:
   Using db_title to set the title of a debconf dialog does not allow for
   it to be translated; consider using db_settitle instead.
   See debconf-devel(7) for additional information.

For examples of packages currently getting it wrong see:
#560314, #560316, #560318, #560319

There will be false positives as some titles being set this way may not 
need translation (example in #560315).

The test will miss cases where titles are set from a variable containing an 
untranslated string, but those should be extremely rare.

Cheers,
FJP



-- 
To UNSUBSCRIBE, email to debian-lint-maint-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560414: lintian: Don't warn about length of short description of text templates

2009-12-10 Thread Frans Pop
Package: lintian
Version: 2.2.18
Severity: wishlist
X-Debbugs-CC: debian-b...@lists.debian.org

Concerns check: too-long-short-description-in-templates

As can be seen on [1] there are a lot of warnings of this type, especially 
for udebs. For udebs all cases are templates of type text that contain 
text fragments that get dynamically included in other templates at 
runtime. Because of that specific usage, the length of the short 
description is not relevant.

To avoid these false positives, please add an exception for this warning:
- if the template type is text AND
- the package is a udeb

Reasons to request the exception are:
- udebs cannot contain lintian exceptions for binary packages (because we
  don't want them installed in the D-I environment)
- we *do* want the warning for other template types than text

[1]http://lintian.debian.org/tags/too-long-short-description-in-templates.html



-- 
To UNSUBSCRIBE, email to debian-lint-maint-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: Another raw idea for lintian check: variable substitution in debconf templates

2008-02-09 Thread Frans Pop
Russ Allbery wrote:
 Sure, that sounds like a good idea to me.  Should we trigger on anything
 in a lintian template that looks like ${DISK}?  Would $DISK also be
 valid, or are the curly braces required?

The braces are required.

 I assume that something like the following pseudocode would work:

It should really count the number of times each variable occurs in the
original string and check that it occurs the same number of times in the
translated string.
It should also ignore any strings that are marked fuzzy

In D-I this does sometimes result in false negatives as a translator can
conceivably condense the text in such a way that the repetition of the
variable is not needed in his translation, but those are rare exceptions.


This check is really a check for the translators, and not for package
maintainers. As such adding it to Lintian is not immediately obvious.
Also, correcting the error in certain translations may be non-trivial if the
translation uses a totally different character set than the maintainer uses.

Therefore IMO the explanation for the Lintian error should explain that
maintainers should only correct errors in translations themselves if:
- the error is completely obvious; examples:
  - simple typo in variable name
  - variable in the wrong case (upper v.s. lower)
  - braces forgotten
  - normal braces used instead of curly ones
- (s)he's reasonable sure there are no other errors in the translation
  (for example: if the translation is significantly shorter than the
  original, it is quite likely that the translation is just plain wrong)
- (s)he can edit the translation without causing encoding problems

In all other cases the maintainer should IMO either contact the translator
(preferred), or mark the string fuzzy.

Personally I feel that this check would be more usefully added on the web
pages that show translation status for the translators themselves. Even
better would be if we could develop some kind of translation update
submission system that did such checks would be done there (and where the
translators would have the option of saying Yes, I'm really sure this is
OK).

Cheers,
FJP


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: lintian.d.o updated, link change

2007-12-22 Thread Frans Pop
On Sunday 23 December 2007, Russ Allbery wrote:
 The new scheme is:
 http://lintian.debian.org/reports/maintainer/email.html

The links from those pages to error descriptions are broken:

http://lintian.debian.org/reports/maintainer/Tnewer-debconf-templates.html
404 Not Found
 There's no record of packages from that maintainer.

Cheers,
FJP


signature.asc
Description: This is a digitally signed message part.


Bug#395028: lintian: mismatch-translated-choices - should take escaped commas into account

2006-10-24 Thread Frans Pop
Package: lintian
Version: 1.23.25
Severity: minor
Tags: d-i

If I build and check for example choose-mirror for Debian-Installer, I'll 
get a number of warnings for mismatch-translated-choices even though the 
number of choices of the translation _does_ match the original.

Reason is probably that lintian counts all commas, while it should skip 
any escaped commas (\,).

Thus, the following is correct:
Choices: NL, KO
Choices-nl: Nederland, Korea\, Republiek


pgpoUQEOnqS2b.pgp
Description: PGP signature


Bug#361986: lintian: Indices is a valid template field for (c)debconf

2006-04-11 Thread Frans Pop
Package: lintian
Version: 1.23.16

The Indices field is used to sort entries in a select or multiselect 
question.

It is supported in cdebconf; I'm not totally sure about debconf.
However in this case I feel it would be better to not warn about it even 
if it is not be supported by debconf as it will just be ignored and the 
warning is extremely annoying for cdebconf.


pgpCjuRkg8nIT.pgp
Description: PGP signature


Bug#357636: shlib-without-PT_GNU_STACK-section check not valid for all arches?

2006-03-18 Thread Frans Pop
Package: lintian
Version: 1.23.15

#321750 introduced a new check shlib-without-PT_GNU_STACK-section in 
lintian 1.23.13. Is it possible that this check is not valid for all 
architectures?

The check fired after I compiled freetype for an NMU on HPPA. It does not 
fire if I perform the same compilation on i386.

objdump snip for hppa
usr/lib/libfreetype.so.6: file format elf32-hppa-linux

Program Header:
LOAD off0x vaddr 0x paddr 0x align 2**12
 filesz 0x00077040 memsz 0x00077040 flags r-x
LOAD off0x00077040 vaddr 0x00087040 paddr 0x00087040 align 2**12
 filesz 0x4550 memsz 0x4560 flags rwx
 DYNAMIC off0x0007980c vaddr 0x0008980c paddr 0x0008980c align 2**2
 filesz 0x00d0 memsz 0x00d0 flags rw-

Dynamic Section:
/objdump snip for hppa

objdump snip for i386
usr/lib/libfreetype.so.6: file format elf32-i386

Program Header:
LOAD off0x vaddr 0x paddr 0x align 2**12
 filesz 0x0006a0bc memsz 0x0006a0bc flags r-x
LOAD off0x0006a0bc vaddr 0x0006b0bc paddr 0x0006b0bc align 2**12
 filesz 0x2c60 memsz 0x2c64 flags rw-
 DYNAMIC off0x0006c894 vaddr 0x0006d894 paddr 0x0006d894 align 2**2
 filesz 0x00d0 memsz 0x00d0 flags rw-
   STACK off0x vaddr 0x paddr 0x align 2**2
 filesz 0x memsz 0x flags rw-

Dynamic Section:
/objdump snip for i386

Full objdump files attached.



libfreetype_hppa.objdump.gz
Description: GNU Zip compressed data


libfreetype_i386.objdump.gz
Description: GNU Zip compressed data


pgpHlZqyFoNn2.pgp
Description: PGP signature


Bug#357541: lintian: Please support udeb: lines in shlibs files

2006-03-17 Thread Frans Pop
Package: lintian
Version: 1.23.15
Tags: d-i

http://lintian.debian.org/reports/Tunused-shlib-entry-in-control-file.html
currently shows several packages with the following warning:
   unused-shlib-entry-in-control-file udeb:

For an upcoming upload of expat, the following warning can occur as well:
   duplicate-entry-in-shlibs-control-file udeb:

This is due to a change in shlibs files that was needed to determine 
dependencies for udebs (as used by Debian Installer) and which is 
supported now in dpkg-dev and debhelper.

For libexpat this results in the following shlibs control file:
libexpat 1 libexpat1 (= 1.95.8)
libexpat 0 libexpat1 (= 1.95.8)
udeb: libexpat 1 libexpat1 (= 1.95.8)
udeb: libexpat 0 libexpat1 (= 1.95.8)

Please add support for these new lines in lintian so the above warnings 
are no longer generated.

See #345472 and #345475 for further info on the new udeb: lines.

Cheers,
FJP


pgpvLaXUHmf9f.pgp
Description: PGP signature