NAME

Gentoo::Overlay::Category - A singular category in a repository;

VERSION

version 2.001002

SYNOPSIS

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

METHODS

exists

Does the category exist, and is it a directory?

$category->exists();

is_blacklisted

Does the category name appear on a blacklist meaning auto-scan should ignore this?

::Category->is_blacklisted('..') # true

::Category->is_blacklisted('metadata') # true

pretty_name

A pretty form of the name.

$category->pretty_name  # dev-perl/::gentoo

iterate

$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.
    } );

ATTRIBUTES

name

The classes short name

isa => Gentoo__Overlay_CategoryName, required, ro

CategoryName

overlay

The overlay it is in.

isa => Gentoo__Overlay_Overlay, required, coerce

"Gentoo__Overlay_Overlay" in Gentoo::Overlay::Types

path

The full path to the category

isa => Dir, lazy, ro

"Dir" in MooseX::Types::Path::Tiny

ATTRIBUTE ACCESSORS

package_names

for( $category->package_names ){
    print $_;
}

"_packages"

packages

my %packages = $category->packages;

"_packages"

get_package

my $package = $category->get_package('Moose');

"_packages"

PRIVATE ATTRIBUTES

_packages

isa => HashRef[ Gentoo__Overlay_Package ], lazy_build, ro

accessors => _has_package , package_names,
             packages, get_package

"_has_package"

"package_names"

"packages"

"get_package"

PRIVATE ATTRIBUTE ACCESSORS

_has_package

$category->_has_package('Moose');

"_packages"

PRIVATE CLASS ATTRIBUTES

_scan_blacklist

Class-Wide list of blacklisted directory names.

isa => HashRef[ Str ], ro, lazy

accessors => _scan_blacklisted

"_scan_blacklisted"

MooseX::Types::Moose

PRIVATE CLASS ATTRIBUTE ACCESSORS

_scan_blacklisted

is $arg blacklisted in the Class Wide Blacklist?

::Category->_scan_blacklisted( $arg )
   ->
exists ::Category->_scan_blacklist->{$arg}

"_scan_blacklist"

PRIVATE METHODS

_build__packages

Generates the package Hash-Table, by scanning the category directory.

"_packages"

_iterate_packages

$object->_iterate_packages( ignored_value => sub {  } );

Handles dispatch call for

$object->iterate( packages => sub { } );

_iterate_ebuilds

$object->_iterate_ebuilds( ignored_value => sub {  } );

Handles dispatch call for

$object->iterate( ebuilds => sub { } );

AUTHOR

Kent Fredric <kentnl@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 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.