3 package PerlACE
::ConfigList
;
7 @PerlACE::ConfigList
::Configs
= ();
8 @PerlACE::ConfigList
::Excludes
= ();
12 for(my $i = 0; $i <= $#ARGV; ++$i) {
13 if ($ARGV[$i] eq '-Config') {
14 if (defined $ARGV[$i + 1]) {
15 push @PerlACE::ConfigList
::Configs
, $ARGV[++$i];
18 print STDERR
"You must pass a configuration with -Config\n";
22 elsif ($ARGV[$i] eq '-Exclude') {
23 if (defined $ARGV[$i + 1]) {
24 push @PerlACE::ConfigList
::Excludes
, $ARGV[++$i];
27 print STDERR
"You must pass an exclude pattern with -Exclude\n";
32 push @new_argv, $ARGV[$i];
41 @
{$self->{MY_CONFIGS
}} = @PerlACE::ConfigList
::Configs
;
49 if (@_) { @
{$self->{MY_CONFIGS
}} = @_; }
50 return @
{$self->{MY_CONFIGS
}};
53 sub add_one_config
($)
56 my $newconfig = shift;
57 push @
{$self->{MY_CONFIGS
}}, $newconfig;
64 my $the_config_allows_this = 1; # default case is true
66 # Go though each ID on the line in turn...
67 foreach my $config (@testconfigs) {
68 my $required_found = !($config =~ /^\w/);
69 foreach my $myconfig (@
{$self->{MY_CONFIGS
}}) {
70 if ($config eq "!$myconfig") { $the_config_allows_this = 0; }
71 if ($config eq $myconfig) { $required_found = 1; }
73 if (!$required_found) { $the_config_allows_this = 0; }
75 return $the_config_allows_this;
83 my $fh = new FileHandle
;
84 if (!$fh->open ("< $filename")) {
85 print STDERR
"Could not open $filename: $!\n";
91 if (/^\s*$/ || /^#/) {
94 # compress white space
100 ($entry, $configs) = split /:/;
102 # remove trailing white spaces
105 push @
{$self->{ENTRIES
}}, $entry;
106 if (defined $configs) {
107 @
{$self->{CONFIGS
}->{$entry}} = split (" ", $configs);
120 foreach my $entry (@
{$self->{ENTRIES
}}) {
122 foreach my $expat (@PerlACE::ConfigList
::Excludes
) {
123 if ($entry =~ /$expat/) {
128 if (!$exclude && $self->check_config (@
{$self->{CONFIGS
}->{$entry}})) {
129 push @entries, $entry;
141 foreach my $entry (@
{$self->{ENTRIES
}}) {
143 foreach my $config (@
{$self->{CONFIGS
}->{$entry}}) {
145 if ($allconfigs{$config} != 1) {
146 $list .= $config.' ';
147 $allconfigs{$config} = 1;
159 print "============================================================\n";
161 foreach my $config (@
{$self->{MY_CONFIGS
}}) {
166 foreach my $entry (@
{$self->{ENTRIES
}}) {
167 print "- ", $entry, ": ";
168 foreach my $config (@
{$self->{CONFIGS
}->{$entry}}) {
173 print "============================================================\n";