NAME
Arepa::Repository - Arepa repository access class
SYNOPSIS
my $repo = Arepa::Repository->new('path/to/config.yml');
my $value = $repo->get_config_key('repository:path');
my @distros = $repo->get_distributions;
my @archs = $repo->get_architectures;
my $bool = $repo->insert_source_package($dsc_file, $distro);
my $bool = $repo->insert_source_package($dsc_file, $distro,
priority => 'optional',
section => 'perl');
my $bool = $repo->insert_source_package($dsc_file, $distro,
priority => 'optional',
section => 'perl',
comments => 'Why this was approved',
canonical_distro => 'lenny');
my $bool = $repo->insert_binary_package($deb_file, $distro);
my $text = $repo->last_cmd_output;
DESCRIPTION
This class represents a reprepro-managed APT repository. It allows you get information about the repository and to insert new source and binary packages in it.
It uses the Arepa configuration to get the repository path, and the own repository reprepro configuration to figure out the distributions and architectures inside it.
METHODS
- new($path)
-
Creates a new repository access object, using the configuration file in
$path
. - get_config_key($key)
-
Gets the configuration key
$key
from the Arepa configuration. - get_distributions
-
Returns an array of hashrefs. Each hashref represents a distribution declared in the repository
conf/distributions
configuration file, and contains a key for every distribution attribute. - get_architectures
-
Returns a list of all the architectures mentioned in any of the repository distributions.
- insert_source_package($dsc_file, $distribution, %options)
-
Inserts the source package described by the given
$dsc_file
in the repository and the package database, for the given$distribution
. Priority and section can be specified with thepriority
andsection
options in%options
. Other possible options arecomments
(comments about the source package e.g. why it was added to the repo or its origin) andcanonical_distro
(the "canonical" distribution, that is the distribution in your repository the source package should be added to, as opposed to the distribution specified in the actual source package changes file). - insert_binary_package($deb_file, $distribution)
-
Inserts the given binary package
$deb_file
in the repository, for the given$distribution
. - last_cmd_output
-
Returns the text output of the last executed command. This can help debugging problems.
- package_list
-
Returns a data structure representing all the available packages in all the known distributions. The data structure is a hash that looks like this:
(foobar => { "lenny/main" => { "1.0-1" => ['source'] } }, pkg2 => { "lenny/main" => { "1.0-1" => [qw(amd64 source)], "1.0-2" => ['i386'], }, "etch/contrib" => { "0.8-1" => [qw(i386 amd64 source) } }, dhelp => { "lenny/main" => { "0.6.15" => [qw(i386 source)] } }, )
That is, the keys are the package names, and the values are another hash. This hash has
distribution/component
as keys, and hashes as values. These hashes have available versions as keys, and a list of architectures as values.
SEE ALSO
Arepa::BuilderFarm
, Arepa::PackageDb
, Arepa::Config
.
AUTHOR
Esteban Manchado Velázquez <estebanm@opera.com>.
LICENSE AND COPYRIGHT
This code is offered under the Open Source BSD license.
Copyright (c) 2010, Opera Software. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of Opera Software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
DISCLAIMER OF WARRANTY
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 297:
Non-ASCII character seen before =encoding in 'Velázquez'. Assuming UTF-8