~bhavi/ubuntu-app-review-board/lintian-arb_profile

« back to all changes in this revision

Viewing changes to checks/ubuntu/arb/arb-check-source

  • Committer: Bhavani Shankar
  • Date: 2013-01-06 07:44:56 UTC
  • Revision ID: bhavi@ubuntu.com-20130106074456-xfm1hnzpltfh6iay
Make arb light weight app check more on the lines of code than files and make few tests source specific.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# arb-check-source -- lintian check script -*- perl -*-
 
2
 
 
3
# Copyright (C) 2012 Bhavani Shankar <bhavi@ubuntu.com> 
 
4
#
 
5
# - Based on arb-lint by Daniel Holbach
 
6
#
 
7
# This program is free software; you can redistribute it and/or modify
 
8
# it under the terms of the GNU General Public License as published by
 
9
# the Free Software Foundation; either version 2 of the License, or
 
10
# (at your option) any later version.
 
11
#
 
12
# This program is distributed in the hope that it will be useful,
 
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
# GNU General Public License for more details.
 
16
#
 
17
# You should have received a copy of the GNU General Public License
 
18
# along with this program.  If not, you can find it on the World Wide
 
19
# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
 
20
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
 
21
# MA 02110-1301, USA.
 
22
 
 
23
package Lintian::ubuntu::arb::arb_check_source;
 
24
 
 
25
use strict;
 
26
use warnings;
 
27
 
 
28
use Lintian::Tags qw(tag);
 
29
use Lintian::Relation;
 
30
 
 
31
sub run {
 
32
    my ($pkg, undef, $info, $proc, $group) = @_;
 
33
    my $qpkg = quotemeta ($pkg);
 
34
    my ($src) = $group->get_source_processable;
 
35
    my @entries = ();
 
36
    @entries = $info->changelog->data if $info->changelog;
 
37
    
 
38
    # Check for multiple changelog entries
 
39
    if (@entries) {
 
40
    my %versions;
 
41
    for my $entry (@entries) {
 
42
    $versions{$entry->Version} = 1 if defined $entry->Version;
 
43
    }   
 
44
}
 
45
 
 
46
    if (@entries > 1) {
 
47
    tag 'arb-app-has-multiple-changelog-entries';
 
48
   }
 
49
   # Check for conflicts, replaces and breaks field
 
50
    foreach my $fname (qw(conflicts replaces breaks)) {
 
51
       if (defined $info->field ($fname)) {
 
52
           tag 'field-not-allowed-in-arb-app', $fname;
 
53
       }
 
54
   }
 
55
  # Check for deprecated python installations
 
56
  my $bdepends = $info->relation ('build-depends-all'); {
 
57
  tag 'arb-app-has-deprecated-python-installation' if ($bdepends->implies('python-support | python-central'))   
 
58
  }
 
59
}
 
60
 
 
61
1;