Permalink
Browse files

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
  • Loading branch information...
1 parent c15c757 commit 3267c3f4be80d707e49287c4181f14d17f0e047d Sitaram Chamarty committed Oct 2, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/gl-compile-conf
View
@@ -104,7 +104,7 @@ sub expand_list
{
die "$ATTN undefined group $item\n" unless $groups{$item};
# add those names to the list
- push @new_list, @{ $groups{$item} };
+ push @new_list, sort keys %{ $groups{$item} };
}
else
{
@@ -139,7 +139,7 @@ while (<$conf_fh>)
# user or repo groups
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
die "$ATTN bad group $1\n" unless $1 =~ $REPONAME_PATT;
}

0 comments on commit 3267c3f

Please sign in to comment.