Win32-CommandLine
view release on metacpan or search on metacpan
## no critic ( CodeLayout::ProhibitParensWithBuiltins RequireExtendedFormatting RequireLineBoundaryMatching RequireCarping )
## ToDO: expand upon assert_os to allow or disallow OS subtypes (Win9x, XP, ME, etc)
## TODO?: remove the '_' from the version for output dist files (>> will this cause a problem for PPM or CPAN with some sort of version mismatch between filename and META.yml
## TODO?: .. or just remove VERSION code generating the alpha '_' within the version? does it matter? does the '_' interfere with version comparisons on CPAN?
## ...... these don't seem to be a problem
# ToDO: open a defect ticket about error leakage for checking compiler presence in ExtUtils::CBuilder :: should be done in CBuilder with STDERR redirect
# ToDO: open a defect ticket about error leakage for checking gpg presence in Module::Signature :: should be done in Module::Signature with STDERR redirect
## # EG: #>perl -e "use File::Spec; $n = File::Spec->devnull(); if (qx{gpg --version 2>$n} =~ /GnuPG.*?\s*([0-9.]+)\s*$/m) { $h = $1 } else { $h = qq{NULL}; }; print $h"
## TODO: add an 'upload' action to use cpan_upload... to upload the basic distribution to CPAN
## : depends(testall) without errors
## ToDO: redirect STDERR to STDOUT for skipcheck (currently all output goes to STDERR)
## TODO: flesh out stub documentation for additional custom actions
## TODO: add/check compatibility for use of module PPM when installed (for non-ActiveState perl distributions)
#[ADD] NEW action = taint_test - run all regression tests (via testall) with taint-mode ON
sub ACTION_taint_testall {
my $self = shift;
$self->notes('taintcheck' => 1);
$self->ACTION_testall( @_ );
}
};
$code{'ACTION_sign@_sign_dir'} = q{
sub _MY_module_signature_has_gpg {
my $null = File::Spec->devnull();
if (qx{gpg --version 2>$null} =~ /GnuPG.*?\s*([0-9.]+)\s*$/msx) {
return $1
}
else { return; }
}
sub _sign_dir {
my ($self, $dir) = @_;
if (($ENV{AUTOMATED_TESTING} or $ENV{CI}) and (not $ENV{AUTOMATED_SIGNATURE})) {
$self->log_warn("Automated and/or CI testing detected; signing is disabled [to enable: set AUTOMATED_SIGNATURE]\n");
return;
}
unless (eval { require Module::Signature; 1 }) {
$self->log_warn("Missing required Module::Signature; unable to sign the distribution\n");
return;
}
## override Module::Signature (based on VERSION) to quiet _has_gpg()
## : add $Module::Signature::VERSION gating when appropriate (upstream fixed)
## : [2013-12-29] as of v0.69, $Module::Signature has an improved gpg detection routine _which_gpg() which has no error output and detects gpg2, etc
if ( $Module::Signature::VERSION < 0.69 ) {
print "MY_has_gpg\n";
my $codeRef = \&_MY_module_signature_has_gpg;
{no warnings 'redefine';
*Module::Signature::_has_gpg = $codeRef;
}
}
# Add SIGNATURE to the MANIFEST
{
my $manifest = File::Spec->catfile($dir, 'MANIFEST');
die "Signing a distribution requires a MANIFEST file\n" unless -e $manifest;
#$self->_add_to_manifest($manifest, "SIGNATURE Added here by Module::Build");
#[CHANGED] == removed comment to prevent altering MANIFEST, when possible (to preserve correct signatures as long as possible)
$self->_add_to_manifest($manifest, 'SIGNATURE'); # NO comment, just the filename; comments can alter the MANIFEST when/if it is auto-regenerated
#[ADD] dist - make ACTION_dist dependent on distmeta
sub ACTION_dist {
my $self = shift;
$self->depends_on('distmeta');
$self->SUPER::ACTION_dist( @_ );
}
};
$code{'ACTION_distdir'} = q{
#[ADD] distdir - make ACTION_distdir dependent on sign (as a HACK to avoid gpg-agent open file handle on distdir)
sub ACTION_distdir {
my $self = shift;
## $self->depends_on('PL_files');
if ( $self->sign ) {
# HACK: avoid gpg-agent leaving an open handle on a directory scheduled for cleanup :: this causes sign events & leaves gpg-agent with a handle open to the main directory (not as bad because we don't clean it up)
# would be better to fix this in _sign_dir or in Module::Signature itself, if possible ([2013-12-29] still not possible); best repair would be a corrected gpg-agent
if ($^O =~ /\AMSWin/i) {
if (not File::Glob::bsd_glob('SIGNATURE',File::Glob::GLOB_NOCASE())) { $self->depends_on('sign'); }
}
}
$self->SUPER::ACTION_distdir( @_ );
}
};
$code{'ACTION_distsign'} = q{
#[ADD] distsign - make ACTION_distsign dependent on sign (as a HACK to avoid gpg-agent open file handle on distdir)
sub ACTION_distsign {
my $self = shift;
# HACK: avoid gpg-agent leaving an open handle on a directory scheduled for cleanup :: this causes sign events & leaves gpg-agent with a handle open to the main directory (not as bad because we don't clean it up)
# would be better to fix this in _sign_dir or in Module::Signature itself, if possible ([2013-12-29] still not possible); best repair would be a corrected gpg-agent
if ($^O =~ /\AMSWin/i) {
if (not File::Glob::bsd_glob('SIGNATURE',File::Glob::GLOB_NOCASE())) { $self->depends_on('sign'); }
}
$self->SUPER::ACTION_distsign( @_ );
}
};
$code{'ACTION_distcheck'} = q{
#[ADD] action = distcheck - custom distcheck ACTION to create MANIFEST (if needed; especially after a "distclean")
sub ACTION_distcheck {
Build.PL.config view on Meta::CPAN
# Pod::Usage v1.30 for "pod2usage({-verbose => 99, ...})"
#requires_href => { perl => '5.6.0', 'version' => 0, 'Pod::Usage' => 0, 'Carp::Assert' => 0, 'File::Which' => 0, 'File::Spec' => 0, %{$config{'requires_href'}}, } ## see Module::CoreList->first_release('<MODULE>') for CORE module release inf...
requires_href => { %{$config{'requires_href'}}, perl => '5.8.8', 'version' => 0.74, 'Pod::Usage' => '1.30', 'Carp::Assert' => 0, 'File::Globstar' => 0, 'File::Which' => 0, } ## see Module::CoreList->first_release('<MODULE>') for CORE module ...
#recommends_href => { %{$config{'recommends_href'}}, 'Win32' => 0, 'Win32::API' => 0, 'Win32::Security::SID' => 0, 'Win32::TieRegistry' => 0, }
recommends_href => { %{$config{'recommends_href'}}, 'Win32' => 0, 'Win32::Security::SID' => 0, 'Win32::TieRegistry' => 0, } ## recommended modules to expand home path expansion coverage (above just current user and public)
#
test_recommends_href => { %{$config{'test_recommends_href'}}, 'Test::MinimumVersion' => '0.008', 'Test::Perl::Critic' => 0, 'Test::Pod' => 0, 'Test::Pod::Coverage' => 0 } ## for minimal AUTOMATED/CI testing
test_requires_href => { %{$config{'test_requires_href'}}, 'IPC::Run3' => 0, 'Probe::Perl' => 0, } ## for xx.bat testing (t\13.xx.t)
# TODO: think about changing this... need Module::Signature and 'gpg' or Crypt::OpenPGP; and...
# ...do I want default to be signing for people who build this...; probably so besides they will just build/install not 'build dist'
#sign => 0
#sign => 'true'
#recursive_test_files = 'true'
no_index_href => { %{$config{'no_index_href'}}, directory => [ 'eg', 'extras', 'notes', @{$config{'no_index_href'}{directory}} ], }
no_index_href => { %{$config{'no_index_href'}}, file => [ 'README.mkd', $config{'no_index_href'}{file} ? @{$config{'no_index_href'}{file}} : () ], }
#create_readme => 'true' # create README from module pod
#create_makefile_pl => 'passthrough', # passthrough Makefile.PL (download/install Module::Build from CPAN if missing, deprecated [use 'small' and 'configure_requires']) [see PerlDOC: module::build::compat]
Build.PL.config view on Meta::CPAN
#script_files_aref => [ map { glob } qw{ scripts/* } ] # specify all files in the ./scripts directory as executable Perl scripts, installed when the module is installed
#:transition help for old-style MakeMaker distributions
#pm_files_href => { map { $_ => $config{lib_path} . q{/} . $_ } ( map { glob } qw{ *.pm } ) } # copy .pm file(s) from the main directory into their logical package location (for an old-style MakeMaker distribution with PM file location in main ...
#pod_files_href => { map { $_ => $config{lib_path} . q{/} . $_ } ( map { glob } qw{ *.pod } ) } # copy POD file(s) from the main directory into their logical package location (for an old-style MakeMaker distribution with PM file location in m...
#xs_files_href => { map { $_ => $config{lib_path} . q{/} . $_ } ( map { glob } qw{ *.xs } ) } # copy .xs file(s) from the main directory into their logical package location (for an old-style MakeMaker distribution with XS file location in main ...
# Rebuild distmeta for tests with care: avoid rebuilding distmeta on installation tests (rebuilds on other platforms can change minor things such as quote characters or links which invalidates the SIGNATURE)
## do case insensitive file checks
#custom_code_href => { 'ACTION_test' => q[sub ACTION_test{ use File::Glob qw(:glob); my ($self) = @_; $self->depends_on('build'); if ($ENV{TEST_AUTHOR} or $ENV{TEST_ALL}) { if (!bsd_glob('Makefile.PL',GLOB_NOCASE) or !bsd_glob('README',GLOB_NOCASE) o...
#custom_ENV_href => { '_BUILD_versioned_file_globs' => join(q{;}, ( $config{module_path}, qw( bin/* ), qw( eg/* ) )), '_TEST_lib_path' => $config{lib_path}, '_BUILD_gpg_conf_path' => '.gpg' }
# CHANGE: '_BUILD_versioned_file_globs' => [ map {recursive_glob} qw{lib/*.pm bin/*.bat bin/*.pl} ]
#:if set within .config, needs to be done *after* module_name (which triggers $config{module_path} setup)
#versioned_file_aref => [ $config{module_path}, qw( bin/* ) ]
MANIFEST.SKIP view on Meta::CPAN
(?:^|/)\.hg/
(?:^|/)\.hgtags$
(?:^|/)\.hgignore$
(?:^|/)\.hgrc
# :: git
(?:^|/)\.git/
(?:^|/)\.gitattributes$
(?:^|/)\.gitignore$
# Avoid signature GPG configuration files
(?:^|/)\.gpg/
(?:^|/)\.gpg.conf
# Avoid temp and backup files
~$
\.old$
\#$
(?:^|/)\.#
\.bak$
\.tmp$
# Avoid weird file detrus
( run in 0.658 second using v1.01-cache-2.11-cpan-df04353d9ac )