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

[SCM] Debian package checker branch, master, updated. 2.5.9-33-g4e75052



The following commit has been merged in the master branch:
commit 4e75052c275800eef695e59ab19f87a000a15f5c
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Jun 30 13:13:46 2012 +0200

    L::CheckScript: Make needs_info return an array
    
    For consistency with L::CollScript's method of same name and because
    every use of needs_info involved was surrounded in "@{}" already.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/frontend/lintian b/frontend/lintian
index 5451662..a60c9c9 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -1071,7 +1071,7 @@ if ($action eq 'check') {
     # determine which info is needed by the checks
     for my $c (sort $PROFILE->scripts) {
         my $cs = $PROFILE->get_script($c);
-        for my $i (@{ $cs->needs_info }) {
+        for my $i ($cs->needs_info) {
             $unpack_infos{$i} = 1;
             $requested_unpack{$i} = 1;
         }
@@ -1139,8 +1139,8 @@ for my $c (@scripts) {
     # Add the checks with their dependency information
     my $cs = $PROFILE->get_script ($c);
     $map->add('check-' . $c, $cs);
-    if (@{ $cs->needs_info }) {
-        $map->addp('check-' . $c, 'coll-', @{ $cs->needs_info });
+    if ($cs->needs_info) {
+        $map->addp('check-' . $c, 'coll-', $cs->needs_info);
     }
 }
 # }}}
diff --git a/lib/Lintian/CheckScript.pm b/lib/Lintian/CheckScript.pm
index 196d8de..082301a 100644
--- a/lib/Lintian/CheckScript.pm
+++ b/lib/Lintian/CheckScript.pm
@@ -44,7 +44,7 @@ Lintian::CheckScript - Check script meta data
     print "$tag is a part of the check $name\n";
     # Do something with $ti / $tag
  }
- foreach my $needs (@{ $cs->needs_info }) {
+ foreach my $needs ($cs->needs_info) {
     print "$name needs $needs\n";
  }
  if ($cs->is_check_type ('binary') && $cs->is_check_type ('source')) {
@@ -129,14 +129,21 @@ lintian.desc, where this field is simply not present.
 
 Returns the value of the Abbrev field from the desc file.
 
-=item $cs->needs_info
+=cut
+
+Lintian::CheckScript->mk_ro_accessors (qw(name script_pkg type abbrev));
+
+=item needs_info
 
-Returns a listref of all items listed in the Needs-Info field.
-Neither the listref nor its contents should be modified.
+Returns a list of all items listed in the Needs-Info field.  Neither
+the list nor its contents should be modified.
 
 =cut
 
-Lintian::CheckScript->mk_ro_accessors (qw(name script_pkg type abbrev needs_info));
+sub needs_info {
+    my ($self) = @_;
+    return @{ $self->{'needs_info'} };
+}
 
 =item $cs->is_check_type ($type)
 

-- 
Debian package checker


Reply to: