The following commit has been merged in the master branch:
commit 3afe583b84d4c75bb96f980bb02e6ca0c8e31e68
Author: Raphael Geissert <[email protected]>
Date:   Sun Feb 20 18:05:37 2011 -0600

    Decrease loop complexity

diff --git a/checks/fields b/checks/fields
index 0a6a9a6..aba3aab 100644
--- a/checks/fields
+++ b/checks/fields
@@ -384,12 +384,10 @@ if (not defined $info->field('source')) {
                if ($source !~ /^[a-z0-9][-+\.a-z0-9]+\z/) {
                        tag 'source-field-malformed', $source;
                }
-       } else {
-               if ($source !~ /^[a-z0-9][-+\.a-z0-9]+ # Package name
-                               \s*
-                               
(?:\((?:\d+:)?(?:[-\.+:a-zA-Z0-9~]+?)(?:-[\.+a-zA-Z0-9~]+)?\))?\s*$/x) { 
#Version
-                       tag 'source-field-malformed', $source;
-               }
+       } elsif ($source !~ /^[a-z0-9][-+\.a-z0-9]+ # Package name
+                       \s*
+                       
(?:\((?:\d+:)?(?:[-\.+:a-zA-Z0-9~]+?)(?:-[\.+a-zA-Z0-9~]+)?\))?\s*$/x) { 
#Version
+               tag 'source-field-malformed', $source;
        }
 }
 
@@ -437,13 +435,13 @@ if (not defined $info->field('section')) {
            # anything go there.
            if ($parts[-1] ne 'oldlibs') {
                    foreach my $map (@NAME_SECTION_MAPPINGS) {
-                           if ($pkg =~ $map->[0]) {
-                                   my $area = '';
-                                   $area = "$parts[0]/" if (scalar @parts == 
2);
-                                   tag 
'wrong-section-according-to-package-name', "$pkg => ${area}$map->[1]"
-                                       unless $parts[-1] eq $map->[1];
-                                   last;
-                           }
+                           next unless ($pkg =~ $map->[0]);
+
+                           my $area = '';
+                           $area = "$parts[0]/" if (scalar @parts == 2);
+                           tag 'wrong-section-according-to-package-name', 
"$pkg => ${area}$map->[1]"
+                               unless $parts[-1] eq $map->[1];
+                           last;
                    }
            }
        }

-- 
Debian package checker


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]

Reply via email to