|
Panu Matilainen |
a836ad |
diff -r 9f1a7ebe1223 -r 9f0012fffce1 scripts/perl.req
|
|
Panu Matilainen |
a836ad |
--- a/scripts/perl.req Fri Aug 10 10:02:25 2007 +0200
|
|
Panu Matilainen |
a836ad |
+++ b/scripts/perl.req Fri Aug 10 11:41:24 2007 +0300
|
|
Panu Matilainen |
a836ad |
@@ -1,6 +1,6 @@
|
|
Panu Matilainen |
a836ad |
#!/usr/bin/perl
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
-# RPM (and it's source code) is covered under two separate licenses.
|
|
Panu Matilainen |
a836ad |
+# RPM (and its source code) is covered under two separate licenses.
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
# The entire code base may be distributed under the terms of the GNU
|
|
Panu Matilainen |
a836ad |
# General Public License (GPL), which appears immediately below.
|
|
Panu Matilainen |
a836ad |
@@ -17,7 +17,7 @@
|
|
Panu Matilainen |
a836ad |
# Any questions regarding the licensing of RPM should be addressed to
|
|
Panu Matilainen |
a836ad |
# Erik Troan <ewt@redhat.com>.
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
-# a simple makedepends like script for perl.
|
|
Panu Matilainen |
a836ad |
+# a simple makedepend like script for perl.
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
# To save development time I do not parse the perl grammmar but
|
|
Panu Matilainen |
a836ad |
# instead just lex it looking for what I want. I take special care to
|
|
Panu Matilainen |
a836ad |
@@ -59,9 +59,9 @@ foreach $module (sort keys %require) {
|
|
Panu Matilainen |
a836ad |
print "perl($module)\n";
|
|
Panu Matilainen |
a836ad |
} else {
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
- # I am not using rpm3.0 so I do not want spaces arround my
|
|
Panu Matilainen |
a836ad |
+ # I am not using rpm3.0 so I do not want spaces around my
|
|
Panu Matilainen |
a836ad |
# operators. Also I will need to change the processing of the
|
|
Panu Matilainen |
a836ad |
- # $RPM_* vairable when I upgrage.
|
|
Panu Matilainen |
a836ad |
+ # $RPM_* variable when I upgrade.
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
print "perl($module) >= $require{$module}\n";
|
|
Panu Matilainen |
a836ad |
}
|
|
Panu Matilainen |
a836ad |
@@ -82,11 +82,22 @@ sub process_file {
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
# skip the "= <<" block
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
- if ( ( m/^\s*\$(.*)\s*=\s*<<\s*["'](.*)['"]/i) ||
|
|
Panu Matilainen |
a836ad |
- ( m/^\s*\$(.*)\s*=\s*<<\s*(.*);/i) ) {
|
|
Panu Matilainen |
a836ad |
+ if ( ( m/^\s*\$(.*)\s*=\s*<<\s*["'](.*)['"]/) ||
|
|
Panu Matilainen |
a836ad |
+ ( m/^\s*\$(.*)\s*=\s*<<\s*(.*);/) ) {
|
|
Panu Matilainen |
a836ad |
$tag = $2;
|
|
Panu Matilainen |
a836ad |
while (<FILE>) {
|
|
Panu Matilainen |
a836ad |
( $_ =~ /^$tag/) && last;
|
|
Panu Matilainen |
a836ad |
+ }
|
|
Panu Matilainen |
a836ad |
+ }
|
|
Panu Matilainen |
a836ad |
+
|
|
Panu Matilainen |
a836ad |
+ # skip q{} quoted sections - just hope we don't have curly brackets
|
|
Panu Matilainen |
a836ad |
+ # within the quote, nor an escaped hash mark that isn't a comment
|
|
Panu Matilainen |
a836ad |
+ # marker, such as occurs right here. Draw the line somewhere.
|
|
Panu Matilainen |
a836ad |
+ if ( m/^.*\Wq[qxwr]?\s*([\{\(\[#|\/])[^})\]#|\/]*$/ && ! m/^\s*(require|use)\s/ ) {
|
|
Panu Matilainen |
a836ad |
+ $tag = $1;
|
|
Panu Matilainen |
a836ad |
+ $tag =~ tr/{\(\[\#|\//})]#|\//;
|
|
Panu Matilainen |
a836ad |
+ while (<FILE>) {
|
|
Panu Matilainen |
a836ad |
+ ( $_ =~ m/\}/ ) && last;
|
|
Panu Matilainen |
a836ad |
}
|
|
Panu Matilainen |
a836ad |
}
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
@@ -153,7 +164,7 @@ sub process_file {
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
($module =~ m/\$/) && next;
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
- # skip if the phrase was "use of" -- shows up in gimp-perl, et al
|
|
Panu Matilainen |
a836ad |
+ # skip if the phrase was "use of" -- shows up in gimp-perl, et al.
|
|
Panu Matilainen |
a836ad |
next if $module eq 'of';
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
# if the module ends in a comma we probaly caught some
|
|
Panu Matilainen |
a836ad |
@@ -175,7 +186,7 @@ sub process_file {
|
|
Panu Matilainen |
a836ad |
next;
|
|
Panu Matilainen |
a836ad |
}
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
- # sometimes people do use POSIX qw(foo), or use POSIX(qw(foo)) etc
|
|
Panu Matilainen |
a836ad |
+ # sometimes people do use POSIX qw(foo), or use POSIX(qw(foo)) etc.
|
|
Panu Matilainen |
a836ad |
# we can strip qw.*$, as well as (.*$:
|
|
Panu Matilainen |
a836ad |
$module =~ s/qw.*$//;
|
|
Panu Matilainen |
a836ad |
$module =~ s/\(.*$//;
|
|
Panu Matilainen |
a836ad |
@@ -187,7 +198,7 @@ sub process_file {
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
$module =~ s/\//::/;
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
- # trim off trailing parenthesis if any. Sometimes people pass
|
|
Panu Matilainen |
a836ad |
+ # trim off trailing parentheses if any. Sometimes people pass
|
|
Panu Matilainen |
a836ad |
# the module an empty list.
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
$module =~ s/\(\s*\)$//;
|
|
Panu Matilainen |
a836ad |
@@ -208,7 +219,7 @@ sub process_file {
|
|
Panu Matilainen |
a836ad |
};
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
# ph files do not use the package name inside the file.
|
|
Panu Matilainen |
a836ad |
- # perlmodlib documentation says:
|
|
Panu Matilainen |
a836ad |
+ # perlmodlib documentation says:
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
# the .ph files made by h2ph will probably end up as
|
|
Panu Matilainen |
a836ad |
# extension modules made by h2xs.
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
diff -r fb37e4dccbf3 -r 0408b648de46 scripts/perl.prov
|
|
Panu Matilainen |
a836ad |
--- a/scripts/perl.prov Sat Jul 21 15:05:19 2007 +0300
|
|
Panu Matilainen |
a836ad |
+++ b/scripts/perl.prov Sat Jul 21 15:48:03 2007 +0300
|
|
Panu Matilainen |
a836ad |
@@ -144,11 +144,12 @@ sub process_file {
|
|
Panu Matilainen |
a836ad |
#ExtUtils/Install.pm:$VERSION = substr q$Revision: 1.9 $, 10;
|
|
Panu Matilainen |
a836ad |
#CGI/Apache.pm:$VERSION = (qw$Revision: 1.9 $)[1];
|
|
Panu Matilainen |
a836ad |
#DynaLoader.pm:$VERSION = $VERSION = "1.03"; # avoid typo warning
|
|
Panu Matilainen |
a836ad |
+ #General.pm:$Config::General::VERSION = 2.33;
|
|
Panu Matilainen |
a836ad |
#
|
|
Panu Matilainen |
a836ad |
# or with the new "our" pragma you could (read will) see:
|
|
Panu Matilainen |
a836ad |
#
|
|
Panu Matilainen |
a836ad |
# our $VERSION = '1.00'
|
|
Panu Matilainen |
a836ad |
- if (($package) && (m/^\s*(our\s+)?\$VERSION\s*=\s+/)) {
|
|
Panu Matilainen |
a836ad |
+ if (($package) && (m/^\s*(our\s+)?\$(\Q$package\E::)?VERSION\s*=\s+/)) {
|
|
Panu Matilainen |
a836ad |
|
|
Panu Matilainen |
a836ad |
# first see if the version string contains the string
|
|
Panu Matilainen |
a836ad |
# '$Revision' this often causes bizzare strings and is the most
|
|
Panu Matilainen |
a836ad |
|