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
4 eval { require version; $HAVE_VERSION = 1; };
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
37 foreach $perlver (sort keys %perlreq) {
38 print "perl >= $perlver\n";
53 + if ($file =~ /\.(so|ph|h|html|pod|gz|bz2|png|gif|jpg|xpm|a|patch|o|mo)$/) {
56 + # .al, .pl, .pm and .plx (perl-Font-TTF contains *.plx files)
57 + } elsif ($file =~ /\.p[lm]x?$/ || $file =~ /\.al$/) {
59 + #print STDERR "$file PERL by ext\n";
60 + } elsif ($fl =~ m|bin/perl| or $fl =~ m|env\s+perl| or $fl =~ m|exec\s+perl|) {
62 + #print STDERR "$file PERL by perl\n";
63 + } elsif ($fl =~ m|bin/sh|) {
65 + if (/eval/ && /perl/) {
69 + $nw++ if (/^\s*BEGIN/);
70 + $nw++ if (/^\s*sub\s+/);
71 + $nw++ if (/^\s*package\s+/);
72 + $nw++ if (/^\s*use\s+strict\s+;/);
73 + $nw++ if (/^\s*use\s+vars\s*qw/);
80 + $is_perl = 1 if ($nw > 1); # propably perl file
83 + # print STDERR "NOPERL $file\n";
86 + #print STDERR "PERL $file\n" if ($is_perl);
97 + return if (!is_perlfile($file, \*FILE));
101 # skip the "= <<" block
106 + if (m/^\s*package\s+([_:a-zA-Z0-9]+)\s*;/) {
110 # Each keyword can appear multiple times. Don't
111 # bother with datastructures to store these strings,
112 # if we need to print it print it now.
115 ($module =~ m/^\./) && next;
117 + # name starts in a non alphanumeric character it is not a module
119 + ($module =~ m/^\W/) && next;
121 # if the module ends with .pm strip it to leave only basename.
123 $module =~ s/\.pm$//;