chantra / rpms / rpm

Forked from rpms/rpm 2 years 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] Ignore "use" or "requires" within multi-line print or assign
648606
 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
--- rpm-4.8.0/scripts/perl.req.ignore-multiline2
648606
+++ rpm-4.8.0/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
1.9.3
648606