From 4ac35e4fa622d066c1c370e76eeb645efce858c1 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Wed, 5 Jul 2017 18:20:02 -0700 Subject: [PATCH] write out config local files --- bin/local-debbugs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/bin/local-debbugs b/bin/local-debbugs index 6df4b15..4cfb785 100755 --- a/bin/local-debbugs +++ b/bin/local-debbugs @@ -183,6 +183,24 @@ if ($options{daemon}) { print STDERR "Unable to determine if daemon is running: $!\n"; exit 1; } + my $conf = IO::File->new($options{mirror_location}.'/debbugs_config_local','w') or + die "Unable to open $options{mirror_location}/debbugs_config_local for writing: $!"; + print {$conf} <<"EOF"; +\$gConfigDir = "$options{mirror_location}"; +\$gSpoolDir = "$options{mirror_location}"; +\$gWebHost = 'localhost:$options{port}'; +\$gPackageSource = ''; +\$gPseudoDescFile = ''; +\$gPseudoMaintFile = ''; +\$gMaintainerFile = ''; +\$gMaintainerFileOverride = ''; +\$config{source_maintainer_file} = ''; +\$config{source_maintainer_file_override} = ''; +\$gProject = 'Local Debbugs'; +1; +EOF + close $conf; + $ENV{DEBBUGS_CONFIG_FILE} = $options{mirror_location}.'/debbugs_config_local'; # ok, now lets daemonize # XXX make sure that all paths have been turned into absolute @@ -222,6 +240,7 @@ if ($options{daemon}) { sub handle_request { my ($self,$cgi) = @_; + $ENV{DEBBUGS_CONFIG_FILE} = $options{mirror_location}.'/debbugs_config_local'; my $base_uri = 'http://'.$cgi->virtual_host; if ($cgi->virtual_port ne 80) { $base_uri .= ':'.$cgi->virtual_port; -- 2.39.2