Explorar o código

perl: Fix various perl critic regressions

Guillem Jover %!s(int64=10) %!d(string=hai) anos
pai
achega
7fdaf8df98

+ 1 - 1
lib/dpkg/t/t-tree.t

@@ -124,7 +124,7 @@ sub test_treewalker {
 
         find({ no_chdir => 1, wanted => sub {
                    return if $type eq 'skip' and m{^\Q$dirtree\E/cccc};
-                   push @paths, $_ =~ s{\./}{}r;
+                   push @paths, s{\./}{}r;
                },
              }, $dirtree);
 

+ 5 - 5
lib/dpkg/t/t-trigdeferred.t

@@ -109,13 +109,13 @@ sub test_trigdeferred {
               nocheck => 1, to_string => \$stdout, error_to_string => \$stderr);
         my $exitcode = $? >> 8;
 
-        is($exitcode, $test->{exitcode}, "trigger deferred expected exitcode");
+        is($exitcode, $test->{exitcode}, 'trigger deferred expected exitcode');
         if ($test->{exitcode} == 0) {
-            is($stderr, '', "trigger deferred expected stderr");
-            is($stdout, $test->{expected}, "trigger deferred expected stdout");
+            is($stderr, '', 'trigger deferred expected stderr');
+            is($stdout, $test->{expected}, 'trigger deferred expected stdout');
         } else {
-            isnt($stderr, '', "trigger deferred expected stderr");
-            isnt($stdout, undef, "trigger deferred expected stdout");
+            isnt($stderr, '', 'trigger deferred expected stderr');
+            isnt($stdout, undef, 'trigger deferred expected stdout');
         }
     }
 }

+ 1 - 1
scripts/Dpkg/Arch.pm

@@ -545,7 +545,7 @@ sub debarch_is_illegal
 {
     my ($arch) = @_;
 
-    return $arch !~ m/^(!?[a-zA-Z0-9][a-zA-Z0-9-]*)$/;
+    return $arch !~ m/^!?[a-zA-Z0-9][a-zA-Z0-9-]*$/;
 }
 
 =item $bool = debarch_is_concerned($arch, @arches)

+ 2 - 2
scripts/Dpkg/Source/Patch.pm

@@ -495,8 +495,8 @@ sub analyze {
 
             if ($opts{fatal_dupes}) {
                 error(g_("diff '%s' patches files multiple times; split the " .
-                         "diff in multiple files or merge the hunks into a " .
-                         "single one"), $diff);
+                         'diff in multiple files or merge the hunks into a ' .
+                         'single one'), $diff);
             } elsif ($opts{verbose} and $filepatched{$fn} == 2) {
                 warning(g_("diff '%s' patches file %s more than once"), $diff, $fn)
             }

+ 2 - 2
scripts/dpkg-source.pl

@@ -551,12 +551,12 @@ sub get_format_help {
     if ($help_build) {
         $help .= "\n";
         $help .= "Build format $build_format options:\n";
-        $help .= $help_build || g_("<none>");
+        $help .= $help_build || g_('<none>');
     }
     if ($help_extract) {
         $help .= "\n";
         $help .= "Extract format $build_format options:\n";
-        $help .= $help_extract || g_("<none>");
+        $help .= $help_extract || g_('<none>');
     }
 
     return $help;