Browse Source

Dpkg::Deps: Use braces for multiline regexp

Fixes RegularExpressions::RequireBracesForMultiline.

Warned-by: perlcritic
Guillem Jover 11 years ago
parent
commit
8d9cf6246f
2 changed files with 3 additions and 2 deletions
  1. 2 2
      scripts/Dpkg/Deps.pm
  2. 1 0
      test/100_critic.t

+ 2 - 2
scripts/Dpkg/Deps.pm

@@ -585,7 +585,7 @@ sub parse {
 sub parse_string {
     my ($self, $dep) = @_;
     return if not $dep =~
-            /^\s*                           # skip leading whitespace
+           m{^\s*                           # skip leading whitespace
               ([a-zA-Z0-9][a-zA-Z0-9+.-]*)  # package name
               (?:                           # start of optional part
                 :                           # colon for architecture
@@ -603,7 +603,7 @@ sub parse_string {
                 \s* \]                      # closing bracket
               )?                            # end of optional architecture
 	      \s*$			    # trailing spaces at end
-            /x;
+            }x;
     if (defined($2)) {
 	return if $2 eq 'native' and not $self->{build_dep};
 	$self->{archqual} = $2;

+ 1 - 0
test/100_critic.t

@@ -67,6 +67,7 @@ my @policies = qw(
     Modules::RequireExplicitPackage
     Modules::RequireFilenameMatchesPackage
     Objects::ProhibitIndirectSyntax
+    RegularExpressions::RequireBracesForMultiline
     Subroutines::ProhibitExplicitReturnUndef
     Subroutines::ProhibitNestedSubs
     Subroutines::ProhibitReturnSort