alexk / rpms / rpm

Forked from rpms/rpm 2 years ago
Clone
2a5b6a
From 6a8754b2153e0e4305ef2bc5a789bfe02f65e889 Mon Sep 17 00:00:00 2001
2a5b6a
From: Florian Festi <ffesti@redhat.com>
2a5b6a
Date: Tue, 14 Jun 2016 15:01:16 +0200
2a5b6a
Subject: [PATCH] perl.req: Skip over multi line return statements See
2a5b6a
 Rhbz#1275551
2a5b6a
2a5b6a
---
2a5b6a
 scripts/perl.req | 5 +++--
2a5b6a
 1 file changed, 3 insertions(+), 2 deletions(-)
2a5b6a
2a5b6a
diff --git a/scripts/perl.req b/scripts/perl.req
2a5b6a
index f1000c8..7155518 100755
2a5b6a
--- a/scripts/perl.req
2a5b6a
+++ b/scripts/perl.req
2a5b6a
@@ -160,11 +160,12 @@ sub process_file {
2a5b6a
 
2a5b6a
     #
2a5b6a
     # The (require|use) match further down in this subroutine will match lines
2a5b6a
-    # within a multi-line print statement.  So, let's skip over such print
2a5b6a
+    # within a multi-line print or return statements.  So, let's skip over such
2a5b6a
     # statements whose content should not be loading modules anyway. -BEF-
2a5b6a
     #
2a5b6a
     if (m/print(?:\s+|\s+\S+\s+)\<\<\s*(["'`])(.+?)\1/ ||
2a5b6a
-        m/print(\s+|\s+\S+\s+)\<\<(\w+)/) {
2a5b6a
+        m/print(\s+|\s+\S+\s+)\<\<(\w+)/ ||
2a5b6a
+	m/return(\s+)\<\<(\w+)/ ) {
2a5b6a
 
2a5b6a
         my $tag = $2;
2a5b6a
         while (<FILE>) {
2a5b6a
-- 
2a5b6a
2.5.5
2a5b6a