diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-17 03:16:40 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-17 03:16:40 +0100 |
commit | 41f36a2a7ca5bccddba4401dcfd49cc403b45364 (patch) | |
tree | 6c94690685cca0547054fdf1a6af391cf3316370 /inc/Module/Install/WriteAll.pm | |
parent | e0ebb260d85560d4e159bc4b748519b4207592db (diff) | |
download | vserver-perl-41f36a2a7ca5bccddba4401dcfd49cc403b45364.tar.gz vserver-perl-41f36a2a7ca5bccddba4401dcfd49cc403b45364.tar.bz2 vserver-perl-41f36a2a7ca5bccddba4401dcfd49cc403b45364.zip |
Module::Install: add to distribution1.0
Diffstat (limited to 'inc/Module/Install/WriteAll.pm')
-rw-r--r-- | inc/Module/Install/WriteAll.pm | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm new file mode 100644 index 0000000..d0f6599 --- /dev/null +++ b/inc/Module/Install/WriteAll.pm @@ -0,0 +1,63 @@ +#line 1 +package Module::Install::WriteAll; + +use strict; +use Module::Install::Base (); + +use vars qw{$VERSION @ISA $ISCORE}; +BEGIN { + $VERSION = '1.00'; + @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->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; |