Bug#914256: lintian: conflict between no-template-description and untranslatable-debconf-templates

2018-11-22 Thread Vincent McIntyre
On Thu, Nov 22, 2018 at 12:24:19PM -0500, Chris Lamb wrote:
> Hi Vincent,
> 
> > E: hello source: not-using-po-debconf
> > E: hello: no-template-description hello/all-languages
> > E: hello: unknown-field-in-templates hello/all-languages _description
> > 
> > So still the same problem.
> 
> Sorry, please let us know exactly versions of Lintian you are using
> rather than "the source package" or similar. It is very easy to get
> them all mixed up and accidentally waste others time, alas.

Apologies.
The tests I just related above with "still the same problem"
were for lintian 2.5.112~bpo9+1.
I was using the source package for version 2.5.112~bpo9+1,
downloaded with 'apt-get source lintian'.
I didn't have any other version of lintian installed.

> > Still unclear why the lintian test cases are not failing.
> 
> I suspect it is something to do with debian/po/ or something like
> that but, again, debconf & translations thereof are not something
> I've ever really played with, sorry.
> 

If I get time to run it down I will update the bug but in the meantime
input from any passing experts would be appreciated.

Kind regards
Vince



Bug#914256: lintian: conflict between no-template-description and untranslatable-debconf-templates

2018-11-22 Thread Chris Lamb
Hi Vincent,

> E: hello source: not-using-po-debconf
> E: hello: no-template-description hello/all-languages
> E: hello: unknown-field-in-templates hello/all-languages _description
> 
> So still the same problem.

Sorry, please let us know exactly versions of Lintian you are using
rather than "the source package" or similar. It is very easy to get
them all mixed up and accidentally waste others time, alas.

> Still unclear why the lintian test cases are not failing.

I suspect it is something to do with debian/po/ or something like
that but, again, debconf & translations thereof are not something
I've ever really played with, sorry.


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#914256: lintian: conflict between no-template-description and untranslatable-debconf-templates

2018-11-21 Thread Vincent McIntyre
> Hm, I can't seem to reproduce this in the lintian testsuite. After adding:
> 
>   --- a/t/tests/legacy-debconf/debian/debian/debconf-test.templates
>   +++ b/t/tests/legacy-debconf/debian/debian/debconf-test.templates
>   @@ -99,3 +99,15 @@ Type: boolean
>_Description: Decide, lintian
> Using "no longer" should no longer be detected as 
> making-assumptions-about-interfaces-in-templates by lintian.
>   +
>   +Template: debconf/no-underscore
>   +Type: boolean
>   +Default: false
>   +Description: This has no underscore?
>   + This has no underscore.
>   +
>   +Template: debconf/with-underscore
>   +Type: boolean
>   +Default: false
>   +_Description: This has an underscore?
>   + This has an underscore.
> 

I added this to a copy of the source package and ran
  fakeroot debian/rules runtests
but it didn't run the legacy-debconf tests as far as I can see...

Oh. Had to install debhelper from backports also, which pulled in
 cmake cmake-data debhelper dh-autoreconf quilt dwz librhash0
and it wanted
 dh-elpa
as well.

% grep -n underscore 
debian/test-out/tests/debconf/debconf-1~rc1/debian/debconf-test.templates |grep 
Desc
106:Description: This has no underscore?
112:_Description: This has an underscore?

% grep -n untranslatable-debconf-templates 
debian/test-out/tests/debconf/tags.debconf
2:E: debconf source: untranslatable-debconf-templates debconf-test.templates: 
106
3:E: debconf source: untranslatable-debconf-templates debconf-test.templates: 47
4:E: debconf source: untranslatable-debconf-templates debconf-test.templates: 58

% egrep -e '(no|with)-underscore' debian/test-out/tests/debconf/tags.debconf
I: debconf-test: unused-debconf-template debconf/no-underscore
I: debconf-test: unused-debconf-template debconf/with-underscore

Which reproduces your result.



So back to the hello package hacking

% grep Desc debian/templates
Description: Use all available languages?

E: hello source: untranslatable-debconf-templates templates: 4
E: hello source: not-using-po-debconf

% grep Desc debian/templates
_Description: Use all available languages?

E: hello source: not-using-po-debconf
E: hello: no-template-description hello/all-languages
E: hello: unknown-field-in-templates hello/all-languages _description

So still the same problem.


What if I configure po-debconf?
% man po-debconf
#hm, not so scary after all

% mkdir debian/po
% cat > debian/po/POTFILES.in
[type: gettext/rfc822deb] templates
^D

% debconf-updatepo
% ls debian/po/
total 8
4 POTFILES.in  4 templates.pot

% grep Desc debian/templates
_Description: Use all available languages?

% lintian --version
Lintian v2.5.112~bpo9+1

% debuild -us -uc
... No errors.


Still unclear why the lintian test cases are not failing.

Vince



Bug#914256: lintian: conflict between no-template-description and untranslatable-debconf-templates

2018-11-21 Thread Chris Lamb
Hi Vincent,

> Great idea, I gave it a try. libxml-simple-perl and lintian
> were installed.

(Please 100% clarify which lintian version you are using)


> E: hello source: not-using-po-debconf
   

This might be relevant... (The Standards-Version warning can be
entirely ignored.)


Best wishes,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#914256: lintian: conflict between no-template-description and untranslatable-debconf-templates

2018-11-21 Thread Vincent McIntyre
On Wed, Nov 21, 2018 at 03:38:01AM -0500, Chris Lamb wrote:
> Hi Vincent.
> 
> > Version: 2.5.50.4
> […]
> > I also had a look at the git repository and could not see recent
> > work related to either of the tags involved here.
> 
> Granted and will try and reproduce later but just an FYI that
> 2.5.112~bpo9+1 is in stretch-backports so it should be easy to
> install and reconfirm with the latest version.
> 

Great idea, I gave it a try. libxml-simple-perl and lintian
were installed. I tried a few permutations.

% grep -n Description debian/templates 
4:Description: Use all available languages?

Result:
E: hello source: untranslatable-debconf-templates templates: 4
E: hello source: not-using-po-debconf



% grep Description debian/templates 
_Description: Use all available languages?

Result:
E: hello source: not-using-po-debconf
E: hello: no-template-description hello/all-languages
E: hello: unknown-field-in-templates hello/all-languages _description



% grep Description debian/templates 
Description-en: Use all available languages?

Result:
E: hello: no-template-description hello/all-languages


% grep Description debian/templates  
_Description-en: Use all available languages?

Result:
E: hello: no-template-description hello/all-languages
E: hello: unknown-field-in-templates hello/all-languages _description-en



It is also warning about ancient-standards-version 3.9.6
but I don't see how that could be the cause of the problem.

Thanks for taking the time to look at this
Cheers
Vince



Bug#914256: lintian: conflict between no-template-description and untranslatable-debconf-templates

2018-11-21 Thread Chris Lamb
tags 914256 + moreinfo
thanks

Hi Vincent,

> [..]

Hm, I can't seem to reproduce this in the lintian testsuite. After adding:

  --- a/t/tests/legacy-debconf/debian/debian/debconf-test.templates
  +++ b/t/tests/legacy-debconf/debian/debian/debconf-test.templates
  @@ -99,3 +99,15 @@ Type: boolean
   _Description: Decide, lintian
Using "no longer" should no longer be detected as 
making-assumptions-about-interfaces-in-templates by lintian.
  +
  +Template: debconf/no-underscore
  +Type: boolean
  +Default: false
  +Description: This has no underscore?
  + This has no underscore.
  +
  +Template: debconf/with-underscore
  +Type: boolean
  +Default: false
  +_Description: This has an underscore?
  + This has an underscore.

I only get:

  --- t/tests/legacy-debconf/tags   2018-11-21 18:36:28.245704810 +0100
  +++ 
/home/lamby/git/debian/lintian/lintian/debian/test-out/tests/debconf/tags.debconf
 2018-11-21 18:38:34.795622524 +0100
  @@ -1,4 +1,5 @@
   E: debconf source: declares-possibly-conflicting-debhelper-compat-versions 
rules=5 compat=5
  +E: debconf source: untranslatable-debconf-templates debconf-test.templates: 
106
   E: debconf source: untranslatable-debconf-templates debconf-test.templates: 
47
   E: debconf source: untranslatable-debconf-templates debconf-test.templates: 
58
   E: debconf-test-noscripts: copyright-contains-dh_make-todo-boilerplate
  @@ -23,6 +24,7 @@
   I: debconf-test: unused-debconf-template debconf/internal
   I: debconf-test: unused-debconf-template debconf/language
   I: debconf-test: unused-debconf-template debconf/no-description
  +I: debconf-test: unused-debconf-template debconf/no-underscore
   I: debconf-test: unused-debconf-template debconf/should-be-boolean
   I: debconf-test: unused-debconf-template 
debconf/should-be-no-longer-a-problem
   I: debconf-test: unused-debconf-template debconf/testboolean
  @@ -31,6 +33,7 @@
   I: debconf-test: unused-debconf-template debconf/testnote
   I: debconf-test: unused-debconf-template debconf/teststring
   I: debconf-test: unused-debconf-template debconf/translate
  +I: debconf-test: unused-debconf-template debconf/with-underscore
   W: debconf source: ancient-standards-version 3.7.2 (released 2006-05-03) 
(current is CURRENT)
   W: debconf source: build-depends-on-obsolete-package build-depends: dpatch
   W: debconf source: debian-rules-calls-debhelper-in-odd-order dh_makeshlibs 
(line 56)

.. whilst I was expecting a set of warnings for the "unknown" case
that you are seeing.

I am not well-versed enough in debconf(7) translation foo to work out
what the problem is, alas. Can anyone help?


Best wishes,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#914256: lintian: conflict between no-template-description and untranslatable-debconf-templates

2018-11-21 Thread Chris Lamb
Hi Vincent.

> Version: 2.5.50.4
[…]
> I also had a look at the git repository and could not see recent
> work related to either of the tags involved here.

Granted and will try and reproduce later but just an FYI that
2.5.112~bpo9+1 is in stretch-backports so it should be easy to
install and reconfirm with the latest version.


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#914256: lintian: conflict between no-template-description and untranslatable-debconf-templates

2018-11-20 Thread Vincent McIntyre
Package: lintian
Version: 2.5.50.4
Severity: normal

   * What led up to the situation?

(The issue is independent of the 'hello' package, I just used it to make
 reproduction easier.)

$ apt-get source hello

$ cd hello-2.10

$ cat > debian/templates
Template: hello/all-languages
Type: boolean
Default: false
Description: Use all available languages?
 This program can speak in many languages.

$ cat >debian/config
#!/bin/sh -e
# This may ask for config info but should not change anything
# Postinst should change things.

# Source debconf library.
. /usr/share/debconf/confmodule

db_title "hello" || true


$ debuild -us -uc
...
Now running lintian...
...
E: hello source: untranslatable-debconf-templates templates: 4
...

So far, so good.
But if I do what seems to be the recommended thing I get told off again:

$ sed -i -e 's/^Desc/_Desc/' debian/templates
$ debuild -us -uc
...
Now running lintian...
...
E: hello: no-template-description hello/all-languages
E: hello: unknown-field-in-templates hello/all-languages _description

I did try putting both a Description: and _Description: field in but that
did not work either.

This seems like a bug, but if I'm missing some templating magic spell
I would be happy to help document it better.

I've already consulted the sources below:
 - https://manpages.debian.org/stretch/debconf-doc/debconf-devel.7.en.html
 - 
https://www.debian.org/doc/debian-policy/ch-binary.html#prompting-in-maintainer-scripts
 - https://www.debian.org/doc/packaging-manuals/debconf_specification.html

I also had a look at the git repository and could not see recent
work related to either of the tags involved here.

Kind regards
Vince

-- System Information:
Debian Release: 9.6
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'stable-debug')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-8-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_AU:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages lintian depends on:
ii  binutils  2.28-5
ii  bzip2 1.0.6-8.1
ii  diffstat  1.61-1+b1
ii  file  1:5.30-1+deb9u2
ii  gettext   0.19.8.1-2
ii  intltool-debian   0.35.0+20060710.4
ii  libapt-pkg-perl   0.1.32
ii  libarchive-zip-perl   1.59-1+deb9u1
ii  libclass-accessor-perl0.34-1
ii  libclone-perl 0.38-2+b1
ii  libdpkg-perl  1.18.25
ii  libemail-valid-perl   1.202-1
ii  libfile-basedir-perl  0.07-1
ii  libipc-run-perl   0.94-1+deb9u1
ii  liblist-moreutils-perl0.416-1+b1
ii  libparse-debianchangelog-perl 1.2.0-12
ii  libperl5.24 [libdigest-sha-perl]  5.24.1-3+deb9u4
ii  libtext-levenshtein-perl  0.13-1
ii  libtimedate-perl  2.3000-2
ii  liburi-perl   1.71-1
ii  libyaml-libyaml-perl  0.63-2
ii  man-db2.7.6.1-2
ii  patchutils0.3.4-2
ii  perl  5.24.1-3+deb9u4
ii  t1utils   1.39-2
ii  xz-utils  5.2.2-1.2+b1

Versions of packages lintian recommends:
ii  dpkg 1.18.25
pn  libperlio-gzip-perl  
ii  perl 5.24.1-3+deb9u4
ii  perl-modules-5.24 [libautodie-perl]  5.24.1-3+deb9u4

Versions of packages lintian suggests:
pn  binutils-multiarch 
ii  dpkg-dev   1.18.25
ii  libhtml-parser-perl3.72-3
ii  libtext-template-perl  1.46-1

-- no debconf information