]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-perl_req-heredocs_pod.patch
- added helperEVR-noassert patch (replace assert by error message;
[packages/rpm.git] / rpm-perl_req-heredocs_pod.patch
1 --- rpm-5.1.4/scripts/perl.req.in.orig  2008-10-26 10:26:43.622757203 +0100
2 +++ rpm-5.1.4/scripts/perl.req  2008-10-26 10:26:48.452756609 +0100
3 @@ -140,15 +140,22 @@
4    return if (!is_perlfile($file, \*FILE));
5  
6    while (<FILE>) {
7 -    
8 -    # skip the "= <<" block
9  
10 -    if ( ( m/^\s*\$(.*)\s*=\s*<<\s*["'](.*)['"]/) ||
11 -         ( m/^\s*\$(.*)\s*=\s*<<\s*(.*);/) ) {
12 -      $tag = $2;
13 -      while (<FILE>) {
14 -        ( $_ =~ /^$tag/) && last;
15 -      }
16 +    # skip the documentation
17 +    if ( /^ = (?: head\d | pod | item | over | back | (?: begin|end|for ) \s+\S+ ) \b/x ) {
18 +        $_ = <FILE> until /^=cut/ or eof;
19 +        next;
20 +    }
21 +
22 +    # naively strip some comments... will screw m/\#/, m##, q##, qw##, qr##, etc, but these don't really matter for us 
23 +    s/(?<! \\ ) # \b .+ //x;
24 +
25 +    # skip the "= <<label", "print <<", "warn <<", "foo(<<label) blocks
26 +    # note: watch out for the binary << operator and comments
27 +    if ( m/ (?: = | \b[a-z][a-z_]+\(? ) \s* << \s* (?: q{0,2}(["']) (.+) \1 | ([a-zA-Z][a-zA-Z\d_]*) ) [\s;\)]* $/x ) {
28 +        my $tag = defined $2 ? $2 : $3;
29 +        $_ = <FILE> until m/^\Q$tag\E\s*$/ or eof;
30 +        next;
31      }
32  
33      # skip q{} quoted sections - just hope we don't have curly brackets
34 @@ -157,21 +164,7 @@
35      if ( m/^.*\Wq[qxwr]?\s*([\{\(\[#|\/])[^})\]#|\/]*$/ && ! m/^\s*(require|use)\s/ ) {
36        $tag = $1;
37        $tag =~ tr/{([/})]/;
38 -      $_ = <FILE> until m/\Q$tag\E/;
39 -    }
40 -
41 -    # skip the documentation
42 -
43 -    # we should not need to have item in this if statement (it
44 -    # properly belongs in the over/back section) but people do not
45 -    # read the perldoc.
46 -
47 -    if ( (m/^=(head[1-4]|pod|item)/) .. (m/^=(cut)/) ) {
48 -      next;
49 -    }
50 -
51 -    if ( (m/^=(over)/) .. (m/^=(back)/) ) {
52 -      next;
53 +      $_ = <FILE> until m/\Q$tag\E/ or eof;
54      }
55      
56      # skip the data section
This page took 0.027403 seconds and 3 git commands to generate.