summaryrefslogtreecommitdiff
path: root/fml/lib
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-09-22 14:11:30 +0000
committerfukachan <fukachan>2001-09-22 14:11:30 +0000
commitfa8aaee8ec37573779fdf5d1d30b4874834834df (patch)
tree79936ed54c38e60976a2ad2eb13a02eb83dcf3b5 /fml/lib
parent83160d053eb74c54de051939bebce00f7b54438b (diff)
downloadfml8-fa8aaee8ec37573779fdf5d1d30b4874834834df.tar.gz
fml8-fa8aaee8ec37573779fdf5d1d30b4874834834df.tar.bz2
fml8-fa8aaee8ec37573779fdf5d1d30b4874834834df.zip
if ($ENV{'debug'}) { ... debug ...;}
buf fix $mode scope
Diffstat (limited to 'fml/lib')
-rw-r--r--fml/lib/FML/Config.pm22
1 files changed, 14 insertions, 8 deletions
diff --git a/fml/lib/FML/Config.pm b/fml/lib/FML/Config.pm
index 9c8d3837..abb2efb0 100644
--- a/fml/lib/FML/Config.pm
+++ b/fml/lib/FML/Config.pm
@@ -1,7 +1,7 @@
#-*- perl -*-
# Copyright (C) 2000-2001 Ken'ichi Fukamachi
#
-# $FML: Config.pm,v 1.38 2001/08/23 14:29:22 fukachan Exp $
+# $FML: Config.pm,v 1.39 2001/09/13 12:20:39 fukachan Exp $
#
package FML::Config;
@@ -245,14 +245,14 @@ sub _read_file
if (/^([A-Za-z0-9_]+)\s*(=)\s*(.*)/ ||
/^([A-Za-z0-9_]+)\s*(\+=)\s*(.*)/ ||
/^([A-Za-z0-9_]+)\s*(\-=)\s*(.*)/) {
- my ($key, $mode, $value) = ($1, $2, $3);
- $mode =~ s/=//;
+ my ($key, $xmode, $value) = ($1, $2, $3);
+ $xmode =~ s/=//;
$value =~ s/\s*$//o;
$curkey = $key;
- if ($mode) {
+ if ($xmode) {
$config->{ $key } =
- _evaluate($config, $key, $mode, $value);
+ _evaluate($config, $key, $xmode, $value);
}
else { # by default
$config->{ $key } = $value;
@@ -263,6 +263,7 @@ sub _read_file
$comment->{ $key } = $comment_buffer;
undef $comment_buffer;
+ print STDERR "push(@$order, $key);\n" if $ENV{'debug'};
push(@$order, $key);
}
}
@@ -344,11 +345,11 @@ sub read
});
# XXX debug: removed in the future
- if (0) {
+ if ($ENV{'debug'}) {
my ($k, $v);
while (($k, $v) = each %$config) {
- print STDERR "\n[$k]\n";
- print STDERR " value $v\n";
+ print STDERR "\nconfig{ $k } =>\n";
+ print STDERR " $v\n";
if (defined $comment->{ $k }) {
my $comment = $comment->{ $k };
print STDERR " comment\n{$comment}\n";
@@ -392,6 +393,11 @@ sub write
# XXX get variable list modified in this process
my $newkeys = $self->{ _newly_added_keys };
for my $k (@$order, @$newkeys) {
+ if ($ENV{'debug'} && defined $comment->{$k}) {
+ print STDERR "write.config{ ", $comment->{$k}, " }";
+ print STDERR join("\n\t", split(/\s+/, $config->{$k})), "\n";
+ }
+
print $fh $comment->{$k} if defined $comment->{$k};
print $fh "$k = ";
print $fh join("\n\t", split(/\s+/, $config->{$k}));