[interchange-cvs] interchange - racke modified lib/Vend/Config.pm
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Fri Mar 24 13:01:22 EST 2006
User: racke
Date: 2006-03-24 18:01:22 GMT
Modified: lib/Vend Config.pm
Log:
simplify utilization of GlobalSubs for Config parse routines, now we can do:
GlobalSub <<EOS
sub parse_bar {
...
}
EOS
AddDirective Foo bar
Revision Changes Path
2.202 +8 -3 interchange/lib/Vend/Config.pm
rev 2.202, prev_rev 2.201
Index: Config.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.201
retrieving revision 2.202
diff -u -r2.201 -r2.202
--- Config.pm 2 Mar 2006 16:08:28 -0000 2.201
+++ Config.pm 24 Mar 2006 18:01:22 -0000 2.202
@@ -1,6 +1,6 @@
# Vend::Config - Configure Interchange
#
-# $Id: Config.pm,v 2.201 2006/03/02 16:08:28 jon Exp $
+# $Id: Config.pm,v 2.202 2006/03/24 18:01:22 racke Exp $
#
# Copyright (C) 2002-2006 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -54,7 +54,7 @@
use Vend::Data;
use Vend::Cron;
-$VERSION = substr(q$Revision: 2.201 $, 10);
+$VERSION = substr(q$Revision: 2.202 $, 10);
my %CDname;
my %CPname;
@@ -2789,7 +2789,12 @@
return '' unless $val;
my($dir, $parser, $default) = split /\s+/, $val, 3 ;
if(! defined &{"parse_$parser"} and ! defined &{"$parser"}) {
- $parser = undef;
+ if (defined $Global::GlobalSub->{"parse_$parser"}) {
+ no strict 'refs';
+ *{"Vend::Config::parse_$parser"} = $Global::GlobalSub->{"parse_$parser"};
+ } else {
+ $parser = undef;
+ }
}
$default = '' if ! $default or $default eq 'undef';
$Global::AddDirective = [] unless $Global::AddDirective;
More information about the interchange-cvs
mailing list