chantra / rpms / rpm

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