michal-grzedzicki / rpms / rpm

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