Kent Fredric πŸ”₯🐢🍡πŸ”₯

NAME

Gentoo::Overlay::Package - Class for Package's in Gentoo Overlays

VERSION

version 2.001002

SYNOPSIS

    my $package = Overlay::Package->new(
        name => 'Moose',
        category => $category_object,
    );

    $package->exists() # Moose exists

    print $package->pretty_name() # dev-perl/Moose::gentoo

    print $package->path() # /usr/portage/dev-perl/Moose

    ::Package->is_blacklisted("..") # '..' is not a valid package name
    ::Package->is_blacklisted('metadata.xml') # is not a valid directory

METHODS

exists

Does the Package exist, and is it a directory?

    $package->exists();

is_blacklisted

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

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

pretty_name

A pretty form of the name

    $package->pretty_name # dev-perl/Moose::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 = 'ebuilds'

      $overlay->iterate( ebuilds => sub {
          my ( $self, $c ) = shift;
          # $c->{ebuild_name}  # String
          # $c->{ebuild}       # Ebuild Object
          # $c->{num_ebuilds}  # How many ebuild are there to iterate
          # $c->{last_ebuild}  # Index ID of the last ebuild.
          # $c->{ebuild_num}   # Index ID of the current ebuild.
      } );

ATTRIBUTES

name

The packages Short name.

    isa => Gentoo__Overlay_PackageName, required, ro

PackageName

category

The category object that this package is in.

    isa => Gentoo__Overlay_Category, required, ro

    accessors => overlay

Category

"overlay"

path

The full path to the package.

    isa => Dir, lazy, ro

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

ATTRIBUTE ACCESSORS

overlay

    $package->overlay -> Gentoo::Overlay::Category->overlay

"overlay" in Gentoo::Overlay::Category

"category"

ebuild_names

    for( $package->ebuild_names ){
        print $_;
    }

"_ebuilds"

ebuilds

    my %ebuilds = $package->ebuilds;

"_ebuilds"

get_ebuild

    my $ebuild = $package->get_ebuild('Moose-2.0.0.ebuild');

"_ebuilds"

PRIVATE ATTRIBUTES

_ebuilds

    isa => HashRef[ Gentoo__Overlay_Ebuild ], lazy_build, ro

    accessors => _has_ebuild , ebuild_names,
                 ebuilds, get_ebuild

"_has_ebuild"

"ebuild_names"

"ebuilds"

"get_ebuild"

PRIVATE ATTRIBUTE ACCESSORS

_has_ebuild

    $package->_has_ebuild('Moose-2.0.0.ebuild');

"_ebuilds"

PRIVATE CLASS ATTRIBUTES

_scan_blacklist

Class-Wide list of blacklisted package 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?

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

"_scan_blacklist"

PRIVATE METHODS

_build__ebuilds

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

"_packages"

_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.