This patch addresses an issue in perl.req, where it matches on "use" or
"requires" lines within a multi-line print statement, such as:

    print << "EOF";
    Usage:  $progname [OPTION...] [--auto-detect | controller1 controller2...]
Options can be abbreviated to minimum uniqueness. For example, you could
         use "-h" or "--h" instead of "--help".
EOF


Which results in something like this:

    [$] /usr/lib/rpm/perl.req.orig my_perl_executable
    perl(-h)
    perl(File::Basename)
    perl(Getopt::Long)
    perl(strict)


Which ultimately results in an RPM dependency that cannot be satisfied.
;-)


Cheers,

-Brian



--
Brian Elliott Finley
Mobile: 469.444.0167
--- /usr/lib/rpm/perl.req.orig	2013-12-10 14:09:02.045690478 -0600
+++ /usr/lib/rpm/perl.req	2013-12-10 14:09:10.329690383 -0600
@@ -39,6 +39,9 @@
 
 # by Ken Estes Mail.com [email protected]
 
+# 2013.12.10 Brian Elliott Finley <[email protected]>
+# - Don't match use or requires within a multi-line print statement -BEF-
+
 $HAVE_VERSION = 0;
 eval { require version; $HAVE_VERSION = 1; };
 
@@ -158,6 +161,22 @@
 
     my $modver_re = qr/[.0-9]+/;
 
+    #
+    # The (require|use) match further down in this subroutine will match lines
+    # within a multi-line print statement.  So, let's skip over such print
+    # statements whose content should not be loading modules anyway. -BEF-
+    #
+    if ( m/print(\s+|\s+\S+\s+)\<\<(.*)/g ) {
+        my $tag = $2;
+        $tag =~ s/^\s*['"]//;       # strip off leading space and quote
+        $tag =~ s/["']\s*;\s*$//;   # strip off trailing quote and space and semicolon
+        while (<FILE>) {
+            chomp;
+            ( $_ eq $tag ) && last;
+        }
+        $_ = <FILE>;
+    }
+
     if (
 
 # ouch could be in a eval, perhaps we do not want these since we catch
_______________________________________________
Rpm-maint mailing list
[email protected]
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to