user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] cgit: fix fallout from lazy coderepo loading
@ 2021-03-18 23:27 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2021-03-18 23:27 UTC (permalink / raw)
  To: meta

We can't completely instantiate our cgit wrapper without knowing
knowing cgit locations for serving static content.

Fixes: a5968dc059f655a ("config: lazy-load coderepos, support extindex")
---
 lib/PublicInbox/Cgit.pm   | 8 ++++++--
 lib/PublicInbox/Config.pm | 4 ----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/PublicInbox/Cgit.pm b/lib/PublicInbox/Cgit.pm
index f38e8b6b..8ad07be2 100644
--- a/lib/PublicInbox/Cgit.pm
+++ b/lib/PublicInbox/Cgit.pm
@@ -53,14 +53,18 @@ sub locate_cgit ($) {
 sub new {
 	my ($class, $pi_cfg) = @_;
 	my ($cgit_bin, $cgit_data) = locate_cgit($pi_cfg);
-
+	# TODO: support gitweb and other repository viewers?
+	if (defined(my $cgitrc = $pi_cfg->{-cgitrc_unparsed})) {
+		$pi_cfg->parse_cgitrc($cgitrc, 0);
+	}
 	my $self = bless {
 		cmd => [ $cgit_bin ],
 		cgit_data => $cgit_data,
 		pi_cfg => $pi_cfg,
 	}, $class;
 
-	$pi_cfg->fill_all; # fill in -code_repos mapped to inboxes
+	# fill in -code_repos mapped to inboxes
+	$pi_cfg->each_inbox($pi_cfg->can('repo_objs'));
 
 	# some cgit repos may not be mapped to inboxes, so ensure those exist:
 	my $code_repos = $pi_cfg->{-code_repos};
diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm
index 1037c884..228de4ff 100644
--- a/lib/PublicInbox/Config.pm
+++ b/lib/PublicInbox/Config.pm
@@ -323,10 +323,6 @@ sub _fill_code_repo {
 	my ($self, $nick) = @_;
 	my $pfx = "coderepo.$nick";
 
-	# TODO: support gitweb and other repository viewers?
-	if (defined(my $cgitrc = delete $self->{-cgitrc_unparsed})) {
-		parse_cgitrc($self, $cgitrc, 0);
-	}
 	my $dir = $self->{"$pfx.dir"}; # aka "GIT_DIR"
 	unless (defined $dir) {
 		warn "$pfx.dir unset\n";

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-18 23:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 23:27 [PATCH] cgit: fix fallout from lazy coderepo loading Eric Wong

user/dev discussion of public-inbox itself

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 meta meta/ https://public-inbox.org/meta \
		meta@public-inbox.org
	public-inbox-index meta

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://ou63pmih66umazou.onion/inbox.comp.mail.public-inbox.meta
	nntp://czquwvybam4bgbro.onion/inbox.comp.mail.public-inbox.meta
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.io/gmane.mail.public-inbox.general
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/public-inbox.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git