NAME
Perl::Repository::APC - Class modelling "All Perl Changes" repository
SYNOPSIS
use Perl::Repository::APC;
my $apc = Perl::Repository::APC->new("/path/to/APC");
DESCRIPTION
new
The constructor new() takes a single argument, the path to the APC. The resulting object has the following methods:
get_to_version($branch,$patch)
$branch is one of
perl
,maint-5.004
,maint-5.005
,maint-5.6
,maint-5.8
. $patch is a patch number that must also be available in the local copy of APC. The return value is the perl version that this patch was/is leading to. If the branch is still active in that area, that version may be arbitrary, just enough to get a unique identifier.$apc->get_to_version("perl",7100); # returns "5.7.1" $apc->get_to_version("maint-5.005",1656); # returns "5.005_01" $apc->get_to_version("perl", 30000); # returns "5.9.5"
Dies if $patch is not part of $branch.
get_diff_dir($branch,$patch)
$branch is one of
perl
,maint-5.004
,maint-5.005
,maint-5.6
,maint-5.8
. $patch is a patch number that must also be available in the local copy of APC. The return value is the APC directory that holds the patches for this patch.$apc->get_to_version("perl",7100); # returns "5.7.1" $apc->get_to_version("maint-5.005",1656); # returns "5.005_01" $apc->get_diff_dir("perl", 30000); # returns "5.9.0"
Dies if $patch is not part of $branch.
get_from_version($branch,$patch)
Like above, but returns the perl version this patch is building upon. E.g.
$apc->get_to_version("perl",7100); # "5.7.0" $apc->get_to_version("maint-5.005",1656); # "5.005_00" $apc->get_from_version("perl",12823); # "5.7.2" $apc->get_from_version("maint-5.6",12823); # "5.6.1"
patch_range($branch,$lower,$upper)
$lower and $upper are two patch numbers, $branch is a perforce branch name (see get_to_version() for a description). This method returns an reference to an array containing all patchnumbers on $branch starting with the lower boundary (or above, if the lower boundary does not exist) and ending with the upper boundary (or below, if the upper boundary does not exist). E.g.
$apc->patch_range("perl",0,999999999); # returns all patches on the trunk $apc->patch_range("perl",17600,17700); #
version_range($branch,$lower,$upper)
As above but instead of returning an array of patches, it returns the accordant array of perl versions (i.e. directories below APC). E.g.
$apc->version_range("perl",17600,17700); # returns ["5.8.0","5.9.0"]
tarball($version)
$version is a perl version as labeled in the APC, e.g. "5.005_00". The return value is the name of the perl tarball containing that version. E.g.
$apc->tarball("5.005_00"); # "perl5.005.tar.gz" $apc->tarball("5.6.0"); # "perl-5.6.0.tar.gz" $apc->tarball("5.004_75"); # "perl5.005-beta1.tar.gz"
Dies if the argument cannot be resolved to existing tarball.
Versions of Perl::Repository::APC up to 1.276 returned a relative path. Since then it may return an absolute path or a relative one in order to be able to support the additional_tarballs/ directory which was added to APC in 2008-01.
first_in_branch($branch)
next_in_branch($version)
$branch is a perforce branch (see get_to_version() for a description). $version is a perl version as labeled in the APC, e.g. "5.005_00".
$apc->first_in_branch("maint-5.004"); # returns "5.004_00" $apc->first_in_branch("perl"); # returns "5.004_50" $apc->next_in_branch("5.6.0"); # returns "5.7.0"
Next_in_branch returns undef for the last version of a branch. Both methods die if the argument is not a valid branch or version name.
patches($version)
Returns an arrayref to the numerically sorted list of all available patches to build this target perl version.
$apc->patches("5.7.1"); # returns an arrayref to an array with # 1820 numbers
apcdirs()
Returns a list of arrayrefs. Each arrayref has the branch name as the element zero, the perl version name as element one. All other elements of the arrayref are the numerically sorted patch numbers that were leading to that perl version. See apc-overview for a simple example of using this.
closest($branch,$alt,$wanted)
If the patch is in the $branch branch this returns the patch number $wanted itself. Otherwise returns the closest to the $wanted patchnumber in a given branch. The $alt argument specifies from which side the closest should be determined: if $alt is
<
we search from the left, otherwise we search from the right.
AUTHOR
Andreas Koenig <ANDK>
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
SEE ALSO
patchaperlup, buildaperl, binsearchaperl