diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-16 00:37:36 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-16 00:37:36 +0000 |
commit | b972f109af5890881e3a2c54b8e1d4ff84ca62eb (patch) | |
tree | 64f981d500793d10e84f87b671c43f17174d2f42 /Porting | |
parent | 5ae09a77295fca987415b2818894f1f62a4219ba (diff) | |
download | perl-b972f109af5890881e3a2c54b8e1d4ff84ca62eb.tar.gz |
Add Larry Shatzer's VERSION verifying script.
p4raw-id: //depot/perl@13033
Diffstat (limited to 'Porting')
-rw-r--r-- | Porting/checkVERSION.pl | 52 | ||||
-rw-r--r-- | Porting/pumpkin.pod | 3 |
2 files changed, 55 insertions, 0 deletions
diff --git a/Porting/checkVERSION.pl b/Porting/checkVERSION.pl new file mode 100644 index 0000000000..9ad2ff54d8 --- /dev/null +++ b/Porting/checkVERSION.pl @@ -0,0 +1,52 @@ +#!/usr/bin/perl -w + +# +# Check the tree against missing VERSIONs. +# +# Originally by Larry Shatzer +# + +use strict; +use File::Find; + +find( + sub { + return unless -f; + if (/\.pm$/ && $File::Find::name !~ m:/t/:) { # pm but not in a test + unless (parse_file($_)) { + print "$File::Find::name\n"; + } + } + }, @ARGV ? shift : "."); + +sub parse_file { + my $parsefile = shift; + + my $result; + + open(FH,$parsefile) or warn "Could not open '$parsefile': $!"; + + my $inpod = 0; + while (<FH>) { + $inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod; + next if $inpod || /^\s*\#/; + chomp; + next unless /([\$*])(([\w\:\']*)\bVERSION)\b.*\=/; + my $eval = qq{ + package ExtUtils::MakeMaker::_version; + no strict; + local $1$2; + \$$2=undef; do { + $_ + }; \$$2 + }; + no warnings; + $result = eval($eval); + warn "Could not eval '$eval' in $parsefile: $@" if $@; + $result = "undef" unless defined $result; + last; + } + close FH; + return $result; +} + diff --git a/Porting/pumpkin.pod b/Porting/pumpkin.pod index ee866ecae3..42f4428673 100644 --- a/Porting/pumpkin.pod +++ b/Porting/pumpkin.pod @@ -241,6 +241,9 @@ some or all of the modules File::Basename, File::Spec, File::Path, and File::Copy to become aware of your native filesystem syntax and peculiarities. +Remember to have a $VERSION in the modules. You can use the +Porting/checkVERSION.pl script for checking this. + =item documentation If your operating system comes from outside UNIX you almost certainly |