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

Bug#779866: lintian: debian/copyright parser emits non-understandable warnings



On 2015-03-08 13:56, Helge Kreutzmann wrote:
> Hello Niels,
> On Fri, Mar 06, 2015 at 11:50:06PM +0100, Niels Thykier wrote:
>> On 2015-03-05 19:40, Helge Kreutzmann wrote:
>>> Package: lintian
>>> Version: 2.5.30-150-g79ba4df
>>> Severity: normal
>>>
>>> The parser for debian/copyright seems to be under heavy development.
>>
>> Hi,
>>
>> The DEP-5 copyright check "only" got two new tag (the ones you list
>> below) since the last release to unstable and the actual changes to the
>> check are rather modest.
> 
> Ok, sorry for the wrong assumption. (It just seems that my
> debian/copyright is lintian unclean on every second upload).
> 

Indeed, there has been a number of new tags for DEP-5 copyright files.
In fact we still have some pending tag requests for those (e.g. #700970).

>> [...]
>>
>> Indeed, you would be unable to test these with the packaged version of
>> lintian.  However, it is fairly uncomplicated to run lintian from a git
>> checkout.
>>
>>   $ git clone https://anonscm.debian.org/git/lintian/lintian.git
>>   $ lintian/frontend/lintian [options] path/to/your/package.changes
>>
>> I fully understand if you do not want to do that.  I am just mentioning
>> the option, in case you might find it useful.
> 
> I pulled it. It's just awkward, as my primary build machine has no
> direct internet access. So hopefully the unstable version becomes the
> primary soon.
> 

I might be able to do an upload to experimental, but I would like to
keep unstable clear during the freeze.  Just in case.

>>> [...]
>>> b) dep5-file-paragraph-reference-header
>>>    which I now receive after "fixing" the previous error.
>>>
>>
>> Do your "Header-paragraph" contain a license field and does a
>> "Files"-paragraph reference the license of that field?  That seems to be
>> what this is checking for.
> 
> My debian/copyright now starts as follows (shortend):
> Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
> Upstream-Name: goobox
> Upstream-Contact: Paolo Bacchilega <paobac@src.gnome.org>
>                   Paolo Bacchilega  <paobac@svn.gnome.org>
>                   Paolo Bacchilega  <paobac@cvs.gnome.org>
> Source: http://ftp.gnome.org/pub/GNOME/sources/goobox/
> 
> License: GPL-2+
>  Some text
> 
> [...]

For reference, this seems to be the commit introducing the tag:

https://anonscm.debian.org/cgit/lintian/lintian.git/commit/?id=75d1b7cfc5e61091b695f25e53efea6ba744ecf6

I suspect I understand the problem now.  It seems to be a false-positive
caused by your very first paragraph being a "license" paragraph rather
than a "files" paragraph.
  There is nothing wrong with that according to the spec, but our check
used the same "index" for the header paragraph and the first paragraph.
 It "happens to work" if the first paragraph is a "files" paragraph,
because then no "license" paragraph will have the same index as the header.

If my assertion is correct, the attached patch should solve your issue.

Alternatively, insert the first "files" paragraph between the header and
the first "license" paragraph should also work around the issue.

> 
>> [...]
>>> b) Spend a little more time for the description of the tag.
>>>
>>> c) Reword dep5-file-paragraph-reference-header, possibly using simpler
>>>    english and several sentences.
>>>
>>
>> The tag descriptions were drafted by a person with dyslexia.  Under
>> normal circumstances, the new tag descriptions are sent to review on
>> debian-l18n(-english?) prior to a release and they would assist with
>> maturing the tag description.
> 
> Ok, then this is a combination of unfortunate circumstances, which is
> normally not allowed to happen. Thanks for the good process!
> 

You should rather thank Bastien, :)  He is the one submitting his
descriptions for review. :)

>>   Though as explained above, in this particular case, the tags are live
>> on the website prior to a release (and therefore, also a review).
>>
>> If you are unhappy with the tag descriptions, I am happy to revised
>> descriptions.
> 
> Well, as I don't really understand the text I'm unable to provide an
> updated version, hopefully debian-l10n-english will do (they usually).
> 

Are you willing to take a stab at it, if the above patch works? :)

We should probably also rename the tag to say "header-paragraph" for
clarity.

> Btw. I saw that you use po4a. Are you really intending for localizations
> to lintian tags? 
> 
> Thanks & Greetings
> 
>              Helge
> 

Yes.  I thought it would be beneficial as it would provide people with
the description in their native language /and/ provide us with (more)
reviewers of the tag descriptions.

Sadly, so far we got 0 translations. I believe we got one, who wanted to
start out on the German translations recently though.  I should probably
ping him for an update.

Thanks,
~Niels


diff --git a/checks/source-copyright.pm b/checks/source-copyright.pm
index 2eda3b4..623df7a 100644
--- a/checks/source-copyright.pm
+++ b/checks/source-copyright.pm
@@ -255,7 +255,7 @@ sub _parse_dep5 {
     }
     if(defined($full_license_header)) {
         for (@short_licenses_header) {
-            $standalone_licenses{$_} = 1;
+            $standalone_licenses{$_} = -1;
             $full_licenses_seen{$_} = 1;
         }
     }
@@ -443,7 +443,7 @@ sub _parse_dep5 {
         if (not defined $standalone_licenses{$license}) {
             tag 'missing-license-paragraph-in-dep5-copyright', $license,
               "(paragraph at line $lines[$i]{'START-OF-PARAGRAPH'})";
-        } elsif ($standalone_licenses{$license} == 1) {
+        } elsif ($standalone_licenses{$license} == -1) {
             tag 'dep5-file-paragraph-reference-header', $license,
               "(paragraph at line $lines[$i]{'START-OF-PARAGRAPH'})";
         }

Reply to: