Arepa
view release on metacpan or search on metacpan
lib/Arepa/Repository.pm view on Meta::CPAN
my $text = $repo->last_cmd_output;
=head1 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.
=head1 METHODS
=over 4
=item new($path)
Creates a new repository access object, using the configuration file in
C<$path>.
=item get_config_key($key)
Gets the configuration key C<$key> from the Arepa configuration.
=item get_distributions
Returns an array of hashrefs. Each hashref represents a distribution declared
in the repository C<conf/distributions> configuration file, and contains a
(always lowercase) key for every distribution attribute.
=item get_architectures
Returns a list of all the architectures mentioned in any of the repository
distributions.
=item insert_source_package($dsc_file, $distribution, %options)
Inserts the source package described by the given C<$dsc_file> in the
repository and the package database, for the given C<$distribution>. Priority
and section can be specified with the C<priority> and C<section> options in
C<%options>. Other possible options are C<comments> (comments about the source
package e.g. why it was added to the repo or its origin) and
C<canonical_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).
=item insert_binary_package($deb_file, $distribution)
Inserts the given binary package C<$deb_file> in the repository, for the given
C<$distribution>.
=item last_cmd_output
Returns the text output of the last executed command. This can help debugging
problems.
=item get_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 C<distribution/component> as keys, and hashes as values. These hashes
have available versions as keys, and a list of architectures as values.
=item get_source_package_information($package_name, $distro)
Returns a hash with the information for the source package with the given
C<$package_name> inside distribution C<$distro>. If there is no source package
by that name in that distribution, an empty hash will be returned.
Note that keys in the hash are lowercase.
=item get_binary_package_information($package_name, $distro, $arch)
Returns a hash with the information for the binary package with the given
C<$package_name> inside distribution C<$distro>/C<$arch>. If there is no binary
package by that name in that distribution, for that architecture, an empty hash
will be returned.
=item add_distribution(%properties)
Adds a new distribution to the repository, with whatever properties are
specified. The properties are specified in lowercase (see
C<get_distributions>) and C<codename> is mandatory. Also, you can't specify a
codename of an existing distribution, or a suite name that an existing
distribution already has. It returns 1 on success, or 0 on failure.
=item sign_distribution($dist_name)
Signs the C<Release> file for a single distribution (with codename
C<$dist_name>). It returns if GPG returned error status zero.
=item sync_remote
Syncs the local repository to the remote location, if available in the config.
Returns if the synchronisation worked (needs the C<rsync> command) or false if
there wasn't any remote repository location in the config.
=item is_synced
Returns if the local repository is synced with the remote repository. It
returns false if there's no remote repository location in the config.
=back
=head1 SEE ALSO
C<Arepa::BuilderFarm>, C<Arepa::PackageDb>, C<Arepa::Config>.
=head1 AUTHOR
( run in 1.243 second using v1.01-cache-2.11-cpan-39bf76dae61 )