+sub get_1 {
+ my ($self, $key) = @_;
+ my $v = $self->{$key};
+ return $v if !ref($v);
+ warn "W: $key has multiple values, only using `$v->[-1]'\n";
+ $v->[-1];
+}
+
+sub repo_objs {
+ my ($self, $ibxish) = @_;
+ my $ibx_code_repos = $ibxish->{coderepo} // return;
+ $ibxish->{-repo_objs} // do {
+ my $code_repos = $self->{-code_repos};
+ my @repo_objs;
+ for my $nick (@$ibx_code_repos) {
+ my @parts = split(m!/!, $nick);
+ for (@parts) {
+ @parts = () unless valid_foo_name($_);
+ }
+ unless (@parts) {
+ warn "invalid coderepo name: `$nick'\n";
+ next;
+ }
+ my $repo = $code_repos->{$nick} //=
+ fill_code_repo($self, $nick);
+ push @repo_objs, $repo if $repo;
+ }
+ if (scalar @repo_objs) {
+ $ibxish->{-repo_objs} = \@repo_objs;
+ } else {
+ delete $ibxish->{coderepo};
+ }
+ }
+}