+ my %groups;
+ foreach my $k (keys %$schema) {
+ if (defined(my $group = $schema->{$k}->{group})) {
+ # When a group is aliased then the key/value pair will match the
+ # schema, but if it's not then the group key contains the key-name
+ # which will not match the group key's defined schema and we have
+ # to match it against that...
+ if (!defined($schema->{$group}->{alias})) {
+ $groups{$group} = 1;
+ }
+ }
+ }