compile: change %groups from hash of lists to hash of hashes
This makes it easier to test if a repo is a member of a group, which is required for the delegation feature coming up
This commit is contained in:
parent
c15c75749b
commit
3267c3f4be
|
@ -104,7 +104,7 @@ sub expand_list
|
||||||
{
|
{
|
||||||
die "$ATTN undefined group $item\n" unless $groups{$item};
|
die "$ATTN undefined group $item\n" unless $groups{$item};
|
||||||
# add those names to the list
|
# add those names to the list
|
||||||
push @new_list, @{ $groups{$item} };
|
push @new_list, sort keys %{ $groups{$item} };
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -139,7 +139,7 @@ while (<$conf_fh>)
|
||||||
# user or repo groups
|
# user or repo groups
|
||||||
if (/^(@\S+) = (.*)/)
|
if (/^(@\S+) = (.*)/)
|
||||||
{
|
{
|
||||||
push @{ $groups{$1} }, expand_list( split(' ', $2) );
|
do { $groups{$1}{$_} = 1 } for ( expand_list( split(' ', $2) ) );
|
||||||
# again, we take the more "relaxed" pattern
|
# again, we take the more "relaxed" pattern
|
||||||
die "$ATTN bad group $1\n" unless $1 =~ $REPONAME_PATT;
|
die "$ATTN bad group $1\n" unless $1 =~ $REPONAME_PATT;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue