compile: make the parse a function instead of inline
Again, prep for delegation, when we'll be reading fragments of config rules from various files and tacking them onto the %repos hash. note: this patch best viewed with "git diff -w", clicking "Ignore space change" in gitk, or eqvt :-)
This commit is contained in:
parent
3267c3f4be
commit
34a6f89c26
|
@ -119,7 +119,10 @@ sub expand_list
|
||||||
# "compile" GL conf
|
# "compile" GL conf
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
my $conf_fh = wrap_open( "<", $GL_CONF );
|
sub parse_conf_file
|
||||||
|
{
|
||||||
|
my ($conffile) = @_;
|
||||||
|
my $conf_fh = wrap_open( "<", $conffile );
|
||||||
|
|
||||||
# the syntax is fairly simple, so we parse it inline
|
# the syntax is fairly simple, so we parse it inline
|
||||||
|
|
||||||
|
@ -192,6 +195,9 @@ while (<$conf_fh>)
|
||||||
die "$ATTN can't make head or tail of '$_'\n";
|
die "$ATTN can't make head or tail of '$_'\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parse_conf_file($GL_CONF);
|
||||||
|
|
||||||
my $compiled_fh = wrap_open( ">", $GL_CONF_COMPILED );
|
my $compiled_fh = wrap_open( ">", $GL_CONF_COMPILED );
|
||||||
print $compiled_fh Data::Dumper->Dump([\%repos], [qw(*repos)]);
|
print $compiled_fh Data::Dumper->Dump([\%repos], [qw(*repos)]);
|
||||||
|
|
Loading…
Reference in a new issue