[interchange-cvs] interchange - jon modified lib/Vend/Config.pm
interchange-core@interchange.redhat.com
interchange-core@interchange.redhat.com
Wed Jan 2 18:37:01 2002
User: jon
Date: 2002-01-02 23:36:48 GMT
Modified: lib/Vend Config.pm
Log:
Rearrange parse sub calls in closures a bit to improve readability.
AFAICT, doesn't affect functionality at all.
Revision Changes Path
2.19 +12 -8 interchange/lib/Vend/Config.pm
rev 2.19, prev_rev 2.18
Index: Config.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.18
retrieving revision 2.19
diff -u -u -r2.18 -r2.19
--- Config.pm 2002/01/02 23:25:57 2.18
+++ Config.pm 2002/01/02 23:36:48 2.19
@@ -1,6 +1,6 @@
# Vend::Config - Configure Interchange
#
-# $Id: Config.pm,v 2.18 2002/01/02 23:25:57 jon Exp $
+# $Id: Config.pm,v 2.19 2002/01/02 23:36:48 jon Exp $
#
# Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
#
@@ -95,7 +95,7 @@
use Vend::Parse;
use Vend::Util;
-$VERSION = substr(q$Revision: 2.18 $, 10);
+$VERSION = substr(q$Revision: 2.19 $, 10);
my %CDname;
@@ -736,13 +736,17 @@
# Create closure that reads and sets config values
my $read = sub {
my ($lvar, $value, $tie) = @_;
- $parse = $parse{$lvar};
- # call the parsing function for this directive
+
+ # parse variables in the value if necessary
if($C->{ParseVariables} and $value =~ /(?:__|\@\@)/) {
save_variable($CDname{$lvar}, $value);
$value = substitute_variable($value);
}
+
+ # call the parsing function for this directive
+ $parse = $parse{$lvar};
$value = &$parse($CDname{$lvar}, $value) if defined $parse and ! $tie;
+
# and set the $C->directive variable
if($tie) {
watch ( $CDname{$lvar}, $value );
@@ -1100,15 +1104,15 @@
return;
}
- $parse = $parse{$lvar};
- # call the parsing function for this directive
-
if (defined $DumpSource{$name{$directive}}) {
$Global::Structure->{ $name{$directive} } = $value;
}
+ # call the parsing function for this directive
+ $parse = $parse{$lvar};
$value = &$parse($name{$lvar}, $value) if defined $parse;
- # and set the Global::directive variable
+
+ # and set the Global::directive variable
${'Global::' . $name{$lvar}} = $value;
$Global::Structure->{ $name{$lvar} } = $value
unless defined $DontDump{ $name{$lvar} };