Gentoo::Overlay::Category - A singular category in a repository;
version 1.0.5
Still limited functionality, more to come.
my $category = ::Overlay::Category->new( name => 'dev-perl', overlay => '/usr/portage' , ); my $category = ::Overlay::Category->new( name => 'dev-perl', overlay => $overlay_object , ); $category->exists() # is the category there, is it a directory? $category->pretty_name() # dev-perl/::gentoo $category->path() # /usr/portage/dev-perl ::Overlay::Category->is_blacklisted('..') # is '..' a blacklisted category
Does the category exist, and is it a directory?
$category->exists();
Does the category name appear on a blacklist meaning auto-scan should ignore this?
::Category->is_blacklisted('..') # true ::Category->is_blacklisted('metadata') # true
A pretty form of the name.
$category->pretty_name # dev-perl/::gentoo
$overlay->iterate( $what, sub { my ( $context_information ) = shift; } );
The iterate method provides a handy way to do walking across the whole tree stopping at each of a given type.
$what = 'packages'
$overlay->iterate( packages => sub { my ( $self, $c ) = shift; # $c->{package_name} # String # $c->{package} # Package Object # $c->{num_packages} # How many packages are there to iterate # $c->{last_package} # Index ID of the last package. # $c->{package_num} # Index ID of the current package. } );
$what = 'ebuilds'
$overlay->iterate( ebuilds => sub { my ( $self, $c ) = shift; # $c->{package_name} # String # $c->{package} # Package Object # $c->{num_packages} # How many packages are there to iterate # $c->{last_package} # Index ID of the last package. # $c->{package_num} # Index ID of the current package. # $c->{ebuild_name} # String # See ::Ebuild for the rest of the fields provided by the ebuild Iterator. # Very similar though. } );
The classes short name
isa => Gentoo__Overlay_CategoryName, required, ro
CategoryName
The overlay it is in.
isa => Gentoo__Overlay_Overlay, required, coerce
"Gentoo__Overlay_Overlay" in Gentoo::Overlay::Types
The full path to the category
isa => Dir, lazy, ro
"Dir" in MooseX::Types::Path::Tiny
for( $category->package_names ){ print $_; }
"_packages"
my %packages = $category->packages;
my $package = $category->get_package('Moose');
isa => HashRef[ Gentoo__Overlay_Package ], lazy_build, ro accessors => _has_package , package_names, packages, get_package
"_has_package"
"package_names"
"packages"
"get_package"
$category->_has_package('Moose');
Class-Wide list of blacklisted directory names.
isa => HashRef[ Str ], ro, lazy accessors => _scan_blacklisted
"_scan_blacklisted"
MooseX::Types::Moose
is $arg blacklisted in the Class Wide Blacklist?
$arg
::Category->_scan_blacklisted( $arg ) -> exists ::Category->_scan_blacklist->{$arg}
"_scan_blacklist"
Generates the package Hash-Table, by scanning the category directory.
$object->_iterate_packages( ignored_value => sub { } );
Handles dispatch call for
$object->iterate( packages => sub { } );
$object->_iterate_ebuilds( ignored_value => sub { } );
$object->iterate( ebuilds => sub { } );
Kent Fredric <kentnl@cpan.org>
This software is copyright (c) 2013 by Kent Fredric <kentnl@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Gentoo::Overlay, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gentoo::Overlay
CPAN shell
perl -MCPAN -e shell install Gentoo::Overlay
For more information on module installation, please visit the detailed CPAN module installation guide.