X-Git-Url: http://erislabs.net/gitweb/?p=libwww-opensearch-perl.git;a=blobdiff_plain;f=inc%2FModule%2FInstall%2FWriteAll.pm;h=e6afa424c39a8ccc6f043238c5ab82009591ff02;hp=d0908fb6eba87294feb0b918dd99a893f3b5898e;hb=70fa825da53bce7cee2d56a3a9d3cbeb2b4c7076;hpb=5127c597102ab37e43b89cc43b4d8ea1b34509cd diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm index d0908fb..e6afa42 100644 --- a/inc/Module/Install/WriteAll.pm +++ b/inc/Module/Install/WriteAll.pm @@ -2,42 +2,62 @@ package Module::Install::WriteAll; use strict; -use Module::Install::Base; +use Module::Install::Base (); -use vars qw{$VERSION $ISCORE @ISA}; +use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '0.65'; - $ISCORE = 1; + $VERSION = '0.97';; @ISA = qw{Module::Install::Base}; + $ISCORE = 1; } sub WriteAll { - my $self = shift; - my %args = ( - meta => 1, - sign => 0, - inline => 0, - check_nmake => 1, - @_ - ); - - $self->sign(1) if $args{sign}; - $self->Meta->write if $args{meta}; - $self->admin->WriteAll(%args) if $self->is_admin; - - if ( $0 =~ /Build.PL$/i ) { - $self->Build->write; - } else { - $self->check_nmake if $args{check_nmake}; - unless ( $self->makemaker_args->{'PL_FILES'} ) { - $self->makemaker_args( PL_FILES => {} ); - } - if ($args{inline}) { - $self->Inline->write; - } else { - $self->Makefile->write; - } - } + my $self = shift; + my %args = ( + meta => 1, + sign => 0, + inline => 0, + check_nmake => 1, + @_, + ); + + $self->sign(1) if $args{sign}; + $self->admin->WriteAll(%args) if $self->is_admin; + + $self->check_nmake if $args{check_nmake}; + unless ( $self->makemaker_args->{PL_FILES} ) { + # XXX: This still may be a bit over-defensive... + unless ($self->makemaker(6.25)) { + $self->makemaker_args( PL_FILES => {} ) if -f 'Build.PL'; + } + } + + # Until ExtUtils::MakeMaker support MYMETA.yml, make sure + # we clean it up properly ourself. + $self->realclean_files('MYMETA.yml'); + + if ( $args{inline} ) { + $self->Inline->write; + } else { + $self->Makefile->write; + } + + # The Makefile write process adds a couple of dependencies, + # so write the META.yml files after the Makefile. + if ( $args{meta} ) { + $self->Meta->write; + } + + # Experimental support for MYMETA + if ( $ENV{X_MYMETA} ) { + if ( $ENV{X_MYMETA} eq 'JSON' ) { + $self->Meta->write_mymeta_json; + } else { + $self->Meta->write_mymeta_yaml; + } + } + + return 1; } 1;