Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 109745
Collapse All | Expand All

(-)file_not_specified_in_diff (-7 / +20 lines)
Lines 53-66 Link Here
53
my $callbacks = $cache{$CacheKey} || $m->notes($CacheKey);
53
my $callbacks = $cache{$CacheKey} || $m->notes($CacheKey);
54
54
55
if (!$callbacks) {
55
if (!$callbacks) {
56
    my $path = "/Callbacks/*$Page/$_CallbackName";
56
    my $path  = "/Callbacks/*$Page/$_CallbackName";
57
57
58
    $callbacks = [
58
    # Due to API changes after Mason 1.28, we have to check for which
59
        # Skip backup files, and files without a leading package name
59
    # version we're running when getting the component roots
60
        grep { !/^\.|~$/ and $_ ne "/Callbacks/$Page/$_CallbackName" }
60
    my @roots = map { $_->[1] }
61
        $m->interp->resolver->glob_path($path)
61
                    $HTML::Mason::VERSION <= 1.28
62
    ];
62
                        ? $m->interp->resolver->comp_root_array
63
63
                        : $m->interp->comp_root_array;
64
    
65
    my %seen;
66
    
67
    for my $root (@roots) {
68
        push @$callbacks,
69
            # Skip backup files, files without a leading package name,
70
            # and files we've already seen
71
            grep {     !/^\.|~$/
72
                   and $_ ne "/Callbacks/$Page/$_CallbackName"
73
                   and not $seen{$_}++ }
74
                 $m->interp->resolver->glob_path($path, $root);
75
    }
76
    
64
    $m->notes($CacheKey => $callbacks);
77
    $m->notes($CacheKey => $callbacks);
65
    $cache{$Page,$_CallbackName} = $callbacks if !$RT::DevelMode;
78
    $cache{$Page,$_CallbackName} = $callbacks if !$RT::DevelMode;
66
}
79
}

Return to bug 109745