Lintian checking ARB packages

Bhavani Shankar R bhavi at ubuntu.com
Mon Dec 31 13:19:57 UTC 2012


On Thu, Dec 27, 2012 at 4:05 PM, Niels Thykier <niels at thykier.net> wrote:
> On 2012-12-27 06:21, Bhavani Shankar R wrote:
>> [...]
>>
>> Thanks Niels,
>>
>> After some tweaking latest revision of the branch
>> http://bazaar.launchpad.net/~bhavi/ubuntu-app-review-board/lintian-arb_profile
>> works fine at runtime with namespace checks.
>>
>
> Great. :)
>
>> A small question I have here, Is there a way to integrate source
>> package tests in lintian for example in arb-lint the sourcepackages.py
>> file checks the source tar.gz file and as far as I know lintian is
>> used on .changes file or dsc or the deb after generating the same from
>> dpkg-buildpackage,
>>
>
> Yes, Lintian can check .dsc files and the related (.orig).tar.$comp
> files.   The built-in checks "debhelper" and "debian-source-dir" are
> examples of this.  Basically, the "Type" field in the .desc should
> contain "source" and the check will run on source packages.
>
> That said, the source checks apply to the built .dsc and not the
> unpacked package tree.  So there are some of the arb-lint checks that
> cannot be turned into a Lintian check[1].
>
> I had a quick look at the current arb-lint checks and I don't think it
> would make sense to implement:
>
>  * test_for_multiple_changelog_entries
>    - $info->changelog might be useful.

Implemented in the latest PPA package uploaded to ARB contributors PPA

>  * test_has_maintainer_scripts
>    - checks/debhelper might be useful as an example.

Yes checks/debhelper has the required functionality I believe when I
checked for maintainer scripts. and Indeed it has some dh_ checks.
Thanks Niels!

>  * test_is_lightweight_app
>    - checks/cruft might be useful as an example (e.g. File::Find
>      and $info->unpacked)

Looked at $info->unpacked, but as ARB, I think we define lightweight
app in terms of code if m not wrong, (If you have a look at the
snippet below:

 @requires('source_files')
    def test_is_lightweight_app(self):
        source_file_extensions = [ ".py", ".rb", ".vala", ".c", ".h", ".cpp",
                ".cc", ".hh", ".pm", ".java", ".js", ".pl" ]
        number_of_max_source_files = 30
        number_of_max_lines_of_code = 15000
        source_code_files = filter(lambda a: os.path.splitext(a)[1] in
source_file_extensions,
                                   self.source_files)
        loc = sum(map(lambda a: len(open(a).readlines()), source_code_files))
        if len(source_code_files) >= number_of_max_source_files or \
           loc >= number_of_max_lines_of_code:

indicates the same)

Wanted your inputs on whether this type of check is feasible in lintian.

>  * test_conflicts_replaces_breaks:
>    - Unless you intend to allow Breaks/Replaces/Conflicts via subst
>      variables (or/and generated via tools), I would probably do this
>      in a binary check.  For a binary check it is:
>
>        if (defined $info->field ('<field>')) {
>            tag 'field-not-allowed-...', '<field>';
>        }
>
>     For a source check it is:
>
>        foreach my $binpkg ($info->binaries) {
>            if (defined $info->binary_field ($binpkg, '<field>')) {
>                tag 'field-not-allowed-...', $binpkg, '<field>';
>            }
>        }
>

Implemented in the package uploaded to ARB contributors PPA.


Thanks Niels for your everlasting patience and reviews :)

Regards,
-- 
Bhavani Shankar
Ubuntu Developer       |  www.ubuntu.com
https://launchpad.net/~bhavi



More information about the App-review-board mailing list