Eliminate dependencies on any particular absolute path.
authorRobert Haas <robertmhaas@gmail.com>
Sat, 23 May 2009 02:54:01 +0000 (22:54 -0400)
committerRobert Haas <robertmhaas@gmail.com>
Sat, 23 May 2009 02:54:01 +0000 (22:54 -0400)
Also, use pgcommitfest for database & database username, rather than
commitfest and rhaas respectively.

bin/server.fpl
etc/httpd.conf.template
perl-lib/PgCommitFest/Handler.pm
perl-lib/PgCommitFest/Request.pm

index ed4b347a27ca28da127fae7915a6ed1e4ade2827..5e5fc26a7ae417bed18b4e2405011c29ab42a105 100755 (executable)
@@ -1,8 +1,10 @@
 #!/usr/bin/perl
 
-use lib '/home/rhaas/commitfest/perl-lib';
-use PgCommitFest::Handler;
 use strict;
 use warnings;
 
+die "Must set PGCOMMITFEST_ROOT to root directory of installation!\n"
+       if !defined $ENV{'PGCOMMITFEST_ROOT'} || ! -d $ENV{'PGCOMMITFEST_ROOT'};
+unshift @INC, $ENV{'PGCOMMITFEST_ROOT'} . '/perl-lib';
+require PgCommitFest::Handler;
 PgCommitFest::Handler::main_loop();
index ba6b721b4cbf98c6ecc086752821d74da2b78de6..9425b424e3ee7277b8d1dcf1cf110a6b748e5ccb 100644 (file)
@@ -2,6 +2,7 @@
     DocumentRoot "BASEPATH/html"
     RewriteEngine On
        # Need mod_cgid installed and configured to handle .fpl files.
+       DefaultInitEnv PGCOMMITFEST_ROOT BASEPATH
     RewriteRule ^/$ BASEPATH/bin/server.fpl
     RewriteRule ^/action/ BASEPATH/bin/server.fpl
 </VirtualHost>
index b2a32ad20a4396a396dab81ba9e7744d628a0a68..13af0fd91e9692b3cac4c78b73d8a7fa15eb6388 100644 (file)
@@ -27,8 +27,8 @@ our %ACTION = (
        'patch_comment_delete'          => \&PgCommitFest::PatchComment::delete
 );
 
-our $PG = 'dbi:Pg:dbname=commitfest';
-our $PGUSERNAME = 'rhaas';
+our $PG = 'dbi:Pg:dbname=pgcommitfest';
+our $PGUSERNAME = 'pgcommitfest';
 our $PGPASSWORD = '';
 
 sub main_loop {
index 7e3e87839a76a90932631593dde276609b194d00..4ceaf7fc9dedddb1d233025841878ebd5a398c51 100644 (file)
@@ -7,7 +7,9 @@ require Template::Plugin::HTML;
 use strict;
 use warnings;
 
-our $ROOT = '/home/rhaas/commitfest';
+die "Must set PGCOMMITFEST_ROOT to root directory of installation!\n"
+       if !defined $ENV{'PGCOMMITFEST_ROOT'} || ! -d $ENV{'PGCOMMITFEST_ROOT'};
+our $ROOT = $ENV{'PGCOMMITFEST_ROOT'};
 our $template = Template->new({ 'INCLUDE_PATH' => $ROOT . '/template',
        'FILTERS' => { 'htmlsafe' => \&PgCommitFest::WebControl::escape } });
 $CGI::POST_MAX = 65536;