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