diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2010-02-13 11:04:17 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-02-15 08:44:51 +0200 |
commit | 56e8074b47cdb8755aa66d65424af170ffdd35bb (patch) | |
tree | 95910feab2b39037d01e518af07f7481f27e9c1e /scripts | |
parent | 38de3b54f8af1bf91eda2dfd840a36e0808307f1 (diff) | |
download | rpm-56e8074b47cdb8755aa66d65424af170ffdd35bb.tar.gz rpm-56e8074b47cdb8755aa66d65424af170ffdd35bb.tar.bz2 rpm-56e8074b47cdb8755aa66d65424af170ffdd35bb.zip |
Trivial perl.req cleanups.
Drop dead code, comment fixes, weed out duplicate dependencies to perl
(done by rpm itself anyway, but does not hurt to do it already on this
level for cleaner results when testing).
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/perl.req | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/scripts/perl.req b/scripts/perl.req index 9d609fa36..5880adb48 100755 --- a/scripts/perl.req +++ b/scripts/perl.req @@ -19,7 +19,7 @@ # a simple makedepend like script for perl. -# To save development time I do not parse the perl grammmar but +# To save development time I do not parse the perl grammar but # instead just lex it looking for what I want. I take special care to # ignore comments and pod's. @@ -54,6 +54,9 @@ if ("@ARGV") { } +foreach $perlver (sort keys %perlreq) { + print "perl >= $perlver\n"; +} foreach $module (sort keys %require) { if (length($require{$module}) == 0) { print "perl($module)\n"; @@ -151,7 +154,7 @@ sub process_file { \s*([.0-9]*) /x) ) { - my ($whitespace, $statement, $module, $version) = ($1, $2, $3,$4); + my ($whitespace, $statement, $module, $version) = ($1, $2, $3, $4); # we only consider require statements that are flush against # the left edge. any other require statements give too many @@ -169,7 +172,7 @@ sub process_file { # skip if the phrase was "use of" -- shows up in gimp-perl, et al. next if $module eq 'of'; - # if the module ends in a comma we probaly caught some + # if the module ends in a comma we probably caught some # documentation of the form 'check stuff,\n do stuff, clean # stuff.' there are several of these in the perl distribution @@ -181,8 +184,7 @@ sub process_file { # ($module =~ m/^\./) && next; - # if the module ends with .pm strip it to leave only basename. - # starts with /, which means its an absolute path to a file + # if the module starts with /, it is an absolute path to a file if ($module =~ m(^/)) { print "$module\n"; next; @@ -193,6 +195,7 @@ sub process_file { $module =~ s/qw.*$//; $module =~ s/\(.*$//; + # if the module ends with .pm, strip it to leave only basename. $module =~ s/\.pm$//; # some perl programmers write 'require URI/URL;' when @@ -211,11 +214,11 @@ sub process_file { my $ver = $1; if ($ver =~ /5.00/) { - print "perl >= 0:$ver\n"; + $perlreq{"0:$ver"} = 1; next; } else { - print "perl >= 1:$ver\n"; + $perlreq{"1:$ver"} = 1; next; } @@ -237,7 +240,6 @@ sub process_file { ($module =~ m/\.ph$/) && next; $require{$module} = $version; - $line{$module} = $_; } } |