#!/usr/bin/perl
-# RPM (and it's source code) is covered under two separate licenses.
+# RPM (and its source code) is covered under two separate licenses.
# The entire code base may be distributed under the terms of the GNU
# General Public License (GPL), which appears immediately below.
# Any questions regarding the licensing of RPM should be addressed to
# Erik Troan <ewt@redhat.com>.
-# a simple makedepends like script for perl.
+# a simple makedepend like script for perl.
# To save development time I do not parse the perl grammmar but
# instead just lex it looking for what I want. I take special care to
print "perl($module)\n";
} else {
- # I am not using rpm3.0 so I do not want spaces arround my
+ # I am not using rpm3.0 so I do not want spaces around my
# operators. Also I will need to change the processing of the
- # $RPM_* vairable when I upgrage.
+ # $RPM_* variable when I upgrade.
print "perl($module) >= $require{$module}\n";
}
# skip the "= <<" block
- if ( ( m/^\s*\$(.*)\s*=\s*<<\s*["'](.*)['"]/i) ||
- ( m/^\s*\$(.*)\s*=\s*<<\s*(.*);/i) ) {
+ if ( ( m/^\s*\$(.*)\s*=\s*<<\s*["'](.*)['"]/) ||
+ ( m/^\s*\$(.*)\s*=\s*<<\s*(.*);/) ) {
$tag = $2;
while (<FILE>) {
( $_ =~ /^$tag/) && last;
}
}
+ # skip q{} quoted sections - just hope we don't have curly brackets
+ # within the quote, nor an escaped hash mark that isn't a comment
+ # marker, such as occurs right here. Draw the line somewhere.
+ if ( m/^.*\Wq[qxwr]?\s*([\{\(\[#|\/])[^})\]#|\/]*$/ && ! m/^\s*(require|use)\s/ ) {
+ $tag = $1;
+ $tag =~ tr/{\(\[\#|\//})]#|\//;
+ while (<FILE>) {
+ ( $_ =~ m/\}/ ) && last;
+ }
+ }
+
# skip the documentation
# we should not need to have item in this if statement (it
($module =~ m/\$/) && next;
- # skip if the phrase was "use of" -- shows up in gimp-perl, et al
+ # 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
next;
}
- # sometimes people do use POSIX qw(foo), or use POSIX(qw(foo)) etc
+ # sometimes people do use POSIX qw(foo), or use POSIX(qw(foo)) etc.
# we can strip qw.*$, as well as (.*$:
$module =~ s/qw.*$//;
$module =~ s/\(.*$//;
$module =~ s/\//::/;
- # trim off trailing parenthesis if any. Sometimes people pass
+ # trim off trailing parentheses if any. Sometimes people pass
# the module an empty list.
$module =~ s/\(\s*\)$//;
};
# ph files do not use the package name inside the file.
- # perlmodlib documentation says:
+ # perlmodlib documentation says:
# the .ph files made by h2ph will probably end up as
# extension modules made by h2xs.