1 --- rpm-4.2/scripts/perl.req.wigperl Tue Apr 1 13:33:52 2003
2 +++ rpm-4.2/scripts/perl.req Tue Apr 1 13:39:47 2003
5 # by Ken Estes Mail.com kestes@staff.mail.com
9 +foreach ( @ARGV ? @ARGV : <> ) {
11 if (m=/usr/(sbin|bin|lib|share|X11R6/(lib|bin))/=) {
12 if (! m=(/(doc|man|info|usr/src)/|\.(so|ph|h|html|pod)$)=) {
14 + process_file($_) if -f;
20 - # notice we are passed a list of filenames NOT as common in unix the
21 - # contents of the file.
24 - if (m=/usr/(sbin|bin|lib|share|X11R6/(lib|bin))/=) {
25 - if (! m=(/(doc|man|info|usr/src)/|\.(so|ph|h|html|pod)$)=) {
32 +foreach (sort keys %provide) {
33 + delete $require{$_};
35 +delete $require{the}; # don't count "use the sth" as perl module
38 foreach $module (sort keys %require) {
39 if (length($require{$module}) == 0) {
54 + if ($file =~ /\.(so|ph|h|html|pod|gz|bz2|png|gif|jpg|xpm|a|patch|o|mo)$/) {
57 + # .al, .pl, .pm and .plx (perl-Font-TTF contains *.plx files)
58 + } elsif ($file =~ /\.p[lm]x?$/ || $file =~ /\.al$/) {
60 + #print STDERR "$file PERL by ext\n";
61 + } elsif ($fl =~ m|bin/perl| or $fl =~ m|env\s+perl| or $fl =~ m|exec\s+perl|) {
63 + #print STDERR "$file PERL by perl\n";
64 + } elsif ($fl =~ m|bin/sh|) {
66 + if (/eval/ && /perl/) {
70 + $nw++ if (/^\s*BEGIN/);
71 + $nw++ if (/^\s*sub\s+/);
72 + $nw++ if (/^\s*package\s+/);
73 + $nw++ if (/^\s*use\s+strict\s+;/);
74 + $nw++ if (/^\s*use\s+vars\s*qw/);
81 + $is_perl = 1 if ($nw > 1); # propably perl file
84 + # print STDERR "NOPERL $file\n";
87 + #print STDERR "PERL $file\n" if ($is_perl);
96 open(FILE, "<$file") || return;
98 + return if (!is_perlfile($file, \*FILE));
102 # skip the documentation
107 + if (m/^\s*package\s+([_:a-zA-Z0-9]+)\s*;/) {
111 # Each keyword can appear multiple times. Don't
112 # bother with datastructures to store these strings,
113 # if we need to print it print it now.
116 ($module =~ m/^\./) && next;
118 + # name starts in a non alphanumeric character it is not a module
120 + ($module =~ m/^\W/) && next;
122 # if the module ends with .pm strip it to leave only basename.
124 $module =~ s/\.pm$//;