compile: move checking of reponame/repopatt/username out of expand_list

let expand_list be just that "expand a list", and leave checking to be
done outside.

otherwise, commit 690604d79 has the side effect of restricting refs to
$REPOPATT_PATT, and so for instance barfing on the perfectly valid

    RW+ refs/(?!heads/master) = alice bob

(thanks to Teemu for catching this)
This commit is contained in:
Sitaram Chamarty 2010-02-18 06:10:08 +05:30
parent 087aa274c6
commit 16cea9bf8c

View file

@ -133,8 +133,6 @@ sub expand_list
for my $item (@list) for my $item (@list)
{ {
die "$ABRT bad user or repo name $item\n"
unless ($GL_WILDREPOS ? $item =~ $REPOPATT_PATT : $item =~ $REPONAME_PATT) or $item =~ $USERNAME_PATT;
if ($item =~ /^@/) # nested group if ($item =~ /^@/) # nested group
{ {
die "$ABRT undefined group $item\n" unless $groups{$item}; die "$ABRT undefined group $item\n" unless $groups{$item};
@ -198,6 +196,7 @@ sub parse_conf_file
@repos = keys %repos; @repos = keys %repos;
} else { } else {
@repos = expand_list ( @repos ); @repos = expand_list ( @repos );
do { die "$ABRT bad reponame $_\n" unless ($GL_WILDREPOS ? $_ =~ $REPOPATT_PATT : $_ =~ $REPONAME_PATT) } for @repos;
} }
s/\bCREAT[EO]R\b/\$creater/g for @repos; s/\bCREAT[EO]R\b/\$creater/g for @repos;
} }