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
4 return if (!is_perlfile($file, \*FILE));
8 - # skip the "= <<" block
10 - if ( ( m/^\s*\$(.*)\s*=\s*<<\s*["'](.*)['"]/) ||
11 - ( m/^\s*\$(.*)\s*=\s*<<\s*(.*);/) ) {
14 - ( $_ =~ /^$tag/) && last;
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;
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;
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;
33 # skip q{} quoted sections - just hope we don't have curly brackets
35 if ( m/^.*\Wq[qxwr]?\s*([\{\(\[#|\/])[^})\]#|\/]*$/ && ! m/^\s*(require|use)\s/ ) {
38 - $_ = <FILE> until m/\Q$tag\E/;
41 - # skip the documentation
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
47 - if ( (m/^=(head[1-4]|pod|item)/) .. (m/^=(cut)/) ) {
51 - if ( (m/^=(over)/) .. (m/^=(back)/) ) {
53 + $_ = <FILE> until m/\Q$tag\E/ or eof;
56 # skip the data section