Fix brace matching on multiline constructs in perl.req (RhBug:752119)

- /usr/lib/rpm/perl.req scans for the opening brace type on lines, but
  then only scans for closing curly braces ('}') instead of the proper
  losing brace type when that closing brace occures on a different line.
  This means that any use/require statements that occur after the
  multi-line q{} statement but before the first closing curly brace in
  the file will be ignored.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
This commit is contained in:
Joshua Megerman 2011-12-14 17:03:29 +02:00 committed by Panu Matilainen
parent 139105056d
commit d936230973
1 changed files with 2 additions and 1 deletions

View File

@ -120,8 +120,9 @@ sub process_file {
if ( m/^.*\Wq[qxwr]?\s*([{([#|\/])[^})\]#|\/]*$/ && ! m/^\s*(require|use)\s/ ) {
$tag = $1;
$tag =~ tr/{\(\[\#|\//})]#|\//;
$tag = quotemeta($tag);
while (<FILE>) {
( $_ =~ m/\}/ ) && last;
( $_ =~ m/$tag/ ) && last;
}
}