michal-grzedzicki / rpms / rpm

Forked from rpms/rpm 4 months ago
Clone
648606
From 4c621e97776a47c2b4e7f17c1cd2a7961453babf Mon Sep 17 00:00:00 2001
648606
From: Lubos Kardos <lkardos@redhat.com>
648606
Date: Wed, 3 Dec 2014 14:01:14 +0100
648606
Subject: [PATCH 2/2] Ignore "use" or "requires" within multi-line print or
648606
 assign statement
648606
648606
- Now script perl.req ignores "use" and "requires" on lines that are
648606
  part of printing or assigning multi-line string i. e. string that
648606
  hasn't starting and ending quote on the same line.
648606
  (RhBug:1024517)
648606
---
648606
 scripts/perl.req | 13 +++++++++++++
648606
 1 file changed, 13 insertions(+)
648606
648606
diff --git a/scripts/perl.req b/scripts/perl.req
648606
index e17ad5a..6e53c91 100755
648606
--- a/scripts/perl.req
648606
+++ b/scripts/perl.req
648606
@@ -174,6 +174,19 @@ sub process_file {
648606
         $_ = <FILE>;
648606
     }
648606
 
648606
+    # Skip multiline print and assign statements
648606
+    if ( m/\$\S+\s*=\s*(")([^"\\]|(\\.))*$/ ||
648606
+         m/\$\S+\s*=\s*(')([^'\\]|(\\.))*$/ ||
648606
+         m/print\s+(")([^"\\]|(\\.))*$/ ||
648606
+         m/print\s+(')([^'\\]|(\\.))*$/ ) {
648606
+
648606
+        my $quote = $1;
648606
+        while (<FILE>) {
648606
+          m/^([^\\$quote]|(\\.))*$quote/ && last;
648606
+        }
648606
+        $_ = <FILE>;
648606
+    }
648606
+
648606
     if (
648606
 
648606
 # ouch could be in a eval, perhaps we do not want these since we catch
648606
-- 
648606
2.5.5
648606