diff options
Diffstat (limited to 'cpan/Devel-PPPort/devel/scanprov')
-rw-r--r-- | cpan/Devel-PPPort/devel/scanprov | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/cpan/Devel-PPPort/devel/scanprov b/cpan/Devel-PPPort/devel/scanprov index 19d294472a..b958eca7c1 100644 --- a/cpan/Devel-PPPort/devel/scanprov +++ b/cpan/Devel-PPPort/devel/scanprov @@ -5,13 +5,13 @@ # ################################################################################ # -# $Revision: 9 $ +# $Revision: 11 $ # $Author: mhx $ -# $Date: 2009/01/18 14:10:50 +0100 $ +# $Date: 2010/03/07 13:15:42 +0100 $ # ################################################################################ # -# Version 3.x, Copyright (C) 2004-2009, Marcus Holland-Moritz. +# Version 3.x, Copyright (C) 2004-2010, Marcus Holland-Moritz. # Version 2.x, Copyright (C) 2001, Paul Marquess. # Version 1.x, Copyright (C) 1999, Kenneth Albanowski. # @@ -21,10 +21,19 @@ ################################################################################ use strict; +use Getopt::Long; + require 'parts/ppptools.pl'; -die "Usage: $0 [check|write]\n" unless @ARGV && $ARGV[0] =~ /^(check|write)$/; -my $mode = $1; +our %opt = ( + mode => 'check', + install => '/tmp/perl/install/default', + blead => 'bleadperl', +); + +GetOptions(\%opt, qw( install=s mode=s blead=s )) or die; + +my $write = $opt{mode} eq 'write'; my %embed = map { ( $_->{name} => 1 ) } parse_embed(qw(parts/embed.fnc parts/apidoc.fnc parts/ppport.fnc )); @@ -33,11 +42,9 @@ my @provided = grep { !exists $embed{$_} } map { /^(\w+)/ ? $1 : () } `$^X ppport.h --list-provided`; -my $install = '/tmp/perl/install/default'; - my @perls = sort { $b->{version} <=> $a->{version} } map { { version => `$_ -e 'printf "%.6f", \$]'`, path => $_ } } - ('bleadperl', glob "$install/*/bin/perl5.*"); + ($opt{blead}, glob "$opt{install}/*/bin/perl5.*"); for (1 .. $#perls) { $perls[$_]{todo} = $perls[$_-1]{version}; @@ -68,10 +75,10 @@ for my $v (keys %v) { $file = "$out/$file"; -e $file or die "non-existent: $file\n"; print "-- $file --\n"; - $mode eq 'write' and (open F, ">>$file" or die "$file: $!\n"); + $write and (open F, ">>$file" or die "$file: $!\n"); for (@new) { print "adding $_\n"; - $mode eq 'write' and printf F "%-30s # added by $0\n", $_; + $write and printf F "%-30s # added by $0\n", $_; } - $mode eq 'write' and close F; + $write and close F; } |