malmond / rpms / rpm

Forked from rpms/rpm 4 years ago
Clone

Blame SOURCES/rpm-4.11.x-perl.req-1.patch

648606
From 4f05fa0e15bcb66d29f89e28829ea43107f6382b Mon Sep 17 00:00:00 2001
648606
From: Lubos Kardos <lkardos@redhat.com>
648606
Date: Mon, 1 Dec 2014 16:04:32 +0100
648606
Subject: [PATCH 1/2] Fix parsing multi-line print statement with unquoted tag
648606
648606
- script perl.req was able to parse only multi-line print statements
648606
  with quoted tag e.g. 'print <<"tag"' or "print <<'tag'". Now it can
648606
  also parse "print <
648606
---
648606
 scripts/perl.req | 4 ++--
648606
 1 file changed, 2 insertions(+), 2 deletions(-)
648606
648606
diff --git a/scripts/perl.req b/scripts/perl.req
648606
index 04f822c..e17ad5a 100755
648606
--- a/scripts/perl.req
648606
+++ b/scripts/perl.req
648606
@@ -165,8 +165,8 @@ sub process_file {
648606
     #
648606
     if ( m/print(\s+|\s+\S+\s+)\<\<(.*)/g ) {
648606
         my $tag = $2;
648606
-        $tag =~ s/^\s*['"]//;       # strip off leading space and quote
648606
-        $tag =~ s/["']\s*;\s*$//;   # strip off trailing quote and space and semicolon
648606
+        $tag =~ s/^\s*['"]?//;       # strip off leading space and quote
648606
+        $tag =~ s/["']?\s*;\s*$//;   # strip off trailing quote and space and semicolon
648606
         while (<FILE>) {
648606
             chomp;
648606
             ( $_ eq $tag ) && last;
648606
-- 
648606
2.5.5
648606