summaryrefslogtreecommitdiffstats
path: root/perl-install/modules/modules_conf.pm
blob: 2a720fc70009fa1e8c9d5c7ee427a04777467f81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package modules::modules_conf;

use log;
use common;

our @ISA = qw(modules::any_conf);

sub get_above {
    my ($conf, $name) = @_;
    $conf->{$name} && $conf->{$name}{above};
}
sub set_above {
    my ($conf, $name, $modules) = @_;
    $conf->{$name}{above} = $modules;
}
sub remove_above {
    my ($conf, $name) = @_;
    delete $conf->{$name}{above};
}

sub get_probeall {
    my ($conf, $alias) = @_;
    $conf->{$alias}{probeall};
}
sub add_probeall {
    my ($conf, $alias, $module) = @_;

    my $l = $conf->{$alias}{probeall} ||= [];
    @$l = uniq(@$l, $module);
    log::l("setting probeall $alias to @$l");
}
sub remove_probeall {
    my ($conf, $alias, $module) = @_;

    my $l = $conf->{$alias}{probeall} ||= [];
    @$l = grep { $_ ne $module } @$l;
    log::l("setting probeall $alias to @$l");
}

1;