Perl::Build::Git - Convenience extensions for Perl::Build for bulk git work
version 0.001000
This is something that might be useful to call in a git bisect runner
use Perl::Build::Git; my $man = [qw( man1dir man3dir siteman1dir siteman3dir )]; my $no_man_opts = [ map { '-D' . $_ . '=none' } @{$man} ]; my $install = Perl::Build::Git->install_git( persistent => 1, preclean => 1, cache_root => '/tmp/perls/', git_root => '/path/to/git/checkout', configure_options => [ '-de', # quiet automatic '-Dusedevel', # "yes, ok, its a development version" @{$no_man_opts}, # man pages are ugly '-U versiononly', # use bin/perl, not bin/perl5.17.1 ], ); $install->run_env(sub{ # Test Case Here exit 255 if $failed; }); exit 0;
persistent = 1 is intended to give each build its own unique directory, such as
persistent = 1
/tmp/perls/v5.17.10-44-g97927b0/
So that if you do multiple bisects, ( for the purpose of testing which incarnation of perl some module fails in ), testing against a perl that was previously tested against in a previous bisect should return a cached result, greatly speeding up the bisect ( at the expense of disk space ).
perl
Perl::Build::Git->install_git( cache_root => '/some/path', git_root => '/some/path/to/perl/git', persistent => bool, preclean => bool, quiet => bool, log_output => filehandle, log => coderef, );
cache_root
path. This should be a path to an existent base working directory to install multiple perl installs to
Perl builds will either be in the form of
<cacheroot>/<tag>-g<sha1abbrev>
or
<cacheroot>/<tag>-g<sha1abbrev>-<SUFFIX>
depending on persistent
persistent
git_root
path.
This should be a path to an existing perl git checkout.
git
bool.
bool
Whether to make the build directory persistent or not. Persistent directories can be optimistically re-used, while non-persistent ones can not.
Non Persistent directories also have a random component added to their path, and implied cleanup on exit.
Default is NOT PERSISTENT
preclean
Whether to execute a pre-build cleanup of the git working directory.
This at present executes a mash of git checkout, git reset and git clean.
git checkout
git reset
git clean
Default is PRE-CLEAN GIT TREE
quiet
If specified, the default method for log is a no-op.
log
The default is NOT QUIET
log_output
filehandle.
filehandle
Destination to write log messages to.
Default is *STDERR
*STDERR
coderef. Handles dispatch from logging mechanisms, in the form
coderef
$logger->( $color_spec , @message );
where color_spec is anything that Term::ANSIColor::colored understands.
Term::ANSIColor::colored
$logger->( ['red'], "this", "is", "a" , "test" );
Default implementation writes to log_output formatting @message via Term::ANSIColor.
@message
Term::ANSIColor
Kent Fredric <kentfredric@gmail.com>
This software is copyright (c) 2013 by Kent Fredric <kentfredric@gmail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Perl::Build::Git, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Build::Git
CPAN shell
perl -MCPAN -e shell install Perl::Build::Git
For more information on module installation, please visit the detailed CPAN module installation guide.