MDV-Distribconf
view release on metacpan or search on metacpan
lib/MDV/Distribconf.pm view on Meta::CPAN
=head1 SYNOPSIS
use MDV::Distribconf;
my $d = MDV::Distribconf->new("/path/to/the/distribution/root");
$d->load()
or die "This doesn't seem to be a distribution tree\n";
print $d->getpath(undef, "root") ."\n";
foreach ($d->listmedia) {
printf "%s -> %s\n", $d->getpath($_, "hdlist"), $d->getpath($_, path);
}
=head1 DESCRIPTION
MDV::Distribconf is a module to get or write the configuration of a Mageia
distribution tree. This configuration is stored in a file called
F<media.cfg>, aimed at replacing the old-style F<hdlists> file.
The format of the F<hdlists> file is limited and doesn't allow to add new
values without breaking compatibility, while F<media.cfg> is designed for
extensibility. To keep compatibility with old tools, this module is able
to generate an F<hdlists> file based on F<media.cfg>.
This module is able to manage both configuration of old-style trees
(F<Mandrake/base/> for OS versions 10.0 and older) and of new-style ones
(F<media/media_info/> for 10.1 and newer).
=head1 media.cfg
The F<media.cfg> is structured like a classical F<.ini> file. All
parameters are optional; this means that a readable empty file is ok, if
this is what you want :)
F<media.cfg> contains sections, each section corresponding to a media,
except the C<[media_info]> section wich is used to store global info. The
section name is the (relative) path where the rpms are located. It is
sufficient to uniquely identify a media.
Some values have specific signification:
=over 4
=item media specific values:
=over 4
=item B<hdlist>
The path or basename of the hdlist. By default, this is
C<hdlist_mediapath.cz>, with slashes and spaces being replaced by '_'.
=item B<synthesis>
The path or basename of the synthesis. By default, this is the hdlist
name prefixed by C<synthesis>.
=item B<pubkey>
The path or basename of the gpg public key file. By default, this is
the media name prefixed by C<pubkey_>.
=item B<name>
A human-readable name for the media. By default this is the media path
(that is, the section name), where slashes have been replaced by
underscores.
=item B<info>
The xml file containing rpm informations.
=item B<changelog>
The xml file containing rpm changelogs.
=item B<files>
The xml file containing rpm files list.
=back
=item global specific values:
=over 4
=item B<version>
OS version.
=item B<branch>
OS branch (cauldron, etc.)
=item B<arch>
Media target architecture.
=item B<root>
The root path of the distribution tree. This value is not set in
F<media.cfg>, can't be owerwritten, and is only used internally.
=item B<mediadir>
The default path relative to the 'root' path where media are
located. MDV::Distribconf is supposed to configure this automatically
to C<Mandrake> or to C<media>, depending on the OS version.
=item B<infodir>
The default path relative to the 'root' path where distrib metadata
are located. MDV::Distribconf is supposed to configure this automatically
to C<Mandrake/base> or to C<media/media_info>, depending on the OS
version.
=back
=back
( run in 0.976 second using v1.01-cache-2.11-cpan-df04353d9ac )