summaryrefslogtreecommitdiff
path: root/fml/lib
diff options
context:
space:
mode:
authorfukachan <fukachan>2006-01-04 07:47:26 +0000
committerfukachan <fukachan>2006-01-04 07:47:26 +0000
commit7367aa92767c30c729caf35310e16ff1499534d3 (patch)
treed7135688871862f3eb6db8c36d411722d43b0d9b /fml/lib
parent4127e0357e1dca917a2e99a04fa73352e06a067c (diff)
downloadfml8-7367aa92767c30c729caf35310e16ff1499534d3.tar.gz
fml8-7367aa92767c30c729caf35310e16ff1499534d3.tar.bz2
fml8-7367aa92767c30c729caf35310e16ff1499534d3.zip
change diff() return value to ($config, $diff), ARRAY of HASH_REF's.
add debug codes.
Diffstat (limited to 'fml/lib')
-rw-r--r--fml/lib/FML/Merge/FML4/config_ph.pm28
1 files changed, 21 insertions, 7 deletions
diff --git a/fml/lib/FML/Merge/FML4/config_ph.pm b/fml/lib/FML/Merge/FML4/config_ph.pm
index 49d4d903..8c3f2951 100644
--- a/fml/lib/FML/Merge/FML4/config_ph.pm
+++ b/fml/lib/FML/Merge/FML4/config_ph.pm
@@ -4,16 +4,19 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: config_ph.pm,v 1.17 2006/01/01 14:02:09 fukachan Exp $
+# $FML: config_ph.pm,v 1.18 2006/01/02 01:13:07 fukachan Exp $
#
package FML::Merge::FML4::config_ph;
use strict;
use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD
$count $default_config_ph
- $result %result);
+ $result %diff_result %config_result);
use Carp;
+my $debug = 0;
+
+
=head1 NAME
FML::Merge::FML4::config_ph - handle fml4's config.ph file.
@@ -59,13 +62,14 @@ sub set_default_config_ph
# Descriptions: diff config.ph and return it as HASH_REF.
# Arguments: OBJ($self) STR($file)
# Side Effects: none
-# Return Value: HASH_REF
+# Return Value: ARRAY(HASH_REF, HASH_REF)
sub diff
{
my ($self, $file) = @_;
# reset always
- %result = ();
+ %diff_result = ();
+ %config_result = ();
$self->_load_default_config_ph();
@@ -74,7 +78,7 @@ sub diff
print "error: $@\n" if $@;
# print $result if defined $result;
- return \%result;
+ return( \%config_result, \%diff_result );
}
@@ -149,7 +153,7 @@ sub _gen_eval_string
# Descriptions: generate diff config.ph against defualt_config.ph and
-# save it at %result (global variable).
+# save it at %diff_result (global variable).
# Arguments: STR($package) HASH_REF($stab)
# Side Effects: none
# Return Value: none
@@ -176,7 +180,17 @@ sub dump_variable
$val =~ s/$ml_domain/\$ml_domain/g;
if ($val && ($val ne $def)) {
$rbuf .= "# $key => $val\n";
- $result{ $key } = $val;
+ $diff_result{ $key } = $val;
+ }
+
+ # save all values.
+ $config_result{ $key } = $val;
+
+ if ($debug) {
+ print "CONFIG: $key => $val\n";
+ if ($diff_result{ $key }) {
+ print " DIFF: $diff_result{$key}\n";
+ }
}
}
}