sugar 'option'; see below

option foo = bar
      ->  config gitolite-options.foo = bar
This commit is contained in:
Sitaram Chamarty 2012-03-10 13:56:02 +05:30
parent 379b0c9549
commit a0305ec029

View file

@ -45,12 +45,30 @@ sub sugar {
# then our stuff: # then our stuff:
$lines = option($lines);
$lines = owner_desc($lines); $lines = owner_desc($lines);
# $lines = name_vref($lines); # $lines = name_vref($lines);
return $lines; return $lines;
} }
sub option {
my $lines = shift;
my @ret;
# option foo = bar
# -> config gitolite-options.foo = bar
for my $line (@$lines) {
if ( $line =~ /^option (\S+) = (\S.*)/ ) {
push @ret, "config gitolite-options.$1 = $2";
} else {
push @ret, $line;
}
}
return \@ret;
}
sub owner_desc { sub owner_desc {
my $lines = shift; my $lines = shift;
my @ret; my @ret;