Test::AutoBuild::Repository - Source control repository access
use Test::AutoBuild::Repository my $rep = Test::AutoBuild::Repository->new( name => $name, options => \%options, env => \%env, label => $label); # Add a module to the repository $rep->module($module); # Initialize the repository $rep->init(); # Checkout / update the module my $changed = $rep->export($name, $module);
This module provides the API for interacting with the source control repositories. A repository implementation has to be able to do two main things
* Get a checkout of a new module * Update an existing checkout, determining if any changes where made
The valid configuration options for the repositories block are
repositories
my $rep = Test::AutoBuild::Repository->new(name => $name, label => $label, options => \%options, env => \%env);
This method creates a new repository. The name argument is an alphanumeric token representing the name of the repository. The label argument is a human friendly name of the repository. The optional options argument is a hashref of implementation specific options. The optional env argument is a hashref of environment variables to set when running the commands to access the repository.
name
label
options
env
my $name = $rep->name([$name]);
When run without any arguments, returns the alphanumeric token representing the name of the repository. If a single argument is supplied, this is use to update the name.
my $value = $rep->option($name[, $value]);
When run with a single argument, retuns the option value corresponding to the name specified in the first argument. If a second argument is supplied, then the option value is updated.
my $value = $rep->env($name[, $value]);
When run with a single argument, retuns the environment variable corresponding to the name specified in the first argument. If a second argument is supplied, then the environment variable is updated.
my $label = $rep->label([$label]);
When run without any arguments, returns the human friendly string representing the label of the repository. If a single argument is supplied, this is use to update the label.
my $module = $rep->module($name[, $module]);
When run with a single argument, returns the module object corresponding to the name specified as the first argument. If the second argument is supplied, then the module object is updated.
my @modules = $rep->modules();
Returns the list of modules in this repository
$rep->init();
Performs any one time initialization required prior to exporting modules from the repoitory.
my $changed = $rep->export($name, $module);
Exports the module specified in the second argument to a directory specified by the first argument. Returns zero if there were no changes to export; non-zero if the module was new or changed. This is a virtual method which must be implemented by all subclasses.
my $output = $rep->_run($cmd);
Runs the command specified in the first argument, having first setup the environment variables specified when the repository was created. It returns any text written to standard out by the command
Daniel Berrange <dan@berrange.com>
Copyright (C) 2002 Daniel Berrange <dan@berrange.com>
perl(1)
2 POD Errors
The following errors were encountered while parsing the POD:
You can't have =items (as at line 77) unless the first thing after the =over is an =item
=back doesn't take any parameters, but you said =back 4
To install Test::AutoBuild, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::AutoBuild
CPAN shell
perl -MCPAN -e shell install Test::AutoBuild
For more information on module installation, please visit the detailed CPAN module installation guide.