Skip to content
This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

Commit

Permalink
Load modules for pkgconfig blessed classes
Browse files Browse the repository at this point in the history
Currently, pkgconfig objects (as stored in Alien::MyModule::ConfigData)
were properly pulling in their serialized selves and blessing
themselves into their proper ::PkgConfig classes. However, there
was no guarantee that the Perl module that implemented that class
was present. This change adds a check that runs through all
PkgConfig objects and loads the modules by the same name as their
blessing.

fixes #2
  • Loading branch information
run4flat committed Apr 3, 2012
1 parent beb13c6 commit 97f543c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Alien/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ sub pkgconfig {

croak "No Alien::Base::PkgConfig objects are stored!"
unless keys %all;

# Run through all pkgconfig objects and ensure that their modules are loaded:
for my $pkg_obj (values %all) {
my $perl_module_name = blessed $pkg_obj;
eval "require $perl_module_name";
}

return @all{@_} if @_;

Expand Down

0 comments on commit 97f543c

Please sign in to comment.