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

lintian: r1365 - in trunk: checks frontend lib



Author: rra
Date: 2008-06-08 05:51:27 +0200 (Sun, 08 Jun 2008)
New Revision: 1365

Modified:
   trunk/checks/cruft
   trunk/checks/standards-version
   trunk/checks/watch-file
   trunk/frontend/lintian
   trunk/lib/Checker.pm
Log:
Use $info rather than $collect as the name for the Lintian::Collect
object, since it's still early and I can change my mind about what
to name things.


Modified: trunk/checks/cruft
===================================================================
--- trunk/checks/cruft	2008-06-07 09:21:50 UTC (rev 1364)
+++ trunk/checks/cruft	2008-06-08 03:51:27 UTC (rev 1365)
@@ -82,13 +82,13 @@
 
 # Used in the find function.
 my $pkg;
-my $collect;
+my $info;
 
 sub run {
 
 $pkg = shift;
 my $type = shift;
-$collect = shift;
+$info = shift;
 
 if (-e "debfiles/files" and not -z "debfiles/files") {
     tag 'debian-files-list-in-source';
@@ -96,8 +96,8 @@
 
 # This doens't really belong here, but there isn't a better place at the
 # moment to put this check.
-if ($collect->native) {
-    my $version = $collect->field('version');
+if ($info->native) {
+    my $version = $info->field('version');
     if ($version =~ /-/ and $version !~ /-0\.[^-]+$/) {
         tag 'native-package-with-dash-version';
     }
@@ -191,7 +191,7 @@
 # than creating yet a third set of tags, and this gets the severity right.
 sub find_cruft {
     (my $name = $File::Find::name) =~ s,^(\./)?unpacked/,,;
-    my $prefix = ($collect->native ? "diff-contains" : "source-contains");
+    my $prefix = ($info->native ? "diff-contains" : "source-contains");
     if (-d and not $warned{$name}) {
         for my $rule (@directory_checks) {
             if ($name =~ /$rule->[0]/) {
@@ -203,7 +203,7 @@
 
     unless ($warned{$name}) {
         for my $rule (@file_checks) {
-            next if ($rule->[2] and not $collect->native);
+            next if ($rule->[2] and not $info->native);
             if ($name =~ /$rule->[0]/) {
                 tag "${prefix}-$rule->[1]", $name unless $pkg eq 'lintian';
             }

Modified: trunk/checks/standards-version
===================================================================
--- trunk/checks/standards-version	2008-06-07 09:21:50 UTC (rev 1364)
+++ trunk/checks/standards-version	2008-06-08 03:51:27 UTC (rev 1365)
@@ -77,11 +77,11 @@
 
 my $pkg = shift;
 my $type = shift;
-my $collect = shift;
+my $info = shift;
 
 # udebs aren't required to conform to policy, so they don't need
 # Standards-Version. (If they have it, though, it should be valid.)
-my $version = $collect->field('standards-version');
+my $version = $info->field('standards-version');
 if (not defined $version) {
     tag 'no-standards-version-field' unless $type eq 'udeb';
     return 0;
@@ -122,7 +122,7 @@
     } else {
         # We have to get the package date from the changelog file.  If we
         # can't find the changelog file, always issue the tag.
-        my $changes = $collect->changelog;
+        my $changes = $info->changelog;
         if (not defined $changes) {
             tag 'out-of-date-standards-version', $tag;
             return 0;

Modified: trunk/checks/watch-file
===================================================================
--- trunk/checks/watch-file	2008-06-07 09:21:50 UTC (rev 1364)
+++ trunk/checks/watch-file	2008-06-08 03:51:27 UTC (rev 1365)
@@ -29,9 +29,9 @@
 
 my $pkg = shift;
 my $type = shift;
-my $collect = shift;
+my $info = shift;
 
-unless ($collect->native) {
+unless ($info->native) {
     unless (-f "debfiles/watch") {
         tag 'debian-watch-file-is-missing';
         return;
@@ -74,7 +74,7 @@
 
     # If the version of the package contains dfsg, assume that it needs to be
     # mangled to get reasonable matches with upstream.
-    my $version = $collect->field('version');
+    my $version = $info->field('version');
     if ($version =~ /dfsg/ and not $mangle) {
         tag 'debian-watch-file-should-mangle-version';
     }

Modified: trunk/frontend/lintian
===================================================================
--- trunk/frontend/lintian	2008-06-07 09:21:50 UTC (rev 1364)
+++ trunk/frontend/lintian	2008-06-08 03:51:27 UTC (rev 1365)
@@ -1357,7 +1357,7 @@
         }
 
 	# perform checks
-	my $collect = Lintian::Collect->new($pkg, $long_type);
+	my $info = Lintian::Collect->new($pkg, $long_type);
 	for my $check (keys %checks) {
 	    my $ci = $check_info{$check};
 
@@ -1381,7 +1381,7 @@
 		next PACKAGE;
 	    }
 
-	    my $returnvalue = Checker::runcheck($pkg, $long_type, $collect, $check);
+	    my $returnvalue = Checker::runcheck($pkg, $long_type, $info, $check);
 	    # Set exit_code correctly if there was not yet an exit code
 	    $exit_code = $returnvalue unless $exit_code;
 

Modified: trunk/lib/Checker.pm
===================================================================
--- trunk/lib/Checker.pm	2008-06-07 09:21:50 UTC (rev 1364)
+++ trunk/lib/Checker.pm	2008-06-08 03:51:27 UTC (rev 1365)
@@ -51,7 +51,7 @@
 }
 
 sub runcheck {
-	my ($pkg, $type, $collect, $name) = @_;
+	my ($pkg, $type, $info, $name) = @_;
 
 	# Will be set to 2 if error is encountered
 	my $return = 0;
@@ -65,7 +65,7 @@
 
 	#print STDERR "Now running $name...\n";
 	$name =~ s/[-.]/_/g;
-	eval { &{'Lintian::'.$name.'::run'}($pkg, $type, $collect) };
+	eval { &{'Lintian::'.$name.'::run'}($pkg, $type, $info) };
 	if ( $@ ) {
 	    print STDERR $@;
 	    print STDERR "internal error: cannot run $name check on package $pkg\n";


Reply to: