1 # Copyright (C) 2016 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 # Represents a public-inbox (which may have multiple mailing addresses)
5 package PublicInbox::Inbox;
8 use Scalar::Util qw(weaken);
12 my ($class, $opts) = @_;
18 weaken($self->{$_}) foreach qw(git mm search);
23 $self->{git} ||= eval { PublicInbox::Git->new($self->{mainrepo}) };
28 $self->{mm} ||= eval { PublicInbox::Msgmap->new($self->{mainrepo}) };
33 $self->{search} ||= eval { PublicInbox::Search->new($self->{mainrepo}) };
39 if (open(my $fh, '<', $path)) {
48 my $desc = $self->{description};
49 return $desc if defined $desc;
50 $desc = try_cat("$self->{mainrepo}/description");
53 $desc = '($GIT_DIR/description missing)' if $desc eq '';
54 $self->{description} = $desc;
59 my $url = $self->{cloneurl};
61 $url = try_cat("$self->{mainrepo}/cloneurl");
62 my @url = split(/\s+/s, $url);
64 $self->{cloneurl} = \@url;
69 my $footer = $self->{footer};
70 return $footer if defined $footer;
71 $footer = try_cat("$self->{mainrepo}/public-inbox/footer.html");
73 $self->{footer} = $footer;