summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2004-12-02 09:42:09 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2004-12-02 09:42:09 +0000
commit88b1aaf4d21b99c93216149954135663429cc976 (patch)
tree22107341bc49715aa54107b2842f279e6388463f
parent7c22811f9fc3c2a6c7679dd96a0b2c937b4256fe (diff)
downloadATCD-88b1aaf4d21b99c93216149954135663429cc976.tar.gz
ChangeLogTag: Thu Dec 2 09:42:12 UTC 2004 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r--bin/PerlACE/ConfigList.pm21
1 files changed, 12 insertions, 9 deletions
diff --git a/bin/PerlACE/ConfigList.pm b/bin/PerlACE/ConfigList.pm
index f2546d844d9..74e530b1c94 100644
--- a/bin/PerlACE/ConfigList.pm
+++ b/bin/PerlACE/ConfigList.pm
@@ -9,7 +9,7 @@ use FileHandle;
my @new_argv = ();
for(my $i = 0; $i <= $#ARGV; ++$i) {
- if ($ARGV[$i] eq '-Config') {
+ if ($ARGV[$i] eq '-Config') {
if (defined $ARGV[$i + 1]) {
push @PerlACE::ConfigList::Configs, $ARGV[++$i];
}
@@ -25,7 +25,7 @@ for(my $i = 0; $i <= $#ARGV; ++$i) {
@ARGV = @new_argv;
-sub new ()
+sub new ()
{
my $self = {};
@{$self->{MY_CONFIGS}} = @PerlACE::ConfigList::Configs;
@@ -78,17 +78,20 @@ sub load ($)
while (<$fh>) {
chomp;
- if (/^\s*$/ || /^#/) {
- next;
+ if (/^\s*$/ || /^#/) {
+ next;
}
# compress white space
s/\s+/ /g;
my $entry = '';
my $configs = '';
-
+
($entry, $configs) = split /:/;
+ # remove trailing white spaces
+ $entry =~ s/\s+$//;
+
push @{$self->{ENTRIES}}, $entry;
if (defined $configs) {
@{$self->{CONFIGS}->{$entry}} = split (" ", $configs);
@@ -98,7 +101,7 @@ sub load ($)
$fh->close ();
}
-sub valid_entries ()
+sub valid_entries ()
{
my $self = shift;
my @entries = ();
@@ -118,7 +121,7 @@ sub list_configs ()
my $list = '';
foreach my $entry (@{$self->{ENTRIES}}) {
-
+
foreach my $config (@{$self->{CONFIGS}->{$entry}}) {
$config =~ s/!//g;
if ($allconfigs{$config} != 1) {
@@ -133,7 +136,7 @@ sub list_configs ()
sub dump ()
{
- my $self = shift;
+ my $self = shift;
print "============================================================\n";
print "Config\n";
@@ -152,4 +155,4 @@ sub dump ()
print "============================================================\n";
}
-1; \ No newline at end of file
+1;