diff options
author | joden <devnull@localhost> | 2004-06-29 00:44:07 +0000 |
---|---|---|
committer | joden <devnull@localhost> | 2004-06-29 00:44:07 +0000 |
commit | db72fdae404aabe204830e38ad91c210563abaed (patch) | |
tree | 40bcf925b02a288c78265de454f0a92212c0f3d4 /scripts/perl.prov | |
parent | 7748d84d5cda2e1dc5844c1ddbdb58ac49ba0354 (diff) | |
download | librpm-tizen-db72fdae404aabe204830e38ad91c210563abaed.tar.gz librpm-tizen-db72fdae404aabe204830e38ad91c210563abaed.tar.bz2 librpm-tizen-db72fdae404aabe204830e38ad91c210563abaed.zip |
Changed spit() to split().
Also, made the places where variables are grokked, allow for "our".
CVS patchset: 7350
CVS date: 2004/06/29 00:44:07
Diffstat (limited to 'scripts/perl.prov')
-rwxr-xr-x | scripts/perl.prov | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/scripts/perl.prov b/scripts/perl.prov index c1e06853c..d423d6ad2 100755 --- a/scripts/perl.prov +++ b/scripts/perl.prov @@ -136,15 +136,15 @@ sub process_file { # here are examples of VERSION lines from the perl distribution - #FindBin.pm:$VERSION = $VERSION = sprintf("%d.%02d", q$Revision: 1.8 $ =~ /(\d+)\.(\d+)/); - #ExtUtils/Install.pm:$VERSION = substr q$Revision: 1.8 $, 10; - #CGI/Apache.pm:$VERSION = (qw$Revision: 1.8 $)[1]; + #FindBin.pm:$VERSION = $VERSION = sprintf("%d.%02d", q$Revision: 1.9 $ =~ /(\d+)\.(\d+)/); + #ExtUtils/Install.pm:$VERSION = substr q$Revision: 1.9 $, 10; + #CGI/Apache.pm:$VERSION = (qw$Revision: 1.9 $)[1]; #DynaLoader.pm:$VERSION = $VERSION = "1.03"; # avoid typo warning - - if ( - ($package) && - (m/^\s*\$VERSION\s*=\s+/) - ) { + # + # or with the new "our" pragma you could (read will) see: + # + # our $VERSION = '1.00' + if (($package) && (m/^\s*(our\s+)?\$VERSION\s*=\s+/)) { # first see if the version string contains the string # '$Revision' this often causes bizzare strings and is the most @@ -160,13 +160,23 @@ sub process_file { } $require{$package}=$version; } - + + # Allow someone to have a variable that defines virtual packages + # The variable is called $RPM_Provides. It must be scoped with + # "our", but not "local" or "my" (just would not make sense). + # + # For instance: + # + # $RPM_Provides = "blah bleah" + # + # Will generate provides for "blah" and "bleah". + # # Each keyword can appear multiple times. Don't # bother with datastructures to store these strings, # if we need to print it print it now. - if ( m/^\s*\$RPM_Provides\s*=\s*["'](.*)['"]/i) { - foreach $_ (spit(/\s+/, $1)) { + if ( m/^\s*(our\s+)?\$RPM_Provides\s*=\s*["'](.*)['"]/i) { + foreach $_ (split(/\s+/, $2)) { print "$_\n"; } } |