Changeset 5f8d8a1


Ignore:
Timestamp:
Sep 15, 2008, 9:04:49 PM (16 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
c194705
Parents:
d8c456c
Message:
Fix :reload-module's interactions with PAR modules.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl/ModuleLoader.pm

    ra82e091 r5f8d8a1  
    1313    my $class = shift;
    1414    $class->rescan_modules;
     15    PAR::reload_libs();
    1516
    1617    for my $mod (keys %modules) {
     
    2425
    2526sub rescan_modules {
    26     PAR::reload_libs();
    2727    PAR->import(BarnOwl::get_data_dir() . "/modules/*.par");
    2828    PAR->import(BarnOwl::get_config_dir() . "/modules/*.par");
     
    6565    }
    6666
     67    my $parfile;
     68    for my $p (@PAR::PAR_INC) {
     69        if($p =~ m/\Q$module\E[.]par$/) {
     70            $parfile = $p;
     71            last;
     72        }
     73    }
     74
    6775    local $SIG{__WARN__} = \&squelch_redefine;
    68     if(!defined eval "use BarnOwl::Module::$module") {
     76
     77    if(defined $parfile) {
     78        PAR::reload_libs($parfile);
     79    } elsif(!defined eval "use BarnOwl::Module::$module") {
    6980        BarnOwl::error("Unable to load module $module: \n$@\n") if $@;
    7081    }
Note: See TracChangeset for help on using the changeset viewer.