1 --- rpm-4.0.4/scripts/perl.req.wiget Tue Feb 12 21:49:36 2002
2 +++ rpm-4.0.4/scripts/perl.req Tue Feb 12 21:51:41 2002
7 +foreach (sort keys %provide) {
10 +delete $require{the}; # don't count "use the sth" as perl module
13 foreach $module (sort keys %require) {
14 if (length($require{$module}) == 0) {
29 + if ($file =~ /\.(so|ph|h|html|pod|gz|bz2|png|gif|jpg|xpm|a|patch|o|mo)$/) {
32 + # .al, .pl, .pm and .plx (perl-Font-TTF contains *.plx files)
33 + } elsif ($file =~ /\.p[lm]x?$/ || $file =~ /\.al$/) {
35 + #print STDERR "$file PERL by ext\n";
36 + } elsif ($fl =~ m|bin/perl| or $fl =~ m|env\s+perl| or $fl =~ m|exec\s+perl|) {
38 + #print STDERR "$file PERL by perl\n";
39 + } elsif ($fl =~ m|bin/sh|) {
41 + if (/eval/ && /perl/) {
45 + $nw++ if (/^\s*BEGIN/);
46 + $nw++ if (/^\s*sub\s+/);
47 + $nw++ if (/^\s*package\s+/);
48 + $nw++ if (/^\s*use\s+strict\s+;/);
49 + $nw++ if (/^\s*use\s+vars\s*qw/);
56 + $is_perl = 1 if ($nw > 1); # propably perl file
59 + # print STDERR "NOPERL $file\n";
62 + #print STDERR "PERL $file\n" if ($is_perl);
71 open(FILE, "<$file") || return;
73 + return if (!is_perlfile($file, \*FILE));
77 # skip the documentation
82 + if (m/^\s*package\s+([_:a-zA-Z0-9]+)\s*;/) {
86 # Each keyword can appear multiple times. Don't
87 # bother with datastructures to store these strings,
88 # if we need to print it print it now.
91 ($module =~ m/^\./) && next;
93 + # name starts in a non alphanumeric character it is not a module
95 + ($module =~ m/^\W/) && next;
97 # if the module ends with .pm strip it to leave only basename.