648606
From 1d9a0018f9cde8fc5c59df9af70a2164e672210f Mon Sep 17 00:00:00 2001
648606
From: Lubos Kardos <lkardos@redhat.com>
648606
Date: Wed, 25 Nov 2015 13:49:01 +0100
648606
Subject: [PATCH] Improve perl.req script
648606
648606
This commit 0d5929ba5eabadec49273bb090ba9158dfccc30c tries to ignore
648606
"use" and "require" within multi-line print statements that start with
648606
line like this "print <
648606
following format "print <
648606
below this line to the end of file is ignored. That causes that some
648606
requires which was previously found are not found now. This commit
648606
fixes this problem (#1268021).
648606
---
648606
 scripts/perl.req | 6 +++---
648606
 1 file changed, 3 insertions(+), 3 deletions(-)
648606
648606
diff --git a/scripts/perl.req b/scripts/perl.req
648606
index 6e53c91..f1000c8 100755
648606
--- a/scripts/perl.req
648606
+++ b/scripts/perl.req
648606
@@ -163,10 +163,10 @@ sub process_file {
648606
     # within a multi-line print statement.  So, let's skip over such print
648606
     # statements whose content should not be loading modules anyway. -BEF-
648606
     #
648606
-    if ( m/print(\s+|\s+\S+\s+)\<\<(.*)/g ) {
648606
+    if (m/print(?:\s+|\s+\S+\s+)\<\<\s*(["'`])(.+?)\1/ ||
648606
+        m/print(\s+|\s+\S+\s+)\<\<(\w+)/) {
648606
+
648606
         my $tag = $2;
648606
-        $tag =~ s/^\s*['"]?//;       # strip off leading space and quote
648606
-        $tag =~ s/["']?\s*;\s*$//;   # strip off trailing quote and space and semicolon
648606
         while (<FILE>) {
648606
             chomp;
648606
             ( $_ eq $tag ) && last;
648606
-- 
648606
2.5.5
648606