SOURCES (rpm-4_4_9): rpm-perl_req-podimprove.patch (NEW) - improve excludin...

glen glen at pld-linux.org
Fri Oct 24 15:11:25 CEST 2008


Author: glen                         Date: Fri Oct 24 13:11:25 2008 GMT
Module: SOURCES                       Tag: rpm-4_4_9
---- Log message:
- improve excluding matching from pod and heredoc regions (by radek)

---- Files affected:
SOURCES:
   rpm-perl_req-podimprove.patch (NONE -> 1.1.2.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/rpm-perl_req-podimprove.patch
diff -u /dev/null SOURCES/rpm-perl_req-podimprove.patch:1.1.2.1
--- /dev/null	Fri Oct 24 15:11:26 2008
+++ SOURCES/rpm-perl_req-podimprove.patch	Fri Oct 24 15:11:20 2008
@@ -0,0 +1,56 @@
+--- /usr/lib/rpm/perl.req~	2008-10-08 17:55:14.000000000 +0200
++++ /usr/lib/rpm/perl.req	2008-10-12 15:14:19.722811976 +0200
+@@ -140,15 +140,22 @@
+   return if (!is_perlfile($file, \*FILE));
+ 
+   while (<FILE>) {
+-    
+-    # skip the "= <<" block
+ 
+-    if ( ( m/^\s*\$(.*)\s*=\s*<<\s*["'](.*)['"]/) ||
+-         ( m/^\s*\$(.*)\s*=\s*<<\s*(.*);/) ) {
+-      $tag = $2;
+-      while (<FILE>) {
+-        ( $_ =~ /^$tag/) && last;
+-      }
++    # skip the documentation
++    if ( /^ = (?: head\d | pod | item | over | back | (?: begin|end|for ) \s+\S+ ) \b/x ) {
++        $_ = <FILE> until /^=cut/ or eof;
++        next;
++    }
++
++    # naively strip some comments... will screw m/\#/, m##, q##, qw##, qr##, etc, but these don't really matter for us 
++    s/(?<! \\ ) # \b .+ //x;
++
++    # skip the "= <<label", "print <<", "warn <<", "foo(<<label) blocks
++	# note: watch out for the binary << operator and comments
++    if ( m/ (?: = | \b[a-z][a-z_]+\(? ) \s* << \s* (?: q{0,2}(["']) (.+) \1 | ([a-zA-Z][a-zA-Z\d_]*) ) [\s;\)]* $/x ) {
++        my $tag = defined $2 ? $2 : $3;
++        $_ = <FILE> until m/^\Q$tag\E\s*$/ or eof;
++        next;
+     }
+ 
+     # skip q{} quoted sections - just hope we don't have curly brackets
+@@ -157,21 +164,7 @@
+     if ( m/^.*\Wq[qxwr]?\s*([\{\(\[#|\/])[^})\]#|\/]*$/ && ! m/^\s*(require|use)\s/ ) {
+       $tag = $1;
+       $tag =~ tr/{([/})]/;
+-      $_ = <FILE> until m/\Q$tag\E/;
+-    }
+-
+-    # skip the documentation
+-
+-    # we should not need to have item in this if statement (it
+-    # properly belongs in the over/back section) but people do not
+-    # read the perldoc.
+-
+-    if ( (m/^=(head[1-4]|pod|item)/) .. (m/^=(cut)/) ) {
+-      next;
+-    }
+-
+-    if ( (m/^=(over)/) .. (m/^=(back)/) ) {
+-      next;
++      $_ = <FILE> until m/\Q$tag\E/ or eof;
+     }
+     
+     # skip the data section
================================================================


More information about the pld-cvs-commit mailing list